Hi CCP4'ers,
Since most HPC centers are moving away from Torque/Maui and on to using
the SLURM queuing system instead and since I have not seen any threads
on how to make ccp4i work with SLURM. I thought someone might be
interested in this?
In inspiration of the "/ccp4i_condorsub/" script, I have made a script
(attached) that allows one to submit CCP4-job to SLURM directly from ccp4i.
All needed is to place the script somewhere on your system and make sure
it is executable.
In "System Administration" -> "Configure Interface" under "Enter names
and commands for batch queues" Choose a suitable name e.g. SLURM ->
select Other in the drop down menu -> add the path to the script in the
last field.
Now to submit a CCP4 job from the GUI (ccp4i), just click "Run" -> "Run
Remote/Batch/Later" -> (make sure the right script is chosen) and hit "Run"
That is it.
Now this only works for the old GUI (ccp4i) and the new GUI (ccp4i2)
seems to be an entire different beast.
The script is BASH and it should work on most setups and if not, it
should be possible to edit the script to make it fit more customized
environments.
Hope you like it?
Cheers,
Jesper
--
Jesper Lykkegaard Karlsen
Scientific Computing
Centre for Structural Biology
Department of Molecular Biology and Genetics
Aarhus University
Gustav Wieds Vej 10C
8000 Aarhus C
E-mail: [email protected]
#!/bin/bash
#
# Simple script for submitting ccp4i jobs to the SLURM queuing system
# Hack inspired from the ccp4i_condorsub script by Ronan Keegan
#
# Jesper Lykkegaard Karlsen 06/04/2017
#
# Takes the ccp4i job com file as input
infile=$2
# Get the def file location, name and the job number
def_file_line=`grep \.def $infile`
def_file=${def_file_line##*-r}
def_file_name=${def_file##*/}
job_number_name=${def_file_name%.*}
# Define and make scratch dir on remote FS
CCP4_REM_SCR=$HOME/.ccp4_rem_scr
if [ ! -d $CCP4_REM_SCR ]; then
mkdir $CCP4_REM_SCR
fi
# Move def_file to CCP4_REM_SRC and define new var
cp -a $def_file $CCP4_REM_SCR/
# Get the project name from the def file
project_line=`grep CCP4I $def_file | grep PROJECT `
project=${project_line##* }
# Create the condor submission script
cat << eof > ${CCP4_REM_SCR}/${job_number_name}_${project}_sbatch.sub
#!/bin/bash
#SBATCH -N1
#SBATCH --share
#SBATCH -o ${CCP4_REM_SCR}/${job_number_name}_${project}_sbatch.out
source /etc/profile.d/modules.sh
module load ccp4-7.0
${CCP4}/bin/ccp4ish -r ${CCP4_REM_SCR}/${def_file_name}
eof
# Submit the job to the Sbatch queue
sbatch ${CCP4_REM_SCR}/${job_number_name}_${project}_sbatch.sub