#!/bin/bash #PBS -l walltime=48:00:00 #PBS -S /bin/bash #PBS -l nodes=1:ppn=28 #PBS -N 0500-RPMD-surface module load i-PI/2.3.0-intel-2020a-Python-3.8.3 # workdirectory WORKDIR=$PBS_O_WORKDIR cd ${WORKDIR} # scratch directory SCRATCH=${VSC_SCRATCH_NODE}/${PBS_JOBID} mkdir -p ${SCRATCH} cd ${SCRATCH} # copy files from the workdir to the scratch scp -r ${WORKDIR}/* ${SCRATCH}/. scp -r ${WORKDIR}/../../RuNNer ${SCRATCH}/. # lammps location #lammps=${VSC_DATA}/Programs/lammps-29Oct20/src/lmp_mpi lammps=${VSC_DATA}/Programs/lammps-29Oct20/src/lmp_serial # A few times this error has popped up; simple fix if compgen -G "/tmp/ipi_*" > /dev/null; then rm /tmp/ipi_* fi sed -e "s|_SEED_|${RANDOM}|g" input.xml_ > input.xml # start i-PI i-pi input.xml & # The sleep is necessary, otherwise LAMMPS won't be able to connect and will crash since i-PI hasn't started up yet sleep 10 # Start multiple instances of LAMMPS #${lammps} -in sim.lmp & for idx in `seq 24`; do #mpirun -np 7 ${lammps} -in sim.lmp & ${lammps} -in sim.lmp & done wait for i in $(seq -w 00 23); do tail -n52000 simulation.pos_bead_${i}.xyz > tmp mv tmp simulation.pos_bead_${i}.xyz tail -n52000 simulation.vel_bead_${i}.xyz > tmp mv tmp simulation.vel_bead_${i}.xyz done tail -n52000 simulation.pos_centroid.xyz > tmp mv tmp simulation.pos_centroid.xyz tail -n52000 simulation.vel_centroid.xyz > tmp mv tmp simulation.vel_centroid.xyz rm RESTART log.lammps rm -r RuNNer # copy files back scp -r ${SCRATCH}/* ${WORKDIR}/. # clean up rm -r ${SCRATCH} # ready