Hello,
Sorry for double posting, as I have posted it on github too. But since I believe this is not a bug, I think this is the better place to discuss my problem.
I am submitting a code using qsub from python3 as( hereis the complete code):
scfc = ["qsub", "-Wblock=true", "script.sh"]
optstate = ["opt1", "opt2", "opt3"]
for sstate in optstate:
subprocess.call(scfc)
sdir = optstate.index(sstate)
print(sstate)
genincar2(sdir)
shutil.copy2("INCAR", "INCAR"+"."+str(sstate))
shutil.copy2("CONTAR", "CONTCAR"+"."+str(sstate))
and the script.sh is:
#!/bin/bash
#PBS -S /bin/bash
#PBS -N Test
#PBS -l select=2:ncpus=24:mpiprocs=24
#PBS -q workq
#PBS -joe
#PBS -V
export I_MPI_FABRICS=shm:tmi
export I_MPI_PROVIDER=psm2
export I_MPI_FALLBACK=0
export KMP_AFFINITY=verbose,scatter
module load intel/2018
module load vasp/5.4.4
cd $PBS_O_WORKDIR
cat $PBS_NODEFILE > pbs_nodes
echo Working directory is $PBS_O_WORKDIR
NPROCS=`wc -l < $PBS_NODEFILE`
NNODES=`uniq $PBS_NODEFILE | wc -l`
mpirun -np $NPROCS --machinefile $PBS_NODEFILE vasp_std
I am expecting with -Wblock=true
(and also, subprocess.call), the code to wait to finish the vasp_std
code before going to sdir = optstate.index(sstate)
line.
But this is not the case, and getting error as CONTCAR is not generated yet.
Can someone kindly help?