• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ensemblemd.Kernel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中radical.ensemblemd.Kernel的典型用法代码示例。如果您正苦于以下问题:Python Kernel类的具体用法?Python Kernel怎么用?Python Kernel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Kernel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: simulation_step

 def simulation_step(self, iteration, instance):
     """In the simulation step we
     """
     k = Kernel(name="misc.mkfile")
     k.arguments = ["--size=1000", "--filename=asciifile-{0}.dat".format(instance)]
     k.download_output_data = ['asciifile-{0}.dat'.format(instance)]
     return [k]
开发者ID:xielm12,项目名称:radical.ensemblemd,代码行数:7,代码来源:seq_sal.py


示例2: element_comparison

    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
开发者ID:mingtaiha,项目名称:radical.ensemblemd,代码行数:29,代码来源:hausdorff_example.py


示例3: step_1

    def step_1(self, instance):

        k = Kernel(name="misc.chksum")
        k.arguments            = ["--inputfile=UTF-8-demo.txt", "--outputfile=checksum{0}.sha1".format(instance)]
        k.download_input_data  = "htpttpt://malformed.url"
        k.download_output_data = "checksum{0}.sha1".format(instance)
        return k
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:7,代码来源:test_pipeline_eh.py


示例4: pre_loop

    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
开发者ID:ashkurti,项目名称:Hands-on-session-part-2-The-customized-gromacs-coco-workflow-of-ExTASY,代码行数:25,代码来源:extasy_gmxcoco.py


示例5: simulation_step

 def simulation_step(self, iteration, instance):
     """In the simulation step we
     """
     k = Kernel(name="misc.mkfile")
     k.arguments = ["--size=1000", "--filename=asciifile.dat"]
     k.exists_remote = ["asciifile.dat"]
     return [k]
开发者ID:yuhangwang,项目名称:radical.ensemblemd,代码行数:7,代码来源:multiple_simulations_single_analysis.py


示例6: simulation_stage

	def simulation_stage(self, iteration, instance):
		"""In the simulation stage we simply create files with 1000 characters.
		"""
		k = Kernel(name="misc.mkfile")
		k.arguments = ["--size=1000", "--filename=asciifile-{0}.dat".format(instance)]
		k.download_output_data = ['asciifile-{0}.dat > iter{1}/asciifile-{0}.dat'.format(instance,iteration)]
		return [k]
开发者ID:yuhangwang,项目名称:radical.ensemblemd,代码行数:7,代码来源:adaptive_simulation_analysis_loop_with_script.py


示例7: pre_loop

    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
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:25,代码来源:01_static_gromacs_lsdmap_loop.py


示例8: pre_loop

    def pre_loop(self):

        k = Kernel(name="misc.chksum")
        k.arguments            = ["--inputfile=UTF-8-demo.txt", "--outputfile=checksum.sha1"]
        k.download_input_data  = "htpttpt://malformed.url"
        k.download_output_data = "checksum.sha1"
        return k
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:7,代码来源:test_simana_eh.py


示例9: pre_loop

    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
开发者ID:mingtaiha,项目名称:EnMD_documentation,代码行数:33,代码来源:01_static_gromacs_lsdmap_loop.py


