Révision f43a1b4c modules/launch_cp2k_molecule_seule.sh
b/modules/launch_cp2k_molecule_seule.sh | ||
---|---|---|
16 | 16 |
sed "/PROJECT_NAME/c\PROJECT_NAME ${molecule}" ${CP2K_input_molecule} > ${Molecule_results_path}/${molecule}/${molecule}_1/${molecule}.inp |
17 | 17 |
sed "s/XXXX/${molecule}/g" ${CP2K_sub} > ${Molecule_results_path}/${molecule}/${molecule}_1/cp2k_gamma.j |
18 | 18 |
cp ${Molecule_results_path}/${molecule}_confs/xyz_files/${molecule}_1.xyz ${Molecule_results_path}/${molecule}/${molecule}_1/coord.xyz |
19 |
qsub cp2k_gamma.j |
|
19 |
new_job_id=$(qsub cp2k_gamma.j | awk '{print $3}') |
|
20 |
echo "Submitted job $new_job_id" |
|
21 |
jobs_owned+=($new_job_id) |
|
20 | 22 |
|
21 | 23 |
for ((i=2; i<=n; i++)) ; do |
22 | 24 |
mkdir ${Molecule_results_path}/${molecule}/${molecule}_$i |
... | ... | |
24 | 26 |
ln ${Molecule_results_path}/${molecule}/${molecule}_1/cp2k_gamma.j . |
25 | 27 |
ln ${Molecule_results_path}/${molecule}/${molecule}_1/${molecule}.inp . |
26 | 28 |
cp ${Molecule_results_path}/${molecule}_confs/xyz_files/${molecule}_${i}.xyz coord.xyz |
27 |
qsub cp2k_gamma.j |
|
29 |
new_job_id=$(qsub cp2k_gamma.j | awk '{print $3}') |
|
30 |
echo "Submitted job $new_job_id" |
|
31 |
jobs_owned+=($new_job_id) |
|
28 | 32 |
done |
29 | 33 |
|
30 |
|
|
31 |
|
|
34 |
### Attente jusqu'à ce que tous les calculs aient fini |
|
35 |
go_on=true |
|
36 |
while [ $go_on == true ]; do |
|
37 |
all_jobs=`qstat | tail -n+3 | awk '{print $1}'` |
|
38 |
for j1 in ${jobs_owned[@]} ; do |
|
39 |
for j2 in ${all_jobs[@]}; do |
|
40 |
if [ $j1 == $j2 ]; then |
|
41 |
sleep 30 |
|
42 |
continue 3 |
|
43 |
fi |
|
44 |
done |
|
45 |
done |
|
46 |
echo "loop finished" |
|
47 |
go_on=false |
|
48 |
done |
Formats disponibles : Unified diff