def prepare_replica_for_md(self, replica): """Specifies input and output files and passes them to kernel Arguments: replica - object representing a given replica and it's associated parameters """ input_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".md" output_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".out" k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=" + \ input_name + " " + \ self.sh_file, "--outputfile=" + \ output_name] # no need to specify shared data here # everything in shared_files list will be staged in k.upload_input_data = [input_name] k.download_output_data = output_name replica.cycle = replica.cycle + 1 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="md.pre_grlsd_loop") k.upload_input_data = [ Kconfig.md_input_file, Kconfig.lsdm_config_file, Kconfig.top_file, Kconfig.mdp_file, "{0}/spliter.py".format(Kconfig.misc_loc), "{0}/gro.py".format(Kconfig.misc_loc), "{0}/run.py".format(Kconfig.misc_loc), "{0}/pre_analyze.py".format(Kconfig.misc_loc), "{0}/post_analyze.py".format(Kconfig.misc_loc), "{0}/select.py".format(Kconfig.misc_loc), "{0}/reweighting.py".format(Kconfig.misc_loc), ] k.download_input_data = [ "http://sourceforge.net/p/lsdmap/git/ci/extasy-0.1-rc2/tree/lsdmap/lsdm.py?format=raw > lsdm.py" ] k.arguments = [ "--inputfile={0}".format(os.path.basename(Kconfig.md_input_file)), "--numCUs={0}".format(Kconfig.num_CUs), ] return k
def prepare_replica_for_exchange(self, replica): """Prepares md.re_exchange kernel to launch namd_matrix_calculator.py script on target resource in order to populate columns of swap matrix. Arguments: replica - object representing a given replica and it's attributes Returns: k - an instance of Kernel class """ basename = self.inp_basename[:-5] matrix_col = "matrix_column_{cycle}_{replica}.dat"\ .format(cycle=replica.cycle-1, replica=replica.id ) k = Kernel(name="md.re_exchange") k.arguments = ["--calculator=namd_matrix_calculator.py", "--replica_id=" + str(replica.id), "--replica_cycle=" + str(replica.cycle-1), "--replicas=" + str(self.replicas), "--replica_basename=" + str(basename)] k.upload_input_data = "namd_matrix_calculator.py" k.download_output_data = matrix_col 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="md.pre_grlsd_loop") k.upload_input_data = [ Kconfig.md_input_file, Kconfig.lsdm_config_file, Kconfig.top_file, Kconfig.mdp_file, '{0}/spliter.py'.format(Kconfig.misc_loc), '{0}/gro.py'.format(Kconfig.misc_loc), '{0}/run.py'.format(Kconfig.misc_loc), '{0}/pre_analyze.py'.format(Kconfig.misc_loc), '{0}/post_analyze.py'.format(Kconfig.misc_loc), '{0}/selection.py'.format(Kconfig.misc_loc), '{0}/reweighting.py'.format(Kconfig.misc_loc) ] k.arguments = [ "--inputfile={0}".format(os.path.basename(Kconfig.md_input_file)), "--numCUs={0}".format(Kconfig.num_CUs) ] return k
def element_comparison(self, elements1, elements2): """In the comparison, we take the previously generated modified trajectory and perform a Hausdorff distance calculation between all the unique pairs of trajectories """ input_filenames1 = ["traj_flat%d.npz.npy" % (el1) for el1 in elements1] input_filenames2 = ["traj_flat%d.npz.npy" % (el2) for el2 in elements2] output_filename = "comparison-%03d-%03d.dat" % (elements1[0], elements2[0]) print "Element Comparison {0} - {1}".format(elements1, elements2) k = Kernel(name="my.hausdorff") k.arguments = [ "--dist_file=hausdorff_kernel.py", "--inputfile1={0}".format(input_filenames1), "--inputfile2={0}".format(input_filenames2), "--outputfile={0}".format(output_filename) ] k.upload_input_data = ["hausdorff_kernel.py"] # If the input data are in in a web server use the following # k.download_input_data = ["/<PATH>/<TO>/<WEB>?<SERVER>/<WITH>/hausdorff_kernel.py > hausdorff_kernel.py"] # If the input data are in a folder to the target machine use the following # k.link_input_data = ["/<PATH>/<TO>/<FOLDER>/<WITH>/hausdorff_kernel.py > hausdorff_kernel.py"] # The result files comparison-x-y.dat are downloaded. k.download_output_data = output_filename print "Element Comparison Finished {0} - {1}".format( elements1, elements2) return k
def step_1(self, instance): k1 = Kernel(name="md.amber") k1.arguments = ["--mininfile={0}".format(os.path.basename(Kconfig.minimization_input_file)), #"--mdinfile={0}".format(os.path.basename(Kconfig.md_input_file)), "--topfile={0}".format(os.path.basename(Kconfig.top_file)), "--crdfile={0}".format(os.path.basename(Kconfig.initial_crd_file)), "--cycle=%s"%(1)] k1.upload_input_data = [Kconfig.minimization_input_file, Kconfig.top_file, Kconfig.initial_crd_file] k1.cores=1 k1.upload_input_data = k1.upload_input_data + ['{0} > min1.crd'.format(Kconfig.initial_crd_file)] #k1.copy_output_data =['md{0}.crd > $PRE_LOOP/md_{0}_{1}.crd'.format(1,instance)] return k1
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="md.pre_grlsd_loop") k.upload_input_data = [Kconfig.md_input_file, Kconfig.lsdm_config_file, Kconfig.top_file, Kconfig.mdp_file, '{0}/spliter.py'.format(Kconfig.misc_loc), '{0}/gro.py'.format(Kconfig.misc_loc), '{0}/run.py'.format(Kconfig.misc_loc), '{0}/pre_analyze.py'.format(Kconfig.misc_loc), '{0}/post_analyze.py'.format(Kconfig.misc_loc), '{0}/selection.py'.format(Kconfig.misc_loc), '{0}/reweighting.py'.format(Kconfig.misc_loc)] k.arguments = ["--inputfile={0}".format(os.path.basename(Kconfig.md_input_file)),"--numCUs={0}".format(Kconfig.num_CUs)] return k
def prepare_replica_for_exchange(self, replica): """Prepares md.re_exchange kernel to launch namd_matrix_calculator.py script on target resource in order to populate columns of swap matrix. Arguments: replica - object representing a given replica and it's attributes Returns: k - an instance of Kernel class """ basename = self.inp_basename[:-5] matrix_col = "matrix_column_{cycle}_{replica}.dat"\ .format(cycle=replica.cycle-1, replica=replica.id ) k = Kernel(name="md.re_exchange") k.arguments = [ "--calculator=namd_matrix_calculator.py", "--replica_id=" + str(replica.id), "--replica_cycle=" + str(replica.cycle - 1), "--replicas=" + str(self.replicas), "--replica_basename=" + str(basename) ] k.upload_input_data = "namd_matrix_calculator.py" k.download_output_data = matrix_col return k
def element_comparison(self, elements1, elements2): """In the comparison, we take the previously generated modified trajectory and perform a Hausdorff distance calculation between all the unique pairs of trajectories """ input_filenames1 = ["traj_flat%d.npz.npy"%(el1) for el1 in elements1] input_filenames2 = ["traj_flat%d.npz.npy"%(el2) for el2 in elements2] output_filename = "comparison-%03d-%03d.dat"%(elements1[0],elements2[0]) print "Element Comparison {0} - {1}".format(elements1,elements2) k = Kernel(name="my.hausdorff") k.arguments = ["--dist_file=hausdorff_kernel.py", "--inputfile1={0}".format(input_filenames1), "--inputfile2={0}".format(input_filenames2), "--outputfile={0}".format(output_filename)] k.upload_input_data = ["hausdorff_kernel.py"] # If the input data are in in a web server use the following # k.download_input_data = ["/<PATH>/<TO>/<WEB>?<SERVER>/<WITH>/hausdorff_kernel.py > hausdorff_kernel.py"] # If the input data are in a folder to the target machine use the following # k.link_input_data = ["/<PATH>/<TO>/<FOLDER>/<WITH>/hausdorff_kernel.py > hausdorff_kernel.py"] # The result files comparison-x-y.dat are downloaded. k.download_output_data = output_filename print "Element Comparison Finished {0} - {1}".format(elements1,elements2) return k
def pre_loop(self): ''' function : transfers input files, intermediate executables pre_coam_loop :- Purpose : Transfers files that will be used for this workflow in the remote machine. This is a kernel that can be used from all workflows for transfering data files. Arguments : None ''' k = Kernel(name="md.pre_coam_loop") k.upload_input_data = [Kconfig.initial_crd_file, Kconfig.md_input_file, Kconfig.top_file, Kconfig.itp_file, Kconfig.restr_file, Kconfig.eminrestr_md, Kconfig.eeqrestr_md, '{0}/postprocessing.py'.format(Kconfig.misc_loc)] outbase, ext = os.path.basename(Kconfig.output).split('.') 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 step_1(self, instance): k = Kernel(name="misc.hello") k.upload_input_data = ['./input_file.txt > temp.txt'] k.arguments = ["--file=temp.txt"] k.download_output_data = [ './temp.txt > /var/lib/jenkins/workspace/EnsembleMDTesting/temp_results/remote_file.txt' ] return k
def stage_1(self, instance): k1 = Kernel(name="md.gromacs") k1.upload_input_data = ['in.gro', 'in.top', '*.itp', 'in.mdp'] k1.executable = ['path/to/gromacs/gmx'] k1.arguments = ['grompp', '-f', 'in.mdp', '-c', 'in.gro', '-o', 'in.tpr', '-p', 'in.top'] k1.cores = 1 return k1
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_1(self, instances): """This step sleeps for 60 seconds.""" k = Kernel(name="spark") k.upload_input_data = ['leafletfinder.py','traj_positions.npy'] k.arguments = ["--exec-mem=60g","--driver-mem=30g", "--max-result-size=25g","--spark-script=leafletfinder.py","--input-file=traj_positions.npy","--partitions=378"] return k
def step_1(self, instance): k = Kernel(name="misc.hello") k.upload_input_data = ['./input_file.txt > temp.txt'] k.arguments = ["--file=temp.txt"] k.download_output_data = [ './temp.txt > output_file_{0}.txt'.format(instance) ] return k
def pre_loop(self): """pre_loop is executed before the main simulation-analysis loop is started. In this example we create an initial 1 kB random ASCII file that we use as the reference for all analysis stages. """ k = Kernel(name="misc.mkfile") k.arguments = ["--size=1000", "--filename=reference.dat"] k.upload_input_data = ['levenshtein.py'] 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.upload_input_data = self._upload_directives k.download_output_data = self._download_output return k
def pre_loop(self): """pre_loop is executed before the main simulation-analysis loop is started. In this example we create an initial 1 kB random ASCII file that we use as the reference for all analysis steps. """ k = Kernel(name="misc.mkfile") k.arguments = ["--size=1000", "--filename=reference.dat"] k.upload_input_data = ['levenshtein.py'] return k
def stage_1(self, instance): k = Kernel(name="qbird") k.upload_input_data = ['SeaIceUnSuperGMM.py'] k.arguments = ["--script=SeaIceUnSuperGMM.py", "--imagepath=/home/vivek91/xsede-hack/IMG/XinImages/TEST/072610_00332.jpg", "--trainingpath=/home/vivek91/xsede-hack/IMG/XinImages/TRAINING/", "--num_train=3", "--icetypes=4"] k.download_output_data = ["labelledImage3trainingImages.png > image_{0}.png".format(instance)] return k
def step_1(self, instance): """This step downloads a sample UTF-8 file from a remote websever and calculates the SHA1 checksum of that file. The checksum is written to an output file and tranferred back to the host running this script. """ k = Kernel(name="misc.chksum") k.arguments = ["--inputfile=UTF-8-demo.txt", "--outputfile=checksum{0}.sha1".format(instance)] k.upload_input_data = "UTF-8-demo.txt" k.download_output_data = "checksum{0}.sha1".format(instance) return k
def step_1(self, instance): """Run AMBER MD Simulations""" k = Kernel(name="amber") k.arguments = [ "--minfile=min.in", "--topfile=penta.top", "--crdfile=penta.crd", "--output=md.crd"] k.upload_input_data = ['amber_input/min.in','amber_input/penta.top','amber_input/penta.crd'] k.download_output_data = ['md.crd > amber_output/md_{0}.crd'.format(instance)] return k
def stage_1(self, instance): k1 = Kernel(name="md.gromacs") k1.upload_input_data = ['in.gro', 'in.top', '*.itp', 'in.mdp'] k1.executable = ['path/to/gromacs/gmx'] k1.arguments = [ 'grompp', '-f', 'in.mdp', '-c', 'in.gro', '-o', 'in.tpr', '-p', 'in.top' ] k1.cores = 1 return k1
def analysis_stage(self,iteration,instance): k=Kernel(name="conn_comp") k.arguments =['--trajectory-count={0}'.format(str(traj_count)),'--python-script=find_connencted_components.py', '--window-size={0}'.format(str(window_size))] k.upload_input_data=['find_connencted_components.py'] k.link_input_data=[] for elem in window_list: inputFile = 'distances_{0}_{1}.npz.npy'.format(str(elem[0]),str(elem[1])) k.link_input_data.append('$SHARED/{0} > {0}'.format(inputFile)) return k
def stage_1(self, instance): k = Kernel(name="qbird") k.upload_input_data = ['SeaIceUnSuperGMM.py'] k.arguments = [ "--script=SeaIceUnSuperGMM.py", "--imagepath=/home/vivek91/xsede-hack/IMG/XinImages/TEST/072610_00332.jpg", "--trainingpath=/home/vivek91/xsede-hack/IMG/XinImages/TRAINING/", "--num_train=3", "--icetypes=4" ] k.download_output_data = [ "labelledImage3trainingImages.png > image_{0}.png".format(instance) ] return k
def simulation_stage(self,iteration,instance): k= Kernel(name="atom_dist") #do this with instance param k.arguments=['--python-script=atom_distances.py','--traj-count={0}'.format(str(traj_count)), '--window-size={0}'.format(str(window_size)),'--cutoff=15', '--row={0}'.format(str(window_list[instance-1][0]+1)), '--column={0}'.format(str(window_list[instance-1][1]+1))] k.link_input_data=['$SHARED/input.txt > input.txt'] k.upload_input_data=['atom_distances.py'] outputFile = 'distances_{0}_{1}.npz.npy'.format(str(window_list[instance-1][0]),str(window_list[instance-1][1])) k.copy_output_data=['{0} > $SHARED/{0}'.format(outputFile)] return k
def step_1(self, instance): """This step downloads a sample UTF-8 file from a remote websever and calculates the SHA1 checksum of that file. The checksum is written to an output file and tranferred back to the host running this script. """ k = Kernel(name="misc.chksum") k.arguments = [ "--inputfile=UTF-8-demo.txt", "--outputfile=checksum{0}.sha1".format(instance) ] k.upload_input_data = "UTF-8-demo.txt" k.download_output_data = "checksum{0}.sha1".format(instance) return k
def step_2(self, instance): """The second step of the pipeline does a character frequency analysis on the file generated the first step. The result is transferred back to the host running this script. ..note:: The placeholder ``$STEP_1`` used in ``link_input_data`` is a reference to the working directory of step 1. ``$STEP_`` can be used analogous to refernce other steps. """ k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=asciifile-{0}.dat".format(instance), "--outputfile=cfreqs-{0}.dat".format(instance)] k.upload_input_data = "asciifile-{0}.dat".format(instance) k.download_output_data = "cfreqs-{0}.dat".format(instance) return k
def analysis_step(self, iteration, instance): """In the analysis step we use the ``$PREV_SIMULATION`` data reference to refer to the previous simulation. The same instance is picked implicitly, i.e., if this is instance 5, the previous simulation with instance 5 is referenced. """ #upload_input_data = [] #for i in range(1, self.simlation_instances+1): # upload_input_data.append("asciifile-{0}.dat".format(i)) k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=asciifile-*.dat", "--outputfile=cfreqs.dat"] k.upload_input_data = ['asciifile-{0}.dat'.format(instance)] k.download_output_data = ["cfreqs.dat > cfreqs-{0}.dat".format(instance)] return [k]
def step_1(self, instance): """Run AMBER MD Simulations""" k = Kernel(name="amber") k.arguments = [ "--minfile=min.in", "--topfile=penta.top", "--crdfile=penta.crd", "--output=md.crd" ] k.upload_input_data = [ 'amber_input/min.in', 'amber_input/penta.top', 'amber_input/penta.crd' ] k.download_output_data = [ 'md.crd > amber_output/md_{0}.crd'.format(instance) ] return k
def prepare_replica_for_md(self, replica): input_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".md" output_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".out" k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=" + input_name, "--outputfile=" + output_name] k.upload_input_data = input_name k.download_output_data = output_name k.cores = 1 replica.cycle = replica.cycle + 1 return k
def pre_loop(self): ''' function : transfers input files, intermediate executables pre_coam_loop :- Purpose : Transfers files Arguments : None ''' k = Kernel(name="md.pre_coam_loop") k.upload_input_data = [ Kconfig.initial_crd_file, Kconfig.md_input_file, Kconfig.minimization_input_file, Kconfig.top_file, '{0}/postexec.py'.format(Kconfig.helper_scripts) ] return k
def pre_loop(self): ''' function : transfers input files, intermediate executables pre_coam_loop :- Purpose : Transfers files Arguments : None ''' k = Kernel(name="md.pre_coam_loop") k.upload_input_data = [Kconfig.initial_crd_file, Kconfig.md_input_file, Kconfig.minimization_input_file, Kconfig.top_file, '{0}/postexec.py'.format(Kconfig.misc_loc)] return k
def prepare_replica_for_md(self, replica): """Specifies input and output files and passes them to kernel Arguments: replica - object representing a given replica and it's associated parameters """ input_name = self.inp_basename + "_" + str(replica.id) + "_" + str(replica.cycle) + ".md" output_name = self.inp_basename + "_" + str(replica.id) + "_" + str(replica.cycle) + ".out" k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=" + input_name, "--outputfile=" + output_name] k.upload_input_data = input_name k.download_output_data = output_name k.cores = 1 replica.cycle = replica.cycle + 1 return k
def step_2(self,instance): k2 = Kernel(name="md.amber") k2.arguments = [ "--mdinfile={0}".format(os.path.basename(Kconfig.md_input_file)), "--topfile={0}".format(os.path.basename(Kconfig.top_file)), "--cycle=%s"%(1) ] k2.upload_input_data = [Kconfig.md_input_file] k2.link_input_data = [ "$STEP_1/{0}".format(os.path.basename(Kconfig.top_file)), "$STEP_1/md{0}.crd > md{0}.crd".format(1), ] k2.cores = 1 return k2
def prepare_replica_for_md(self, replica): input_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".md" output_name = self.inp_basename + "_" + \ str(replica.id) + "_" + \ str(replica.cycle) + ".out" k = Kernel(name="misc.ccount") k.arguments = [ "--inputfile=" + input_name, "--outputfile=" + output_name ] k.upload_input_data = input_name k.download_output_data = output_name k.cores = 1 replica.cycle = replica.cycle + 1 return k
def prepare_replica_for_exchange(self, replica): """Launches matrix_calculator.py script on target resource in order to populate columns of swap matrix Arguments: replica - object representing a given replica and it's associated parameters """ #matrix_col = "matrix_column_{cycle}_{replica}.dat"\ # .format(cycle=replica.cycle-1, replica=replica.id ) k = Kernel(name="misc.ccount") k.arguments = ["--inputfile=asciifile-{0}.dat".format(replica.id),"--outputfile=cfreqs.dat"] k.upload_input_data = ["asciifile-{0}.dat".format(replica.id)] k.download_output_data = ["cfreqs.dat > cfreqs-{0}.dat".format(replica.id)] return k
def element_comparison(self, element1, element2): """In the comparison, we take the previously generated modified trajectory and perform a Hausdorff distance calculation between all the unique pairs of trajectories """ input_filename1 = "trj_%s_%03i.npz.npy"%(ATOM_SEL,element1) input_filename2 = "trj_%s_%03i.npz.npy"%(ATOM_SEL,element2) output_filename = "comparison-{0}-{1}.dat".format(element1, element2) k = Kernel(name="my.hausdorff") k.arguments = ["--dist_file=hausdorff_kernel.py", "--inputfile1={0}".format(input_filename1), "--inputfile2={0}".format(input_filename2), "--outputfile={0}".format(output_filename)] k.upload_input_data = ["hausdorff_kernel.py"] # The result files comparison-x-y.dat are downloaded. k.download_output_data = output_filename return k
def prepare_replica_for_exchange(self, replica): """Launches matrix_calculator.py script on target resource in order to populate columns of swap matrix Arguments: replica - object representing a given replica and it's associated parameters """ # Note: no files are transferred back from resource # Matrix columns are obtained through CU.stdout k = Kernel(name="md.re_exchange") k.arguments = ["--calculator=matrix_calculator.py", "--replica_id=" + str(replica.id), "--replica_cycle=" + str(replica.cycle-1), "--replicas=" + str(self.replicas), "--replica_basename=" + self.inp_basename] k.upload_input_data = "matrix_calculator.py" return k
def prepare_replica_for_md(self, replica): """Specifies input and output files and passes them to kernel Arguments: replica - object representing a given replica and it's associated parameters """ input_name = self.inp_basename + "_" + str(replica.id) + "_" + str( replica.cycle) + ".md" output_name = self.inp_basename + "_" + str(replica.id) + "_" + str( replica.cycle) + ".out" k = Kernel(name="misc.ccount") k.arguments = [ "--inputfile=" + input_name, "--outputfile=" + output_name ] k.upload_input_data = input_name k.download_output_data = output_name k.cores = 1 replica.cycle = replica.cycle + 1 return k
def prepare_replica_for_md(self, replica): """Specifies input and output files and passes them to NAMD kernel Arguments: replica - object representing a given replica and it's attributes Returns: k - an instance of Kernel class """ self.build_input_file(replica) input_file = "%s_%d_%d.namd" % (self.inp_basename[:-5], \ replica.id, \ (replica.cycle)) # this can be commented out output_file = replica.new_history new_coor = replica.new_coor new_vel = replica.new_vel new_history = replica.new_history new_ext_system = replica.new_ext_system old_coor = replica.old_coor old_vel = replica.old_vel old_ext_system = replica.old_ext_system copy_out = [] copy_out.append(new_history) copy_out.append(new_coor) copy_out.append(new_vel) copy_out.append(new_ext_system) k = Kernel(name="md.namd") k.arguments = [input_file] k.upload_input_data = [str(input_file)] k.copy_output_data = copy_out k.download_output_data = new_history replica.cycle += 1 return k
def prepare_replica_for_exchange(self, replica): """Launches matrix_calculator.py script on target resource in order to populate columns of swap matrix Arguments: replica - object representing a given replica and it's associated parameters """ matrix_col = "matrix_column_{cycle}_{replica}.dat"\ .format(cycle=replica.cycle-1, replica=replica.id ) k = Kernel(name="md.re_exchange") k.arguments = ["--calculator=matrix_calculator.py", "--replica_id=" + str(replica.id), "--replica_cycle=" + str(replica.cycle-1), "--replicas=" + str(self.replicas), "--replica_basename=" + self.inp_basename] k.upload_input_data = "matrix_calculator.py" k.download_output_data = matrix_col return k
def pre_loop(self): ''' function : transfers input files, intermediate executables pre_coam_loop :- Purpose : Transfers files that will be used for this workflow in the remote machine. This is a kernel that can be used from all workflows for transfering data files. Arguments : None ''' k = Kernel(name="md.pre_coam_loop") k.upload_input_data = [ Kconfig.initial_crd_file, Kconfig.md_input_file, Kconfig.top_file, Kconfig.itp_file, Kconfig.restr_file, Kconfig.eminrestr_md, Kconfig.eeqrestr_md, '{0}/postprocessing.py'.format(Kconfig.misc_loc) ] outbase, ext = os.path.basename(Kconfig.output).split('.') return k
def prepare_replica_for_exchange(self, replica): """Launches matrix_calculator.py script on target resource in order to populate columns of swap matrix Arguments: replica - object representing a given replica and it's associated parameters """ matrix_col = "matrix_column_{cycle}_{replica}.dat"\ .format(cycle=replica.cycle-1, replica=replica.id ) k = Kernel(name="md.re_exchange") k.arguments = [ "--calculator=matrix_calculator.py", "--replica_id=" + str(replica.id), "--replica_cycle=" + str(replica.cycle - 1), "--replicas=" + str(self.replicas), "--replica_basename=" + self.inp_basename ] k.upload_input_data = "matrix_calculator.py" k.download_output_data = matrix_col return k
def analysis_step(self, iteration, instance): k = Kernel(name="misc.idle") k.arguments = ["--duration={0}".format(self.idle_time)] k.upload_input_data = "/etc/passwd" #k.download_output_data = "/etc/passwd" return k
def pre_loop(self): k = Kernel(name="misc.mkfile") k.arguments = ["--size=1000", "--filename=reference.dat"] k.upload_input_data = ['levenshtein.py'] return k
def step_1(self, instance): k = Kernel(name="misc.hello") k.upload_input_data = ['./input_file.txt > temp.txt'] k.arguments = ["--file=temp.txt"] k.download_output_data = ['./temp.txt > output_file.txt'] 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.upload_input_data = self._upload_directives k.download_output_data = self._download_output return k
def analysis_step(self, iteration, instance): k = Kernel(name="misc.idle") k.arguments = ["--duration={0}".format(self.idle_time)] k.upload_input_data = ["%s > INPUT" % self.data_file_path] k.download_output_data = ["INPUT > %s" % self.local_workdir] return k