Rungen: Difference between revisions

From Wiki
Jump to navigation Jump to search
Rgarcia (talk | contribs)
modified it to remove MN4 and add MN5
Line 10: Line 10:
*Queues c (or c0) and q (or q0) are part of [[tekla]].
*Queues c (or c0) and q (or q0) are part of [[tekla]].
*Queues 4 8 and 12 are interpreted as c4m8... etc, on [[tekla2]].
*Queues 4 8 and 12 are interpreted as c4m8... etc, on [[tekla2]].
*Queues 16a 16b and 16c are interpreted as ''class_a'', ''class_b'' and ''class_c'' on [[MareNostrum]].   
*Queues 112a are interpreted as ''gp_resa'' on [[MareNostrum]].   
*This script has a security control to avoid sending a calculation with the wrong number of processors.
*This script has a security control to avoid sending a calculation with the wrong number of processors.
*Please verify the default version of VASP that you want to use on each queue.
*Please verify the default version of VASP that you want to use on each queue.
*By default I use Infiniband in the c12m28ib queue, with 24 or more processors.
*By default I use Infiniband in the c12m128ib queue, with 24 or more processors.
*I put another security control, named [[savecalc]] that is run before VASP, in case you need to do a long optimization.
*I put another security control, named [[savecalc]] that is run before VASP, in case you need to do a long optimization.
*You have two quickly accesible log files: o_* that is the standard output and e_* that contains the errors.
*You have two quickly accesible log files: o_* that is the standard output and e_* that contains the errors.
Line 35: Line 35:
  rungen neb 12 48 5.3.5-IB_VTST_GAMMA
  rungen neb 12 48 5.3.5-IB_VTST_GAMMA


* In MareNostrum, use 48a, 48b, 48c, and 48d for class_a, class_b, class_c, and debug queues:  
* In MareNostrum, use 112a for gpresa, and debug queues:  
  rungen neb 48 96  
  rungen neb 48 96  


Line 51: Line 51:


  #!/bin/bash
  #!/bin/bash
##########################################
 
# Rodrigo García-Muelas @ iciq-Tgn      #
##########################################
# Created: Jan 11, 2013                  #
# Rodrigo García-Muelas @ iciq-Tgn      #
# Edit 2 : Nov 17, 2017                  #
# Created: Jan 11, 2013                  #
##########################################
# Edit N : Apr 30, 2024                #
##########################################
# Input ##################################   
 
# 1 # name
# Input ##################################   
# 2 # queue id
# 1 # name
# 3 # number of processors
# 2 # queue id
# 4 # version
# 3 # number of processors
##########################################
# 4 # version
##########################################
# To run in local, write on command line: mpirun -np 2 vasp                                       
 
# To run in local, write on command line: mpirun -np 2 vasp                                       
# tekla1, tekla2 or marenostrum ##########
 
tk1=0 ; tk2=0 ; mar=0 ; csc=0 ;  
# tekla1, tekla2 or marenostrum ##########
case $2 in
tk1=0 ; tk2=0 ; mar=0 ; csc=0 ;  
  c|c0) queue=c0      ; tk1=1 ; procqueue=1  ;;
case $2 in
  q|q0) queue=q0      ; tk1=1 ; procqueue=4  ;;
c|c0) queue=c0      ; tk1=1 ; procqueue=1  ;;
  4)    queue=c4m8    ; tk2=1 ; procqueue=4  ;;
q|q0) queue=q0      ; tk1=1 ; procqueue=4  ;;
  8)    queue=c8m24    ; tk2=1 ; procqueue=8  ;;
4)    queue=c4m8    ; tk2=1 ; procqueue=4  ;;
  12)  queue=c12m48ib ; tk2=1 ; procqueue=12 ;;
8)    queue=c8m24    ; tk2=1 ; procqueue=8  ;;
  24)  queue=c24m128ib; tk2=1 ; procqueue=24 ;;
