Program Definition
add_debasher_process()
Public: Adds a process to a DeBasher program.
$1 - Name of the process to add into the program.
$2 - Computational specifications.
$3 - Additional specifications for the process. Besides “force”, “processdeps”, “alias” and “ext_alias”, an “alias” or “ext_alias” process may also carry an “alias_opt_map” attribute (“OLD:NEW[,OLD:NEW…]”) to rename its own option names into the ones its aliased implementation expects (e.g. “alias_opt_map=-l-a:-l”), invalid without “alias”/”ext_alias”. “sched”, which only a sequential process has, is refused.
Examples:
add_debasher_process "file_writer" "cpus=1 mem=32 time=00:01:00"
add_debasher_process "my_proc" "cpus=1 mem=32 time=00:01:00" "alias=other_proc;alias_opt_map=-l-a:-l"
The function stores the process specification in DEBASHER_INITIAL_PROCESS_SPEC, which debasher_exec later uses to execute the program. Additionally, the function registers the process in a variable used by the DeBasher library, and creates a wrapper function when an alias or heredoc code is provided.
add_debasher_seq_process()
Public: Adds a sequential process to a DeBasher program: a function that the engine never schedules, and that the process function of a task runs as a step with seq_execute or seq_execute_slurm.
Its name and its process function are checked and built as those of a process are, so its code can be a heredoc in Python, R, Perl or Groovy (“<name>_heredoc_py”, …) or an alias, and its name cannot be that of a process or of another sequential process. It needs no methods besides its process function. Its steps run in the shell of the task, whatever the scheduler of the run, unless “sched=SLURM” sends them to Slurm through srun. A resident program cannot have sequential processes.
$1 - Name of the sequential process.
$2 - Computational specifications, each optional (“cpus”, “mem”, “time”, “nodes”, “account”, “partition”), which become options of srun when the step runs on Slurm. “throttle” and a list of values in “mem” or “time” are refused.
$3 - Additional specifications: “alias”, “ext_alias” and “alias_opt_map”, as for a process, and “sched”, the scheduler of its steps (“BUILTIN”, the default, or “SLURM”). “processdeps” and “force” are refused.
Examples:
add_debasher_seq_process "transformation_b" "cpus=1 mem=64 time=00:05:00" "sched=SLURM"
add_debasher_program()
Public: Adds the program defined by another module to the current DeBasher program.
$1 - Name of the module whose program is to be incorporated.
Examples:
load_debasher_module "debasher_array_example"
debasher_subprogram_example_program()
{
add_debasher_program "debasher_array_example"
}
The function executes the program method of the given module, so that all of the processes added by that method become part of the program currently being defined. The module must have been previously loaded by means of the load_debasher_module API function.
program_type()
Public: Sets the type of the program being defined, from the program_type method of its module.
$1 - Program type: “general” (the default, when the module defines no program_type method) or “resident”.
Examples:
program_type "resident"
The function does not return any value. It aborts the execution when given any other type.