aiida-core
aiida-core copied to clipboard
Docs: CalcJob resource schema
@agoscinski maybe we can integrate what you already have somewhere? E.g., here: #7005.
No guarantee of completion and correctness. But probably better than nothing.
#SBATCH --nodes={CalcJob::metadata.options.resources.num_machines | Computer::default_mpiprocs_per_machine}
#SBATCH --ntasks-per-node={CalcJob::metadata.options.resources.num_mpiprocs_per_machine}
#SBATCH --partition={CalcJob::metadata.options.queue_name}
...
{CalcJob::metadata.options.custom_scheduler_commands}
{CalcJob::metadata.options.environment_variables translated from dict to 'export KEY=VALUE' pattern}
{Computer::prepend_text}
for Code in CalcJob.inputs
{Code::prepend_text}
endfor
{CalcInfo::prepend_text}
{CalcJob::metadata.options.prepend_text}
for CodeInfo in CalcInfo (remember CalcInfo is what you return in prepare_for_submission)
// COMMAND = {Code::filepath_executable} {CodeInfo::cmdline_params} < {CodeInfo::stdin_name} > {CodeInfo::stdout_name} 2> {CodeInfo::stderr_name} {& if CalcInfo.codes_run_mode == CodeRunMode.PARALLEL}
if CalcJob::metadata.options.withmpi
// MPI_RUN_CMD = {Computer::mpirun_run_cmd with string interpolation for the CalcJob::metadata.options.resources parameters} {CalcJob::metadata.options.mpirun_extra_params} {COMMAND}
{MPI_RUN_CMD} {COMMAND}
else
{COMMAND}
endif
if CalcInfo.codes_run_mode == CodeRunMode.PARALLEL:
wait
endif
endfor
{CalcJob::metadata.options.append_text}
{CalcInfo::append_text}
for Code in CalcJob.inputs
{Code::append_text}
endfor
{Computer::append_text}
// Some footer but not relevant for slurm
The existing CalcJob documentation is here already explaining options https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/calculations/usage.html I feel like #7005 implies more major restructures. Maybe it is easier to just copy it to this section in the doc.