Fills a SLURM job template ({{TOKEN}} placeholders) and writes it to disk.
More...
#include <JobScheduler.hpp>
|
| | JobWriter (std::string sensors_path, std::string rules_path) |
| | Reads the required env vars (see file-level table).
|
| |
| int | write_job (const std::string &batch_path, int num_proc=1) |
| | Instantiates the template and writes job_<id>.slurm to disk.
|
| |
|
| void | set_env () |
| | Reads required env vars into env; throws on the first missing one.
|
| |
Fills a SLURM job template ({{TOKEN}} placeholders) and writes it to disk.
Env vars are read once in the constructor. Each write_job() call replaces all tokens, writes job_<id>.slurm next to the batch file, and returns the incrementing job id.
◆ JobWriter()
| JobWriter::JobWriter |
( |
std::string |
sensors_path, |
|
|
std::string |
rules_path |
|
) |
| |
Reads the required env vars (see file-level table).
- Exceptions
-
◆ set_env()
| void JobWriter::set_env |
( |
| ) |
|
|
private |
Reads required env vars into env; throws on the first missing one.
◆ write_job()
| int JobWriter::write_job |
( |
const std::string & |
batch_path, |
|
|
int |
num_proc = 1 |
|
) |
| |
Instantiates the template and writes job_<id>.slurm to disk.
Key tokens: {{BATCH_FILE}} becomes REMOTE_WORKDIR/batch_<id>.<ext> (the per-job rename avoids concurrent-job collisions); sensors/rules keep their names; outputs are fixed names under REMOTE_OUTPUT_DIR.
- Parameters
-
| batch_path | Local path to the batch input file for this job. |
| num_proc | MPI task count; fills the {{NTASKS}} token (#SBATCH --ntasks). Defaults to 1 (single-task job) when the caller doesn't shard. |
- Returns
- The job id (0-based, incremented on each call).
- Exceptions
-
◆ env
◆ job_counter
| int JobWriter::job_counter = 0 |
|
private |
◆ rules_path
| std::string JobWriter::rules_path |
|
private |
◆ sensors_path
| std::string JobWriter::sensors_path |
|
private |
The documentation for this class was generated from the following files: