Download Curie advanced userguide - VI-HPS

Transcript
Choosing or excluding nodes
SLURM provide s the pos s ibility to choos e or e xclude any node s in the re s e rvation for your job.
To choos e node s :
#! /bin/ba s h
#MS UB -r MyJob_Pa ra
#MS UB -n 32
#
#MS UB -T 1800
#
#MS UB -o e xa mple _%I.o
#MS UB -e e xa mple _%I.e
#MS UB -A pa xxxx
#MS UB -E '-w curie [1000-1003]'
# Re que s t na me
Numbe r of ta s ks to us e
Ela ps e d time limit in s e conds
# S ta nda rd output. %I is the job id
# Error output. %I is the job id
# Proje ct ID
# Include 4 node s (curie 1000 to curie 1003)
s e t -x
cd ${BRIDGE_MS UB_PWD}
ccc_mprun ./a .out
To e xclude node s :
#! /bin/ba s h
#MS UB -r MyJob_Pa ra
#MS UB -n 32
#
#MS UB -T 1800
#
#MS UB -o e xa mple _%I.o
#MS UB -e e xa mple _%I.e
#MS UB -A pa xxxx
#MS UB -E '-x curie [1000-1003]'
# Re que s t na me
Numbe r of ta s ks to us e
Ela ps e d time limit in s e conds
# S ta nda rd output. %I is the job id
# Error output. %I is the job id
# Proje ct ID
# Exclude 4 node s (curie 1000 to curie 1003)
s e t -x
cd ${BRIDGE_MS UB_PWD}
ccc_mprun ./a .out
MPI
Embarrassingly parallel jobs and MPMD jobs
An e mbarras s ingly paralle l job is a job which launch inde pe nde nt proce s s e s . The s e proce s s e s ne e d fe w or
no communications
A MPMD job is a paralle l job which launch diffe re nt e xe cutable s ove r the proce s s e s . A MPMD job can be
paralle l with MPI and can do many communications .
The s e two conce pts are s e parate but we pre s e nt the m toge the r be caus e the way to launch the m on Curie is
s imilar. An s imple e xample in the Curie info page was alre ady give n.
In the following e xample , we us e ccc_mprun to launch the job. srun can be us e d too. We want to launch bin0 on the
MPI rank 0, bin1 on the MPI rank 1 and bin2 on the MPI rank 2. We have firs t to write a s he ll s cript which de s cribe s
the topology of our job:
launch_e xe .s h:
#! /bin/ba s h
if [ $S LURM_PROCID -e q 0 ]
the n
./bin0
fi
if [ $S LURM_PROCID -e q 1 ]
the n
./bin1
fi
if [ $S LURM_PROCID -e q 2 ]
the n
./bin2
fi
We can the n launch our job with 3 proce s s e s :
ccc_mprun -n 3 ./la unch_e xe .s h
The s cript launch_exe.sh mus t have e xe cute pe rmis s ion. Whe n ccc_mprun launche s the job, it will initializ e s ome
e nvironme nt variable s . Among the m, SLURM_PROCID de fine s the curre nt MPI rank.
BullxMPI
MPMD jobs
BullxMPI (or Ope nMPI) jobs can be launche d with mpirun launche r. In this cas e , we have othe r ways to launch MPMD
jobs (s e e e mbarras s ingly paralle l jobs s e ction).
We take the s ame e xample in the e mbarras s ingly paralle l jobs s e ction. The re are the n two ways for launching
MPMD s cripts
We don't ne e d the launch_exe.sh anymore . We can launch dire ctly the job with mpirun command:
mpirun -np 1 ./bin0 : -np 1 ./bin1 : -np 1 ./bin2