12)  queue=c12m48ib ; tk2=1 ; procqueue=12 ;;
   16a)  queue=class_a  ; mar=3 ; procqueue=16 ; maxhours=71 ;;  
24)  queue=c24m128ib; tk2=1 ; procqueue=24 ;;
  16b) queue=class_b ; mar=3 ; procqueue=16 ; maxhours=47 ;;  
28)   queue=c28m128ib; tk2=1 ; procqueue=28 ;;
  16c) queue=class_c  ; mar=3 ; procqueue=16 ; maxhours=23 ;;  
112a) queue=gp_resa ; mar=5 ; procqueue=112 ; maxhours=24 ;; # maxhours: 71   
  16d)  queue=debug    ; mar=3 ; procqueue=16 ; maxhours=00 ;;
*)   echo "Error in queue name!!! " ; exit ;;
  48a)  queue=class_a  ; mar=4 ; procqueue=48 ; maxhours=71 ;;
esac
  48b)  queue=class_b  ; mar=4 ; procqueue=48 ; maxhours=47 ;;  
 
  48c)  queue=class_c  ; mar=4 ; procqueue=48 ; maxhours=23 ;;
# MOD should be 0 ########################
   48d)  queue=debug    ; mar=4 ; procqueue=48 ; maxhours=01 ;;  
let AAA=`expr $3 % $procqueue`
  *)    echo "Error in queue name!!! " ; exit ;;
#echo $AAA
  esac
if [ 0 -ne $AAA ] ; then echo "Error in number of processors" ; exit ; fi
   
##########################################
  # MOD should be 0 ########################
 
let AAA=`expr $3 % $procqueue`
# version
  #echo $AAA
 
if [ 0 -ne $AAA ] ; then echo "Error in number of processors" ;  exit ; fi
if [ -z $4 ] ; then
##########################################
   if  [ $mar = 5 ] ; then vaspversion="5.4.4"
  elif [  $2 4 ] ; then vaspversion="5.3.5"
