% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scaffold_parallel.R
\name{scaffold_parallel}
\alias{scaffold_parallel}
\title{Interactive CPU Architect}
\usage{
scaffold_parallel()
}
\value{
Invisibly returns a named list with components: \code{status} ("done",
"cancelled", or "error"), \code{cores} (integer), \code{data_object},
\code{function_name}, and \code{saved_to} (file path or \code{NULL}).
}
\description{
Scans local hardware to determine available CPU cores and generates 
a robust parallel processing scaffold for high-volume data tasks, 
automating the setup of a local cluster.
}
\details{
The function guides the user through the creation of a parallel processing 
pipeline:
\enumerate{
  \item Detects the total number of available CPU cores using `parallel::detectCores()`.
  \item Prompts the user to select the number of cores to dedicate to the task, 
      recommending leaving at least one core free for OS stability.
  \item Collects the names of the target data object and the processing function.
  \item Generates a complete R code snippet that:
      \itemize{
        \item Initializes a cluster using `makeCluster()`.
        \item Exports the required function to the worker nodes via `clusterExport()`.
        \item Executes the computation using `parLapply()`.
        \item Safely shuts down the cluster using `stopCluster()`.
      }
  \item Offers to print the snippet to the console or save it directly to `parallel_scaffold.R`.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  scaffold_parallel()
}
}
