def analysis_step(self, iteration, instance): ''' function : Perform CoCo Analysis on the output of the simulation from the current iteration. Using the .ncdf files generated in all the instance, generate the .crd file to be used in the next simulation. coco :- Purpose : Runs CoCo analysis on a set of .ncdf files and generates a coordinate file. Arguments : --grid = Number of points along each dimension of the CoCo histogram --dims = The number of projections to consider from the input pcz file --frontpoints = Number of CUs --topfile = Topology filename --mdfile = MD Input filename --output = Output filename --cycle = Current iteration number ''' k1 = Kernel(name="md.coco") k1.arguments = ["--grid={0}".format(Kconfig.grid), "--dims={0}".format(Kconfig.dims), "--frontpoints={0}".format(Kconfig.num_CUs), "--topfile={0}".format(os.path.basename(Kconfig.top_file)), "--mdfile=*.ncdf", "--output=pentaopt%s"%(iteration)] k1.cores = RPconfig.PILOTSIZE k1.copy_input_data = ['$PRE_LOOP/{0}'.format(os.path.basename(Kconfig.top_file)),'$PRE_LOOP/pycoco.py > pycoco.py'] for iter in range(1,iteration+1): for i in range(1,Kconfig.num_CUs+1): k1.copy_input_data = k1.copy_input_data + ['$SIMULATION_ITERATION_{0}_INSTANCE_{1}/md{0}.ncdf > md_{0}_{1}.ncdf'.format(iter,i)] temp=list() for i in range(0,Kconfig.num_CUs): temp = temp + ['pentaopt{0}{1}.pdb > $PRE_LOOP/iter{0}/pentaopt{0}{1}.pdb'.format(iteration,i)] k1.copy_output_data = temp k2 = Kernel(name="md.tleap") k2.arguments = ["--numofsims={0}".format(Kconfig.num_CUs), "--cycle={0}".format(iteration)] temp=list() for i in range(0,Kconfig.num_CUs): temp = temp + ['$PRE_LOOP/iter{0}/pentaopt{0}{1}.pdb > pentaopt{0}{1}.pdb'.format(iteration,i)] k2.link_input_data=temp + ['$PRE_LOOP/postexec.py'] temp=list() for i in range(0,Kconfig.num_CUs): temp = temp + ['min{0}{1}.crd > $PRE_LOOP/iter{2}/min{0}{1}.crd'.format(iteration,i,iteration+1)] k2.copy_output_data = temp return [k1,k2]
def step_2(self, instances): k = Kernel(name="misc.cat") k.upload_input_data = ['./output_file_2.txt > file2.txt'] k.copy_input_data = ['$STEP_1/temp.txt > file1.txt'] k.arguments = ["--file1=file1.txt", "--file2=file2.txt"] k.download_output_data = ['./file1.txt > output_file.txt'] return k
def stage_2(self, instances): k = Kernel(name="misc.cat") k.upload_input_data = ['./output_file_2.txt > file2.txt'] k.copy_input_data = ['$STAGE_1/temp.txt > file1.txt'] k.arguments = ["--file1=file1.txt","--file2=file2.txt"] k.download_output_data = ['./file1.txt > output_file.txt'] return k
def stage_2(self, instance): k = Kernel(name="misc.ccount") k.arguments = [ "--inputfile=asciifile-{0}.dat".format(instance), "--outputfile=cfreqs-{0}.dat".format(instance) ] k.copy_input_data = "$STAGE_1/asciifile-{0}.dat".format(instance) k.download_output_data = "cfreqs-{0}.dat".format(instance) return k
def step_1(self, instance): k = Kernel(name="misc.chksum") k.arguments = [ "--inputfile={0}".format(self._checksum_inputfile), "--outputfile={0}".format(self._download_output) ] k.copy_input_data = self._copy_directives k.download_output_data = self._download_output return k
def pre_loop(self): ''' function : transfers input files and intermediate executables pre_grlsd_loop :- Purpose : Transfers files, Split the input file into smaller files to be used by each of the gromacs instances in the first iteration. Arguments : --inputfile = file to be split --numCUs = number of simulation instances/ number of smaller files ''' k = Kernel(name="custom.pre_grlsd_loop") k.copy_input_data = ['$SHARED/spliter.py','$SHARED/gro.py','$SHARED/{0}'.format(os.path.basename(Kconfig.md_input_file))] k.arguments = ["--inputfile={0}".format(os.path.basename(Kconfig.md_input_file))] return k
def stage_1(self, instance): global INPUT_PAR global ENSEMBLE_SIZE # "simulation" tasks if instance <= ENSEMBLE_SIZE: k1 = Kernel(name="sleep") k1.arguments = ["--file=output.txt", "--text=simulation", "--duration={0}".format(INPUT_PAR_Q[instance - 1])] k1.cores = 1 # File staging can be added using the following # k1.upload_input_data = [] # k1.copy_input_data = [] # k1.link_input_data = [] # k1.copy_output_data = [] # k1.download_output_data = [] return k1 # "analysis" task else: # Emulating some more analysis executin time sleep(10) # Analysis kernel produces a random integer (<20) to push into INPUT_PAR_Q m1 = Kernel(name="randval") m1.arguments = ["--upperlimit=20"] m1.copy_input_data = [] # Copy simulation output data for inst in range(1, ENSEMBLE_SIZE + 1): m1.copy_input_data += [ '$ITER_{0}_STAGE_1_TASK_{1}/output.txt'.format( ITER[instance - 1], inst)] return m1
def pre_loop(self): ''' function : transfers input files and intermediate executables pre_grlsd_loop :- Purpose : Transfers files, Split the input file into smaller files to be used by each of the gromacs instances in the first iteration. Arguments : --inputfile = file to be split --numCUs = number of simulation instances/ number of smaller files ''' k = Kernel(name="custom.pre_grlsd_loop") k.copy_input_data = [ '$SHARED/spliter.py', '$SHARED/gro.py', '$SHARED/{0}'.format(os.path.basename(Kconfig.md_input_file)) ] k.arguments = [ "--inputfile={0}".format(os.path.basename(Kconfig.md_input_file)) ] return k
def step_1(self, instance): k = Kernel(name="misc.chksum") k.arguments = ["--inputfile={0}".format(self._checksum_inputfile), "--outputfile={0}".format(self._download_output)] k.copy_input_data = self._copy_directives k.download_output_data = self._download_output return k
def stage_2(self, instance): k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=asciifile-{0}.dat".format(instance), "--outputfile=cfreqs-{0}.dat".format(instance)] k.copy_input_data = "$STAGE_1/asciifile-{0}.dat".format(instance) k.download_output_data = "cfreqs-{0}.dat".format(instance) return k
def step_1(self, instance): k = Kernel(name="misc.chksum") k.arguments = ["--inputfile=input.txt", "--outputfile=checksum.txt"] k.copy_input_data = ["/etc/passwd > input.txt"] k.copy_output_data = self._output_copy_directives return k