Write the submission query (without script)
Parameters: | job_command : str,
job_name : str, optional (default=”job”)
time : str, optional (default=”24:00:00”)
memory : str, optional (default=4000)
email : str, optional (default=None)
email_options : str, optional (default=None)
log_directory : str, optional (default=None)
backend : {‘sge’, ‘slurm’}, optional (default=”slurm”)
shell_script : str, optional (default=”#!/bin/bash”)
|
---|---|
Returns: | submission_query : str,
|
Examples
First, let’s generate a command for SLURM to launch the program main.py.
>>> from clusterlib.scheduler import submit
>>> script = submit("python main.py --args 1")
>>> print(script)
echo '#!/bin/bash
python main.py --args 1' | sbatch --job-name=job --time=24:00:00 --mem=4000
The job can be latter launched using for instance os.system(script).