Statistiques
| Révision :

root / examples / Vasp / Parallel / run_Path_SGE_home

Historique | Voir | Annoter | Télécharger (3,7 ko)

1
#!/bin/bash
2
#$ -S /bin/bash
3
#$ -N Vasp_PHome
4
#$ -cwd 
5
#$ -V
6
#$ -o Vasp_para.batch-log
7
#$ -j y
8
#$ -q dl165adf
9
#$ -pe mpi8 8
10

    
11
#set -x
12

    
13
echo "============================================================================================="
14
echo "=                                                                                           ="
15
echo "=                        Vasp Parallel with unique machine                                  ="
16
echo "=                                                                                           ="
17
echo "=                           `date`                                          ="
18
echo "=                                                                                           ="
19
echo "============================================================================================="
20

    
21
HOMEDIR=$SGE_O_WORKDIR
22

    
23
echo "No SCRATCHDIR"
24

    
25
#Iter is the index for storing files as POSCAR_runXX
26
Iter=1
27
echo $Iter > Path.iter
28

    
29

    
30
######################################
31
#
32
# you might have to change the following variables
33
#
34
######################################
35
#
36
# Name of the Path Input file
37
#
38
Job=Test_Vasp_Para
39
#
40
#
41
# Where is Path.exe ??
42
#
43
PathExe=~/Programs/optnpath/src/Path.exe
44
#
45
# Where is VASP ?
46
#
47
export VASPDIR=~/Programs/VASP
48
export VASPEXEC=VASP4635_R410_STD
49
#
50
# Whre is mpirun ?
51
#
52
export MPIDIR=/softs/openmpi-1.4.1-intel/
53
export MPIRUN=$MPIDIR/bin/mpirun
54
#
55
#
56
# Machine where the files are
57
#
58
RUNNINGMACHINE=r410comp1-pub
59

    
60
# Some libraries... 
61
#
62
#For intel 11.1.069
63
source /softs/intel/v11.1.069/bin/intel64/ifortvars_intel64.sh
64
export LD_LIBRARY_PATH=/softs/fftw/2.1.5/ps-gb/lib:$LD_LIBRARY_PATH:/usr/lib
65
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
export LANG=C
67
#
68
#Usually nothing has to be changed after this line
69
#
70
#################################################
71

    
72
#
73
# Machinefile
74
#
75
HOSTFILE=$TMPDIR/machines
76

    
77

    
78
#################################
79
#
80
#! we create the 00, 01... and 0x directorires
81
# First we get the number of images in the INCAR file:
82
NbIm=`grep -i IMAGES INCAR | awk -F"=" '{n=$2*1+1; print n}' `
83
#
84
#
85
#################################
86
#
87
# We go to the Work Directory
88
cd $HOMEDIR
89

    
90
# A small test to see if everything matches
91
NbImP=` sed 's/,/^M/g' ${Job}.path | grep -i ngeomf | awk -F"=" '{n=$2*1-1; print n}' `
92
if [ $NbImP -ne $NbIm ]; then
93
 echo "WARNING WARNING WARNING WARNING WARNING WARNING"
94
 echo "IMAGES in INCAR and NGeomF in " ${Job}.path
95
 echo "Do Not Match... problems might be expected..."
96
 echo "Check it !!!"
97
 echo "WARNING WARNING WARNING WARNING WARNING WARNING"
98
fi
99

    
100
if [ $NbIm -le 9 ]; then
101
 Pref="0"
102
else
103
 Pref=""
104
fi
105

    
106
#### We create the directories and copy files on Master
107
for n in `seq -w 0 $NbIm`
108
do
109
  ndir=$Pref$n
110
  mkdir -p ${HOMEDIR}/${ndir}
111
done
112

    
113

    
114
# ###########################
115
#
116
#  We create the 'VaspExe' file that Path will use to run the
117
# actual VASP calculations of E and forces
118
#
119
#############################
120
# We work in HOMEDIR. Nothing to copy to scratch 
121
cat << EOF > ./RunVasp
122
#!/bin/bash
123

    
124
#set -x
125
HOMEDIR=$HOMEDIR
126
SCRATCHDIR=$SCRATCHDIR
127
Pref=$Pref
128

    
129
cd $HOMEDIR
130
$MPIRUN -v -prefix $MPIDIR -mca pls_rsh_agent "ssh" -mca btl openib,self -np $NSLOTS ${VASPDIR}/${VASPEXEC} > \${HOMEDIR}/out
131

    
132
Iter=`cat \$HOMEDIR/Path.iter`
133
RUNNEW=run\${Iter}
134

    
135
for n in \`seq -w 0 $NbIm\`
136
do
137
  ndir=$Pref\$n
138
  for FILE in  OUTCAR POSCAR OSZICAR XDATCAR CONTCAR
139
  do
140
   cp \${HOMEDIR}/\$ndir/\$FILE \$HOMEDIR/\$ndir/\${FILE}_\${RUNNEW}
141
  done
142
done
143
cp \${HOMEDIR}/out  \$HOMEDIR/out_\${RUNNEW}
144

    
145

    
146
let Iter=Iter+1
147
echo \$Iter > \$HOMEDIR/Path.iter
148

    
149

    
150
EOF
151
chmod u+x ./RunVasp
152

    
153
###############################
154
#
155
# We launch PATH
156
#
157
###############################
158
ln -fs ${PathExe} .
159

    
160
./Path.exe ${Job}.path > ${Job}.out 2> ${Job}.err
161