Statistiques
| Révision :

root / examples / Vasp / Parallel / run_Path_PBS @ 12

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

1
#PBS -S /bin/sh
2
#PBS -N VaspPara
3
#PBS -l nodes=8:Other
4
#PBS -q Para8
5
#PBS -o Test_Vasp_Para.batch-log
6
#PBS -j oe
7
#PBS -M Paul.Fleurat-Lessard@ens-lyon.fr
8
#PBS -m aeb
9

    
10
#!/bin/bash
11

    
12
home_dir=$PBS_O_WORKDIR
13
work_dir=$PBS_O_WORKDIR
14
numb=3x3_run1
15

    
16
######################################
17
#
18
# you might have to change the following variables
19
#
20
######################################
21
#
22
# Name of the Path Input file
23
#
24
Job=Test_Vasp_Para
25
#
26
#
27
# Where is Path.exe ??
28
#
29
PathExe=~/Programs/optnpath/src/Path.exe
30
#
31
# Where is VASP ?
32
#
33
export VASP=/home/dloffred/VASP_SOURCES/Intel_P4/VASP46_CINEB
34
#
35
# Whre is mpirun ?
36
#
37
export MPIRUN=/usr/local/mpich-intel-090404/bin/mpirun
38
#
39
# Some libraries... 
40
#
41
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/fc/9.1.037/lib/:/opt/intel/cc/9.1.045/lib:/usr/lib:/opt/intel/mkl/8.1/lib/32
42
export PATH=/opt/intel/fc/9.1.037/bin/:/opt/intel/cc/9.1.045/bin/:$PATH:$HOME/bin:/usr/local/mpich-intel9/bin
43
export LD_RUN_PATH=$LD_RUN_PATH:/opt/intel/fc/9.1.037/lib/:/opt/intel/cc/9.1.045/lib
44
export MANPATH=$MANPATH:/opt/intel/fc/9.1.037/man/:/opt/intel/cc/9.1.045/man
45
export LANG=C
46
#
47
#Usually nothing has to be changed after this line
48
#
49
#################################################
50

    
51

    
52

    
53

    
54
#################################
55
#
56
# We create the machinefile
57
#
58
# even if it is not really needed for SERIAL calculations
59
#
60
#################################
61
nodes=`cat $PBS_NODEFILE`
62
nnodes=`wc $PBS_NODEFILE | awk '{print $1}'` 
63

    
64
confile=$home_dir/ip.$PBS_JOBID.conf
65
touch $confile
66
j="init"
67
for i in $nodes
68
do
69
if [ $j != $i ]
70
then echo "$i:1" >> $confile
71
else
72
	echo "vous calculez sur des noeuds smp"
73
fi
74
j=$i
75
done
76

    
77
###############################
78
#
79
# We go to the Work Directory
80
#
81
###############################
82

    
83
cd $work_dir
84

    
85
#! we create the 00, 01... and 0x directorires
86
# First we get the number of images in the INCAR file:
87
NbIm=`grep -i IMAGES INCAR | awk -F"=" '{n=$2*1+1; print n}' `
88
n=0
89
while [ $n -le $NbIm ]
90
do
91
ndir=`echo $n | awk '{k="00" $1; l=length(k); l=l-1; print substr(k,l,2)}'`
92
mkdir -p $ndir
93
let n=n+1
94
done
95

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

    
106
#############################
107
#
108
#  We create the 'VaspExe' file that Path will use to run the
109
# actual VASP calculations of E and forces
110
#
111
#############################
112
echo "$MPIRUN -nolocal -machinefile $confile -np $nnodes $VASP > out_$numb" >  ./RunVasp
113
chmod u+x ./RunVasp
114

    
115
###############################
116
#
117
# We launch PATH
118
#
119
###############################
120
ln -fs ${PathExe} .
121

    
122
#############################
123
#
124
#  We create the 'VaspExe' file that Path will use to run the
125
# actual VASP calculations of E and forces
126
#
127
#############################
128

    
129
echo "$MPIRUN -nolocal -machinefile $confile -np $nnodes $VASP > out_$numb" >  ./RunVasp
130
chmod u+x ./RunVasp
131

    
132
###############################
133
#
134
# We launch PATH
135
#
136
###############################
137
ln -fs ${PathExe} .
138

    
139
./Path.exe ${Job}.path &> ${Job}.out
140