示例10: analysis_step

    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
        '''
        k = Kernel(name="md.coco")
        k.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),
                       "--cycle=%s"%(iteration)]
        k.link_input_data = ['$PRE_LOOP/{0}'.format(os.path.basename(Kconfig.top_file)),
                             '$PRE_LOOP/postexec.py']
        k.cores = RPconfig.PILOTSIZE
        for iter in range(1,iteration+1):
            for i in range(1,Kconfig.num_CUs+1):
                k.link_input_data = k.link_input_data + ['$SIMULATION_ITERATION_{0}_INSTANCE_{1}/md{0}.ncdf > md_{0}_{1}.ncdf'.format(iter,i)]
        return k
开发者ID:mingtaiha,项目名称:radical.ensemblemd,代码行数:32,代码来源:01_static_amber_coco_loop.py


示例11: set2element_initialization

 def set2element_initialization(self,element):
     # Creating an ASCII file by using the misc.mkfile kernel. Each file represents
     # a element of the set.
     print "Creating Element {0}".format(element)
     k = Kernel(name = "misc.mkfile")
     k.arguments = ["--size=10000", "--filename=newfile_{0}.dat".format(element)]
     return k
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:7,代码来源:test_j_allpairs_example.py


示例12: simulation_step

    def simulation_step(self, iteration, instance):

        """
        function : In iter=1, use the input files from pre_loop, else use the outputs of the analysis stage in the
        previous iteration. Run gromacs in each instance using these files.

        gromacs :-

                Purpose : Run the gromacs simulation on each of the smaller files. Parameter files and executables are input
                            from pre_loop. There are 'numCUs' number of instances of gromacs per iteration.

                Arguments : --grompp    = gromacs parameters filename
                            --topol     = topology filename
        """

        gromacs = Kernel(name="md.gromacs")
        gromacs.arguments = [
            "--grompp={0}".format(os.path.basename(Kconfig.mdp_file)),
            "--topol={0}".format(os.path.basename(Kconfig.top_file)),
        ]
        gromacs.link_input_data = [
            "$PRE_LOOP/{0} > {0}".format(os.path.basename(Kconfig.mdp_file)),
            "$PRE_LOOP/{0} > {0}".format(os.path.basename(Kconfig.top_file)),
            "$PRE_LOOP/run.py > run.py",
        ]

        if iteration - 1 == 0:
            gromacs.link_input_data.append("$PRE_LOOP/temp/start{0}.gro > start.gro".format(instance - 1))

        else:
            gromacs.link_input_data.append(
                "$ANALYSIS_ITERATION_{0}_INSTANCE_1/temp/start{1}.gro > start.gro".format(iteration - 1, instance - 1)
            )

        return gromacs
开发者ID:mingtaiha,项目名称:EnMD_documentation,代码行数:35,代码来源:01_static_gromacs_lsdmap_loop.py


示例13: step_1

    def step_1(self, instance):
        """The first step of the pipeline creates a 1 MB ASCI file.
        """
        k = Kernel(name="misc.mkfile")
        k.arguments = ["--size=1000000", "--filename=asciifile-{0}.dat".format(instance)]
	k.download_output_data = ['asciifile-{0}.dat'.format(instance)]
        return k
开发者ID:radical-experiments,项目名称:enmd-pattern-testing,代码行数:7,代码来源:pipeline.py


示例14: prepare_replica_for_exchange

    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
开发者ID:mingtaiha,项目名称:EnMD_documentation,代码行数:27,代码来源:replica_exchange_mode_1.py


示例15: analysis_stage

	def analysis_stage(self, iteration, instance):
		"""In the analysis stage, we take the previously generated simulation
		   output and perform a Levenshtein distance calculation between it
		   and the 'reference' file.

		   ..note:: The placeholder ``$PRE_LOOP`` used in ``link_input_data`` is
					a reference to the working directory of pre_loop.
					The placeholder ``$PREV_SIMULATION`` used in ``link_input_data``
					is a reference to the working directory of the previous
					simulation stage.

					It is also possible to reference a specific
					simulation stage using ``$SIMULATION_N`` or all simulations
					via ``$SIMULATIONS``. Analogous placeholders exist for
					``ANALYSIS``.
		"""
		input_filename  = "simulation-{0}-{1}.dat".format(iteration, instance)
		output_filename = "analysis-{0}-{1}.dat".format(iteration, instance)

		k = Kernel(name="misc.levenshtein")
		k.link_input_data      = ["$PRE_LOOP/reference.dat", "$SIMULATION_ITERATION_{1}_INSTANCE_{2}/{0}".format(input_filename,iteration,instance),"$PRE_LOOP/levenshtein.py"]
		k.arguments            = ["--inputfile1=reference.dat",
								  "--inputfile2={0}".format(input_filename),
								  "--outputfile={0}".format(output_filename)]
		k.download_output_data = output_filename
		return k
开发者ID:yuhangwang,项目名称:radical.ensemblemd,代码行数:26,代码来源:simulation_analysis_loop.py


示例16: prepare_replica_for_md

    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
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:26,代码来源:replica_exchange_b.py


示例17: stage_1

 def stage_1(self, instance):
     k = Kernel(name="synapse.sample")
     k.arguments = [	"--path=$HOME/ves/synapse_local", 
     				"--mode=sample",
     				"--flops=1000",
     				"--samples=1"
     				]
     return k
开发者ID:xielm12,项目名称:radical.ensemblemd,代码行数:8,代码来源:hello_synapse.py


示例18: pre_loop

 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"]
     return k
开发者ID:mingtaiha,项目名称:radical.ensemblemd,代码行数:8,代码来源:simulation_analysis_loop.py


示例19: stage_2

 def stage_2(self, instance):
     k2 = Kernel(name="md.gromacs")
     k2.link_input_data = ['$STAGE_1/in.tpr > in.tpr']
     k2.executable = ['path/to/gromacs/gmx']    
     k2.arguments = ['mdrun', '-s', 'in.tpr', '-deffnm', 'out']
     k2.cores = 1              
     
     return k2
开发者ID:radical-cybertools,项目名称:radical.repex,代码行数:8,代码来源:old_driver.py


示例20: simulation_stage

	def simulation_stage(self, iteration, instance):
		"""The simulation stage generates a 1 kB file containing random ASCII
		   characters that is compared against the 'reference' file in the
		   subsequent analysis stage.
		"""
		k = Kernel(name="misc.mkfile")
		k.arguments = ["--size=1000", "--filename=simulation-{0}-{1}.dat".format(iteration, instance)]
		return k
开发者ID:yuhangwang,项目名称:radical.ensemblemd,代码行数:8,代码来源:simulation_analysis_loop.py



注:本文中的radical.ensemblemd.Kernel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ensemblemd.SimulationAnalysisLoop类代码示例发布时间:2022-05-26
下一篇:
Python Coordinate.PolarCoordinate类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap