Hi Wyatt,
I apologize for SLURM not working correctly. As a caveat, I have to admit, that I do not have access to a system with SLURM. As you have found out, run.sh
functions as a wrapper around how to submit to three queueing systems: LSF, PBS, and SLURM. It tries to guess what queueing system you have by checking what submission commands are available. It does this in function system_queue()
, where run.sh
checks if sub
, qsub
, or sbatch
is in your path as to identify LSF, PBS, or SLURM respectively. This of course all hinges around you executing run.sh
on the cluster on which you are submitting your jobs. A function slurm_run()
is already present in the distributed run.sh
, which used https://slurm.schedmd.com/rosetta.pdf to translate PBS into SLURM commands. I noticed – that in the current distribution – this function is calling qsub
instead of sbatch
. The correct definition of slurm_run()
should be
slurm_run() {
local options="--job-name ${project}";
local command="-submit slurm $@";
command="$(echo "${command}" | sed 's/"/\\"/g')";
if [ "${starttime}" != "now" -a "${starttime}" != "" ]; then
options="${options} --begin=$(set_time 3 ${starttime})"; fi;
if [ "${walltime}" != "" ]; then
options="--time=$(set_time 3 ${walltime})"; fi;
if [ "${wait}" != "" ]; then
options="${options} --dependency=afterany:$wait"; fi;
if [ "${queue}" != "" -a "${queue}" != "default" ]; then
options="${options} -p ${queue}"; fi;
if [ "${account}" != "" -a "${account}" != "none" ]; then
options="${options} --account=${account}"; fi;
# note: add ALL to --export?
echo "sbatch ${options}" "${user[@]}" \
"-n ${nprocs}" \
"--export=nprocs=${n},command=\"${command}\"" \
"-e $(pwd)/${project}.e -o $(pwd)/${project}.o ${subscript}";
eval sbatch ${options} ${user[@]} \
-n ${nprocs} \
--export=nprocs=${n},command="\"${command}\"" \
-e $(pwd)/${project}.e -o $(pwd)/${project}.o ${subscript};
sleep ${sleep};
}
I’m including a corrected version, to be placed in ${EMC_ROOT}/scripts
:
run.sh (21.5 KB)
You could use run.sh
directly as to submit a small test script to your system with which you check valid submission. This test script could – for instance – hold nothing more than
#!/bin/bash
echo "Hello world!";
I know that the above works for both LSF and PBS. Can you be more precise on what exactly does not seem to work for SLURM?
You could add a symbolic link to your systems LAMMPS executable as a work-around for the lmp_${HOST}
issue. I use ${HOME}/bin
for all such oddities. You could do the following
cd ${HOME}/bin
ln -s your/systems/lammps/lmp lmp_${HOST}
and add ${HOME}/bin
to your path in your .bashrc
, e.g. by adding
export PATH=${PATH}:${HOME}/bin
at the end of your .bashrc
. Might I ask, what the LAMMPS executable is called on your system?