Skip to content


How to start Majorana Slurm+Shifter job executing arbitrary MJD code

$sbatch batchShifter.slr
$  cat batchShifter.slr
# Example provided by Clinton Wiseman, used public Docker image prepared by C.W. for MJD, runs arbitrary MJD code on PDSF or Cori
#SBATCH --image=wisecg/mjsw:v2
#SBATCH --workdir=/global/homes/w/wisecg/lat
#SBATCH --output=/global/homes/w/wisecg/lat/logs/shifter-%j.txt
#SBATCH -p shared
shifter  /bin/bash ${@}

This example need adjustment of paths for every user.

The bash task script '' requires sourcing of your envirement - if you use Shifter

$  cat .inShifterJobsh
# Here is a minimally working example. I set it up s/t I can pass arbitrary one-line commands to it, e.g.:  
#  sbatch batchShifter.slr './skim_mjd_data 1 1'
#  sbatch batchShifter.slr 'echo ABC'
echo "Job Start:"
echo "Node(s): "$SLURM_JOB_NODELIST
echo "Job ID: "$SLURM_JOB_ID
if [ -n "$SHIFTER_RUNTIME" ]; then
    echo "Shifter image active."
# This runs whatever commands we pass to it.
echo "${@}"
time ${@}
echo "Job Complete:"

You can start Slurm job like this:

sbatch batchShifter.slr './skim_mjd_data 1 1'