# version
  elif [ $2 = 8 ] ; then vaspversion="5.3.5"
  elif [ $2 = 12 ] ; then if [ $3 -gt 12 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
if [ -z $4 ] ; then
  elif [ $2 = 24 ] ; then if [ $3 -gt 24 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
  if   [ $mar = 1 ] ; then vaspversion="5.3.3"
elif [ $2 = 28 ] ; then if [ $3 -gt 28 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
  elif [  $2 =  4 ] ; then vaspversion="5.4.4"
   elif [ $tk1 = 1 ] ; then vaspversion="4.6"  
  elif [  $2 =  8 ] ; then vaspversion="5.4.4"
  fi
  elif [  $2 = 12 ] ; then if [ $3 -gt 12 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
else vaspversion=$4 ; fi
  elif [  $2 = 24 ] ; then if [ $3 -gt 24 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
 
  elif [ $tk1 = 1 ] ; then vaspversion="4.6" 
# queues of tekla1 #######################
  elif [ $mar = 4 ] ; then vaspversion="vasp_std"  
if [ $tk1 = 1 ] ; then mpi=_mpi ;
  fi
E=`pwd`; ofile=`echo $E/o_\\$JOB_NAME.\\$JOB_ID` ; efile=`echo $E/e_\\$JOB_NAME.\\$JOB_ID` ;  
else vaspversion=$4 ; fi
cat >run.sh<<!
#!/bin/bash
# echo $1
 
# echo $2
#$ -N $1
# echo $3
 
# echo $queue
#  pe request
# echo "hola"
#$ -pe $queue $3
# echo $AAA
#$ -M rseemakurthi@iciq.es
# echo $tk1
#$ -o $ofile
# echo $tk2
#$ -e $efile
# echo $mar
 
# echo $version
cd $E ; /home/rseemakurthi/bin/savecalc  
/usr/bin/mpirun -np $3 -machinefile \$TMPDIR/machines /usr/local/bin/vasp ; rm -f CHG
##########################################
 
!
fi
# queues of tekla1 #######################
##########################################
if [ $tk1 = 1 ] ; then mpi=_mpi ;  
 
E=`pwd`; ofile=`echo $E/o_\\$JOB_NAME.\\$JOB_ID` ; efile=`echo $E/e_\\$JOB_NAME.\\$JOB_ID` ;
 
cat >run.sh<<!
# queues of tekla2 #######################
#!/bin/bash
if [ $tk2 = 1 ] ; then mpi=_mpi ; cat >run.sh<<!
#!/bin/bash
#$ -N $1
### SGE Parameters #######################
#$ -S /bin/bash
#  pe request
#$ -N $1
#$ -pe $queue $3
#$ -cwd
#$ -M rgarcia@iciq.es
#$ -masterq $queue.q
#$ -o $ofile
#$ -pe $queue$mpi $3
#$ -e $efile
#$ -m ae
#$ -M rseemakurthi@iciq.es
cd $E ; /home/rgarcia/bin/savecalc 
#$ -o o_\$JOB_NAME.\$JOB_ID
/usr/bin/mpirun -np $3 -machinefile \$TMPDIR/machines /usr/local/bin/vasp ; rm CHG
#$ -e e_\$JOB_NAME.\$JOB_ID
### Load Environment Variables ###########
!
. /etc/profile.d/modules.sh
fi
module load vasp/$vaspversion
##########################################
### Run Job ##############################
export OMP_NUM_THREADS=1
echo \$PWD >> o_\$JOB_NAME.\$JOB_ID
# queues of tekla2 #######################
echo \$TMP >> o_\$JOB_NAME.\$JOB_ID
if [ $tk2 = 1 ] ; then mpi=_mpi ; cat >run.sh<<!
~/bin/savecalc ; mpirun -np \$NSLOTS vasp_std ; # rm -f CHG
#!/bin/bash
!
### SGE Parameters #######################
fi
#$ -S /bin/bash
##########################################
#$ -N $1
 
#$ -cwd
# queues of Marenostrum 5 ################
#$ -masterq $queue.q
if [ $mar = 5 ] ; then cat >run.sh<<!
#$ -pe $queue$mpi $3
#!/bin/bash   
#$ -m ae
#SBATCH --account=iciq72
#$ -M rgarcia@iciq.es
#SBATCH --qos=$queue
#$ -o o_\$JOB_NAME.\$JOB_ID
#SBATCH --time=$maxhours:00:00 
#$ -e e_\$JOB_NAME.\$JOB_ID
#SBATCH --job-name=$1 
### Load Environment Variables ###########
#SBATCH --cpus-per-task=1 
. /etc/profile.d/modules.sh
#SBATCH --tasks-per-node=112 
module load vasp/$vaspversion
#SBATCH --ntasks=$3 
### Run Job ##############################
#SBATCH --output=o_$1.%j
export OMP_NUM_THREADS=1
#SBATCH --error=e_$1.%j
echo \$PWD >> o_\$JOB_NAME.\$JOB_ID
 
echo \$TMP >> o_\$JOB_NAME.\$JOB_ID
module load hdf5
~/bin/savecalc ; mpirun -np \$NSLOTS vasp ; rm CHG
module load vasp/$vaspversion
!
#module load mkl
fi
~/bin/savecalc ;srun /apps/GPP/VASP/$vaspversion/INTEL/IMPI/bin/vasp_std  
##########################################
 
!
fi
# queues of Marenostrum 3 ################
##########################################
if [ $mar = 3 ] ; then cat >run.sh<<!
#!/bin/bash
#BSUB -J $1
#BSUB -q $queue
#BSUB -n $3
#BSUB -W $maxhours:59
#BSUB -o o_$1.%J
#BSUB -e e_$1.%J
#BSUB -u rgarcia@iciq.es
#BSUB -R"span[ptile=16]"
### Load environment variables ###########
module load VASP/$vaspversion
### Run job ##############################
~/bin/savecalc ; mpirun vasp.complex ; rm CHG
!
fi
##########################################
# queues of Marenostrum 4 ################
if [ $mar = 4 ] ; then cat >run.sh<<!
#!/bin/bash   
#SBATCH --qos=$queue 
#SBATCH --time=$maxhours:59:00 
#SBATCH --job-name=$1 
#SBATCH --cpus-per-task=1 
#SBATCH --tasks-per-node=48 
#SBATCH --ntasks=$3 
#SBATCH --output=o_$1.%j
#SBATCH --error=e_$1.%j
   
module load vasp/5.4.4
srun  /apps/VASP/5.4.4/INTEL/IMPI/bin/$vaspversion  
!
fi
##########################################

Revision as of 15:07, 2 May 2024

go back to Main Page, Group Pages, Núria López and Group, Scripts_for_VASP

Instructions: 1) Put this script as executable on your ~/bin/ folder (recomended name: rungen). 2) Put your email instead of youremail@iciq.es. 3) Do the same with savecalc.

To generate a run.sh file, write on a terminal:

$ rungen <name_of_job> <queue> <number_of_processors> <(optional)vasp_version> 

Notes:

  • <<name_of_job>> should start with a letter, not a number or another special character.
  • Queues c (or c0) and q (or q0) are part of tekla.
  • Queues 4 8 and 12 are interpreted as c4m8... etc, on tekla2.
  • Queues 112a are interpreted as gp_resa on MareNostrum.
  • This script has a security control to avoid sending a calculation with the wrong number of processors.
  • Please verify the default version of VASP that you want to use on each queue.
  • By default I use Infiniband in the c12m128ib queue, with 24 or more processors.
  • I put another security control, named savecalc that is run before VASP, in case you need to do a long optimization.
  • You have two quickly accesible log files: o_* that is the standard output and e_* that contains the errors.


go back to Main Page, Group Pages, Núria López and Group, Scripts_for_VASP

This script allows you to generate run.sh files for tekla2 and MareNostrum4. It also worked for MareNostrum3. If you make a mistake in the number of processors the script will tell to you, so you'd better use this script (or someone similar) every time you prepare a new calculation.

Instructions

  • Create ~/bin/rungen and put the content below
  • Make it executable
chmod +x ~/bin/rungen
  • To use it in tekla, put the name, the queue (4, 8, 12, or 24), and the number of processors. If you make a mistake in the number of processors the script will tell to you.
rungen nanoparticle 12 60 
  • You can change the VASP version using an additional fourth input variable:
rungen neb 12 48 5.3.5-IB_VTST_GAMMA
  • In MareNostrum, use 112a for gpresa, and debug queues:
rungen neb 48 96 
  • If you want to change the VASP version, go to this folder to see what versions do you have available. The default is vasp_std:
/apps/VASP/5.4.4/INTEL/IMPI/bin/ 
rungen neb 48 96 vasp_gam_sol
  • If you want to use an exotic flavour that is not yet compiled for the version you are using, you can request MareNostrum people to compile it. Ask your boss before doing the request. Otherwise, you can use an older version of VASP. Feel free to explore into these MareNostrum folders:
/apps/VASP/
  • Remember to adapt your parallelization to the machine and processors you use each time.[1]


rungen

#!/bin/bash
  1. Rodrigo García-Muelas @ iciq-Tgn #
  2. Created: Jan 11, 2013 #
  3. Edit N : Apr 30, 2024 #
  1. Input ##################################
  2. 1 # name
  3. 2 # queue id
  4. 3 # number of processors
  5. 4 # version
  1. To run in local, write on command line: mpirun -np 2 vasp
  1. tekla1, tekla2 or marenostrum ##########

tk1=0 ; tk2=0 ; mar=0 ; csc=0 ; case $2 in

c|c0) queue=c0       ; tk1=1 ; procqueue=1  ;;
q|q0) queue=q0       ; tk1=1 ; procqueue=4  ;;
4)    queue=c4m8     ; tk2=1 ; procqueue=4  ;;
8)    queue=c8m24    ; tk2=1 ; procqueue=8  ;;
12)   queue=c12m48ib ; tk2=1 ; procqueue=12 ;;
24)   queue=c24m128ib; tk2=1 ; procqueue=24 ;;
28)   queue=c28m128ib; tk2=1 ; procqueue=28 ;;
112a) queue=gp_resa  ; mar=5 ; procqueue=112 ; maxhours=24 ;; # maxhours: 71    
*)    echo "Error in queue name!!! " ; exit ;;

