root / examples / Vasp / Parallel / run_Path_SGE_home
Historique | Voir | Annoter | Télécharger (3,7 ko)
| 1 | 1 | pfleura2 | #!/bin/bash |
|---|---|---|---|
| 2 | 1 | pfleura2 | #$ -S /bin/bash |
| 3 | 1 | pfleura2 | #$ -N Vasp_PHome |
| 4 | 1 | pfleura2 | #$ -cwd |
| 5 | 1 | pfleura2 | #$ -V |
| 6 | 1 | pfleura2 | #$ -o Vasp_para.batch-log |
| 7 | 1 | pfleura2 | #$ -j y |
| 8 | 1 | pfleura2 | #$ -q dl165adf |
| 9 | 1 | pfleura2 | #$ -pe mpi8 8 |
| 10 | 1 | pfleura2 | |
| 11 | 1 | pfleura2 | #set -x |
| 12 | 1 | pfleura2 | |
| 13 | 1 | pfleura2 | echo "=============================================================================================" |
| 14 | 1 | pfleura2 | echo "= =" |
| 15 | 1 | pfleura2 | echo "= Vasp Parallel with unique machine =" |
| 16 | 1 | pfleura2 | echo "= =" |
| 17 | 1 | pfleura2 | echo "= `date` =" |
| 18 | 1 | pfleura2 | echo "= =" |
| 19 | 1 | pfleura2 | echo "=============================================================================================" |
| 20 | 1 | pfleura2 | |
| 21 | 1 | pfleura2 | HOMEDIR=$SGE_O_WORKDIR |
| 22 | 1 | pfleura2 | |
| 23 | 1 | pfleura2 | echo "No SCRATCHDIR" |
| 24 | 1 | pfleura2 | |
| 25 | 1 | pfleura2 | #Iter is the index for storing files as POSCAR_runXX |
| 26 | 1 | pfleura2 | Iter=1 |
| 27 | 1 | pfleura2 | echo $Iter > Path.iter |
| 28 | 1 | pfleura2 | |
| 29 | 1 | pfleura2 | |
| 30 | 1 | pfleura2 | ###################################### |
| 31 | 1 | pfleura2 | # |
| 32 | 1 | pfleura2 | # you might have to change the following variables |
| 33 | 1 | pfleura2 | # |
| 34 | 1 | pfleura2 | ###################################### |
| 35 | 1 | pfleura2 | # |
| 36 | 1 | pfleura2 | # Name of the Path Input file |
| 37 | 1 | pfleura2 | # |
| 38 | 1 | pfleura2 | Job=Test_Vasp_Para |
| 39 | 1 | pfleura2 | # |
| 40 | 1 | pfleura2 | # |
| 41 | 1 | pfleura2 | # Where is Path.exe ?? |
| 42 | 1 | pfleura2 | # |
| 43 | 12 | pfleura2 | PathExe=~/Programs/optnpath/src/Path.exe |
| 44 | 1 | pfleura2 | # |
| 45 | 1 | pfleura2 | # Where is VASP ? |
| 46 | 1 | pfleura2 | # |
| 47 | 1 | pfleura2 | export VASPDIR=~/Programs/VASP |
| 48 | 1 | pfleura2 | export VASPEXEC=VASP4635_R410_STD |
| 49 | 1 | pfleura2 | # |
| 50 | 1 | pfleura2 | # Whre is mpirun ? |
| 51 | 1 | pfleura2 | # |
| 52 | 1 | pfleura2 | export MPIDIR=/softs/openmpi-1.4.1-intel/ |
| 53 | 1 | pfleura2 | export MPIRUN=$MPIDIR/bin/mpirun |
| 54 | 1 | pfleura2 | # |
| 55 | 1 | pfleura2 | # |
| 56 | 1 | pfleura2 | # Machine where the files are |
| 57 | 1 | pfleura2 | # |
| 58 | 1 | pfleura2 | RUNNINGMACHINE=r410comp1-pub |
| 59 | 1 | pfleura2 | |
| 60 | 1 | pfleura2 | # Some libraries... |
| 61 | 1 | pfleura2 | # |
| 62 | 1 | pfleura2 | #For intel 11.1.069 |
| 63 | 1 | pfleura2 | source /softs/intel/v11.1.069/bin/intel64/ifortvars_intel64.sh |
| 64 | 1 | pfleura2 | export LD_LIBRARY_PATH=/softs/fftw/2.1.5/ps-gb/lib:$LD_LIBRARY_PATH:/usr/lib |
| 65 | 1 | pfleura2 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/softs/intel/v11.1.069/mkl/lib/em64t/:$MPIDIR/lib/:/softs/intel/v11.1.069/lib/intel64 |
| 66 | 1 | pfleura2 | export LANG=C |
| 67 | 1 | pfleura2 | # |
| 68 | 1 | pfleura2 | #Usually nothing has to be changed after this line |
| 69 | 1 | pfleura2 | # |
| 70 | 1 | pfleura2 | ################################################# |
| 71 | 1 | pfleura2 | |
| 72 | 1 | pfleura2 | # |
| 73 | 1 | pfleura2 | # Machinefile |
| 74 | 1 | pfleura2 | # |
| 75 | 1 | pfleura2 | HOSTFILE=$TMPDIR/machines |
| 76 | 1 | pfleura2 | |
| 77 | 1 | pfleura2 | |
| 78 | 1 | pfleura2 | ################################# |
| 79 | 1 | pfleura2 | # |
| 80 | 1 | pfleura2 | #! we create the 00, 01... and 0x directorires |
| 81 | 1 | pfleura2 | # First we get the number of images in the INCAR file: |
| 82 | 1 | pfleura2 | NbIm=`grep -i IMAGES INCAR | awk -F"=" '{n=$2*1+1; print n}' `
|
| 83 | 1 | pfleura2 | # |
| 84 | 1 | pfleura2 | # |
| 85 | 1 | pfleura2 | ################################# |
| 86 | 1 | pfleura2 | # |
| 87 | 1 | pfleura2 | # We go to the Work Directory |
| 88 | 1 | pfleura2 | cd $HOMEDIR |
| 89 | 1 | pfleura2 | |
| 90 | 1 | pfleura2 | # A small test to see if everything matches |
| 91 | 1 | pfleura2 | NbImP=` sed 's/,/^M/g' ${Job}.path | grep -i ngeomf | awk -F"=" '{n=$2*1-1; print n}' `
|
| 92 | 1 | pfleura2 | if [ $NbImP -ne $NbIm ]; then |
| 93 | 1 | pfleura2 | echo "WARNING WARNING WARNING WARNING WARNING WARNING" |
| 94 | 1 | pfleura2 | echo "IMAGES in INCAR and NGeomF in " ${Job}.path
|
| 95 | 1 | pfleura2 | echo "Do Not Match... problems might be expected..." |
| 96 | 1 | pfleura2 | echo "Check it !!!" |
| 97 | 1 | pfleura2 | echo "WARNING WARNING WARNING WARNING WARNING WARNING" |
| 98 | 1 | pfleura2 | fi |
| 99 | 1 | pfleura2 | |
| 100 | 1 | pfleura2 | if [ $NbIm -le 9 ]; then |
| 101 | 1 | pfleura2 | Pref="0" |
| 102 | 1 | pfleura2 | else |
| 103 | 1 | pfleura2 | Pref="" |
| 104 | 1 | pfleura2 | fi |
| 105 | 1 | pfleura2 | |
| 106 | 1 | pfleura2 | #### We create the directories and copy files on Master |
| 107 | 1 | pfleura2 | for n in `seq -w 0 $NbIm` |
| 108 | 1 | pfleura2 | do |
| 109 | 1 | pfleura2 | ndir=$Pref$n |
| 110 | 1 | pfleura2 | mkdir -p ${HOMEDIR}/${ndir}
|
| 111 | 1 | pfleura2 | done |
| 112 | 1 | pfleura2 | |
| 113 | 1 | pfleura2 | |
| 114 | 1 | pfleura2 | # ########################### |
| 115 | 1 | pfleura2 | # |
| 116 | 1 | pfleura2 | # We create the 'VaspExe' file that Path will use to run the |
| 117 | 1 | pfleura2 | # actual VASP calculations of E and forces |
| 118 | 1 | pfleura2 | # |
| 119 | 1 | pfleura2 | ############################# |
| 120 | 1 | pfleura2 | # We work in HOMEDIR. Nothing to copy to scratch |
| 121 | 1 | pfleura2 | cat << EOF > ./RunVasp |
| 122 | 1 | pfleura2 | #!/bin/bash |
| 123 | 1 | pfleura2 | |
| 124 | 1 | pfleura2 | #set -x |
| 125 | 1 | pfleura2 | HOMEDIR=$HOMEDIR |
| 126 | 1 | pfleura2 | SCRATCHDIR=$SCRATCHDIR |
| 127 | 1 | pfleura2 | Pref=$Pref |
| 128 | 1 | pfleura2 | |
| 129 | 1 | pfleura2 | cd $HOMEDIR |
| 130 | 1 | pfleura2 | $MPIRUN -v -prefix $MPIDIR -mca pls_rsh_agent "ssh" -mca btl openib,self -np $NSLOTS ${VASPDIR}/${VASPEXEC} > \${HOMEDIR}/out
|
| 131 | 1 | pfleura2 | |
| 132 | 1 | pfleura2 | Iter=`cat \$HOMEDIR/Path.iter` |
| 133 | 1 | pfleura2 | RUNNEW=run\${Iter}
|
| 134 | 1 | pfleura2 | |
| 135 | 1 | pfleura2 | for n in \`seq -w 0 $NbIm\` |
| 136 | 1 | pfleura2 | do |
| 137 | 1 | pfleura2 | ndir=$Pref\$n |
| 138 | 1 | pfleura2 | for FILE in OUTCAR POSCAR OSZICAR XDATCAR CONTCAR |
| 139 | 1 | pfleura2 | do |
| 140 | 1 | pfleura2 | cp \${HOMEDIR}/\$ndir/\$FILE \$HOMEDIR/\$ndir/\${FILE}_\${RUNNEW}
|
| 141 | 1 | pfleura2 | done |
| 142 | 1 | pfleura2 | done |
| 143 | 1 | pfleura2 | cp \${HOMEDIR}/out \$HOMEDIR/out_\${RUNNEW}
|
| 144 | 1 | pfleura2 | |
| 145 | 1 | pfleura2 | |
| 146 | 1 | pfleura2 | let Iter=Iter+1 |
| 147 | 1 | pfleura2 | echo \$Iter > \$HOMEDIR/Path.iter |
| 148 | 1 | pfleura2 | |
| 149 | 1 | pfleura2 | |
| 150 | 1 | pfleura2 | EOF |
| 151 | 1 | pfleura2 | chmod u+x ./RunVasp |
| 152 | 1 | pfleura2 | |
| 153 | 1 | pfleura2 | ############################### |
| 154 | 1 | pfleura2 | # |
| 155 | 1 | pfleura2 | # We launch PATH |
| 156 | 1 | pfleura2 | # |
| 157 | 1 | pfleura2 | ############################### |
| 158 | 1 | pfleura2 | ln -fs ${PathExe} .
|
| 159 | 1 | pfleura2 | |
| 160 | 1 | pfleura2 | ./Path.exe ${Job}.path > ${Job}.out 2> ${Job}.err
|