BmnRoot
Loading...
Searching...
No Matches
batch_command.h
Go to the documentation of this file.
1#include "function_set.h"
2
3#include <map>
4#include <string>
5
7{
17 string job_begin;
38 batch_commands(string str_scheduler_run_job,
39 string str_array_dependency_option,
40 string str_job_dependency_option,
41 string str_sheduler_priority_option,
42 string str_sheduler_queue_option,
43 string str_sheduler_qos_option,
44 string str_sheduler_workdir_option,
45 string str_operative_memory1_option,
46 string str_sheduler_hosts_option,
47 string str_sheduler_exclude_hosts_option,
48 char c_sheduler_hosts_separation,
49 string str_set_job_variables,
50 string str_check_status_command,
51 string str_run_command,
52 string str_container_run_command,
53 string str_batch_temp_directory,
54 string str_batch_task_id,
55 string str_job_begin)
56 : scheduler_run_job(str_scheduler_run_job)
57 , array_dependency_option(str_array_dependency_option)
58 , job_dependency_option(str_job_dependency_option)
59 , sheduler_priority_option(str_sheduler_priority_option)
60 , sheduler_queue_option(str_sheduler_queue_option)
61 , sheduler_qos_option(str_sheduler_qos_option)
62 , sheduler_workdir_option(str_sheduler_workdir_option)
63 , operative_memory1_option(str_operative_memory1_option)
64 , sheduler_hosts_option(str_sheduler_hosts_option)
65 , sheduler_exclude_hosts_option(str_sheduler_exclude_hosts_option)
66 , sheduler_hosts_separation(c_sheduler_hosts_separation)
67 , set_job_variables(str_set_job_variables)
68 , check_status_command(str_check_status_command)
69 , run_command(str_run_command)
70 , container_run_command(str_container_run_command)
71 , batch_temp_directory(str_batch_temp_directory)
72 , batch_task_id(str_batch_task_id)
73 , job_begin(str_job_begin)
74 {}
75};
76
77map<BATCH_SYSTEM_NAME, batch_commands> mapBS = {
78 {SGE_BATCH_SYSTEM, // Sun Grid Engine commands
79 {/*string scheduler_run_job = */ "qsub -N %s %s -t 1-%d -tc %d",
80 /*string array_dependency_option = */ "-hold_jid_ad ",
81 /*string job_dependency_option = */ "-hold_jid ",
82 /*string sheduler_priority_option = */ " -p %d",
83 /*string sheduler_queue_option = */ " -q %s",
84 /*string sheduler_qos_option = */ "",
85 /*string sheduler_workdir_option = */ " -wd %s",
86 /*string operative_memory1_option = */ " -l h_vmem=%sM",
87 /*string sheduler_hosts_option = */ " -l h=\"(%s)\"",
88 /*string sheduler_exclude_hosts_option = */ " -l h=\"!(%s)\"",
89 /*char sheduler_hosts_separation = */ '|',
90 /*string set_job_variables = */ " -v ",
91 /*string check_status_command = */ "qstat",
92 /*string run_command = */ "qsub",
93 /*string container_run_command = */ "qrsh",
94 /*string batch_temp_directory = */ "${TMPDIR}",
95 /*string batch_task_id = */ "$SGE_TASK_ID",
96 /*string job_begin = */
97 "#!/bin/bash\n#$ -j y\n#$ -cwd\n#$ -S /bin/bash\n\n"
98 "echo \"Start date: `date` (host: `hostname`)\"\n"
99 "echo \"Current directory: `pwd`\"\n\n"}},
100 {SLURM_BATCH_SYSTEM, // SLURM commands
101 {/*string scheduler_run_job = */ "sbatch -J %s %s -a 1-%d%%%d",
102 /*string array_dependency_option = */ "-d aftercorr:",
103 /*string job_dependency_option = */ "-d afterany:",
104 /*string sheduler_priority_option = */ " --nice=%d",
105 /*string sheduler_queue_option = */ " -p %s",
106 /*string sheduler_qos_option = */ " -q %s",
107 /*string sheduler_workdir_option = */ " -D %s",
108 /*string operative_memory1_option = */ " --mem-per-cpu=%sM",
109 /*string sheduler_hosts_option = */ " -w %s",
110 /*string sheduler_exclude_hosts_option = */ " -x %s",
111 /*char sheduler_hosts_separation = */ ',',
112 /*string set_job_variables = */ " --export=",
113 /*string check_status_command = */ "squeue",
114 /*string run_command = */ "sbatch",
115 /*string container_run_command = */ "srun",
116 /*string batch_temp_directory = */ "${TMPDIR}",
117 /*string batch_task_id = */ "$SLURM_ARRAY_TASK_ID",
118 /*string job_begin = */
119 "#!/bin/bash\n\n"
120 "echo \"Start date: `date` (host: `hostname`)\"\n"
121 "echo \"Current directory: `pwd`\"\n\n"}},
122 {TORQUE_BATCH_SYSTEM, // Torque commands
123 {/*string scheduler_run_job = */ "qsub -N %s %s -t 1-%d%%%d",
124 /*string array_dependency_option = */ "-W depend=afteranyarray:", //? unclear for implementation
125 /*string job_dependency_option = */ "-W depend=afterany:",
126 /*string sheduler_priority_option = */ " -p %d",
127 /*string sheduler_queue_option = */ " -q %s",
128 /*string sheduler_qos_option = */ " -l qos=%s",
129 /*string sheduler_workdir_option = */ " -w %s",
130 /*string operative_memory1_option = */ " -l pmem=%smb",
131 /*string sheduler_hosts_option = */ " -l nodes=%s",
132 /*string sheduler_exclude_hosts_option = */ " -l excludenodes=%s",
133 /*char sheduler_hosts_separation = */ '+',
134 /*string set_job_variables = */ " -v ",
135 /*string check_status_command = */ "qstat",
136 /*string run_command = */ "qsub",
137 /*string container_run_command = */ "qrsh",
138 /*string batch_temp_directory = */ "${TMPDIR}",
139 /*string batch_task_id = */ "$PBS_ARRAYID",
140 /*string job_begin = */
141 "#!/bin/bash\n#PBS -j oe\n#PBS -d .\n#PBS -S /bin/bash\n\n"
142 "echo \"Start date: `date` (host: `hostname`)\"\n"
143 "echo \"Current directory: `pwd`\"\n\n"}}};
map< BATCH_SYSTEM_NAME, batch_commands > mapBS
@ TORQUE_BATCH_SYSTEM
@ SGE_BATCH_SYSTEM
@ SLURM_BATCH_SYSTEM
string sheduler_exclude_hosts_option
string check_status_command
string job_dependency_option
string operative_memory1_option
string sheduler_hosts_option
string array_dependency_option
batch_commands(string str_scheduler_run_job, string str_array_dependency_option, string str_job_dependency_option, string str_sheduler_priority_option, string str_sheduler_queue_option, string str_sheduler_qos_option, string str_sheduler_workdir_option, string str_operative_memory1_option, string str_sheduler_hosts_option, string str_sheduler_exclude_hosts_option, char c_sheduler_hosts_separation, string str_set_job_variables, string str_check_status_command, string str_run_command, string str_container_run_command, string str_batch_temp_directory, string str_batch_task_id, string str_job_begin)
string container_run_command
char sheduler_hosts_separation
string sheduler_queue_option
string set_job_variables
string sheduler_priority_option
string batch_temp_directory
string sheduler_qos_option
string scheduler_run_job
string sheduler_workdir_option