esac

  1. MOD should be 0 ########################

let AAA=`expr $3 % $procqueue`

  1. echo $AAA

if [ 0 -ne $AAA ] ; then echo "Error in number of processors" ; exit ; fi

  1. version

if [ -z $4 ] ; then

 if   [ $mar = 5 ] ; then vaspversion="5.4.4"
 elif [  $2 =  4 ] ; then vaspversion="5.3.5"
 elif [  $2 =  8 ] ; then vaspversion="5.3.5"
 elif [  $2 = 12 ] ; then if [ $3 -gt 12 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi
 elif [  $2 = 24 ] ; then if [ $3 -gt 24 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi

elif [ $2 = 28 ] ; then if [ $3 -gt 28 ] ; then vaspversion="5.3.5-IB" ; else vaspversion="5.4.4" ; fi

 elif [ $tk1 = 1 ] ; then vaspversion="4.6"    
 fi 

else vaspversion=$4 ; fi

  1. queues of tekla1 #######################

if [ $tk1 = 1 ] ; then mpi=_mpi ; E=`pwd`; ofile=`echo $E/o_\\$JOB_NAME.\\$JOB_ID` ; efile=`echo $E/e_\\$JOB_NAME.\\$JOB_ID` ; cat >run.sh<<!

  1. !/bin/bash
  1. $ -N $1
  1. pe request
  2. $ -pe $queue $3
  3. $ -M rseemakurthi@iciq.es
  4. $ -o $ofile
  5. $ -e $efile

cd $E ; /home/rseemakurthi/bin/savecalc /usr/bin/mpirun -np $3 -machinefile \$TMPDIR/machines /usr/local/bin/vasp ; rm -f CHG

! fi


  1. queues of tekla2 #######################

if [ $tk2 = 1 ] ; then mpi=_mpi ; cat >run.sh<<!

  1. !/bin/bash
      1. SGE Parameters #######################
  2. $ -S /bin/bash
  3. $ -N $1
  4. $ -cwd
  5. $ -masterq $queue.q
  6. $ -pe $queue$mpi $3
  7. $ -m ae
  8. $ -M rseemakurthi@iciq.es
  9. $ -o o_\$JOB_NAME.\$JOB_ID
  10. $ -e e_\$JOB_NAME.\$JOB_ID
      1. Load Environment Variables ###########

. /etc/profile.d/modules.sh module load vasp/$vaspversion

      1. Run Job ##############################

export OMP_NUM_THREADS=1 echo \$PWD >> o_\$JOB_NAME.\$JOB_ID echo \$TMP >> o_\$JOB_NAME.\$JOB_ID ~/bin/savecalc ; mpirun -np \$NSLOTS vasp_std ; # rm -f CHG ! fi

  1. queues of Marenostrum 5 ################

if [ $mar = 5 ] ; then cat >run.sh<<!

  1. !/bin/bash
  2. SBATCH --account=iciq72
  3. SBATCH --qos=$queue
  4. SBATCH --time=$maxhours:00:00
  5. SBATCH --job-name=$1
  6. SBATCH --cpus-per-task=1
  7. SBATCH --tasks-per-node=112
  8. SBATCH --ntasks=$3
  9. SBATCH --output=o_$1.%j
  10. SBATCH --error=e_$1.%j

module load hdf5 module load vasp/$vaspversion

  1. module load mkl

~/bin/savecalc ;srun /apps/GPP/VASP/$vaspversion/INTEL/IMPI/bin/vasp_std

! fi