#!/usr/bin/env python #this script set up and runs several molecular dynamics trajectories #this script must be called in the directory containing the n traj folders named as 000n #a properly formatted Job file is required in the same foulder of the script ################################################# from os import path, getcwd # from os import chdir, system, mkdir # from time import sleep # from shutil import copy # ################################################# # Define calculation parameters ################# # this value will be used in the Job file ####### # #JobName ='D1elbow' # Just a general lable: "JobName_NumTraj" TimeLimit ='8' # in hours: "TimeLimit:00:00" Ntraj =20000 # Njobtraj =1000 # # ################################################# Njobs = int(Ntraj/Njobtraj) here=getcwd() #workdir for i in range(Njobs): Nfirst = '%.6d' % (i*Njobtraj + 1) Nlast = '%.6d' % ( float(Nfirst) + Njobtraj - 1 ) modify = 'sed -e \"s|_FIRSTJOB_|%s|g\" Job_mob_ > Job' % Nfirst # modify the Jobfile system(modify) # modify = 'sed -i \"s|_TIMELIMIT_|%s|g\" Job' % TimeLimit # system(modify) modify = 'sed -i \"s|_LASTJOB_|%s|g\" Job' % Nlast system(modify) system('qsub Job') # RUN JOB ####################################### sleep(1)