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

Python ensemblemd.SingleClusterEnvironment类代码示例

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

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



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

示例1: enmd_setup_run

def enmd_setup_run(request):
    from radical.ensemblemd import SingleClusterEnvironment
    try:
        sec = SingleClusterEnvironment(
            #resource="local.localhost",
            #cores=1,
            #walltime=1,
            resource="xsede.stampede",
            cores=1,
            walltime=1,
	    username='tg831932',
	    project='TG-MCB090174',
	    access_schema='ssh',
	    queue='development',
            database_url='mongodb://suvigya:[email protected]:51585',
            database_name='rutgers_thesis'
            )
        test = _TestRun(steps=1,instances=1)
        ret_allocate = sec.allocate()
        ret_run = sec.run(test)
        ret_deallocate = sec.deallocate()
    except Exception as e:
        #print ret_run
        raise
    return ret_allocate,ret_run,ret_deallocate
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:25,代码来源:test_execution_context_api.py


示例2: test__simulation_analysis_loop_profiling

    def test__simulation_analysis_loop_profiling(self):
        """ Tests the Pipeline execution pattern API.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=30,
            username=None,
            allocation=None
        )
        # wait=True waits for the pilot to become active
        # before the call returns. This is not useful when
        # you want to take advantage of the queueing time /
        # file-transfer overlap, but it's useful for baseline
        # performance profiling of a specific pattern.
        cluster.allocate(wait=True)

        nopsa = _NopSA(
            maxiterations=1,
            simulation_instances=4,
            analysis_instances=4,
            idle_time = 10
        )
        cluster.run(nopsa)

        pdct = nopsa.execution_profile_dict
        dfrm = nopsa.execution_profile_dataframe
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:27,代码来源:test_profiling.py


示例3: test__copy_input_data_single

    def test__copy_input_data_single(self):
        """Check if we can copy output data to a different location on the execution host - single input.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=5
        )

        test = _TestCopyOutputData_Pattern(
            instances=1,
            output_copy_directives=["checksum.txt > {0}".format(self._output_dir)]
        )
        cluster.allocate()
        cluster.run(test)
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:15,代码来源:test_copy_output_data.py


示例4: test__link_input_data_multi

    def test__link_input_data_multi(self):
        """Check if we can link input data from a location on the execution host - multiple input.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=15
        )

        test = _TestLinkInputData_Pattern(
            instances=1,
            link_directives=["/etc/passwd", "/etc/group"],
            checksum_inputfile="passwd",
            download_output="CHKSUM_3"
        )
        cluster.allocate()
        cluster.run(test)
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:17,代码来源:test_link_input_data.py


示例5: test__link_input_data_single_rename

    def test__link_input_data_single_rename(self):
        """Check if we can link input data from a location on the execution host - single input with rename.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=15
        )

        test = _TestLinkInputData_Pattern(
            instances=1,
            link_directives="/etc/passwd > input",
            checksum_inputfile="input",
            download_output="CHKSUM_2"
        )
        cluster.allocate()
        cluster.run(test)
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:17,代码来源:test_link_input_data.py


示例6: enmd_setup_run

def enmd_setup_run(request):
    from radical.ensemblemd import SingleClusterEnvironment
    try:
        sec = SingleClusterEnvironment(
            resource="local.localhost",
            cores=1,
            walltime=1,
            database_url='mongodb://suvigya:[email protected]:51585',
            database_name='rutgers_thesis'
            )
        test = _TestRun(steps=1,instances=1)
        ret_allocate = sec.allocate()
        ret_run = sec.run(test)
        ret_deallocate = sec.deallocate()
    except Exception as e:
        print ret_run
        raise
    return ret_allocate,ret_run,ret_deallocate
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:18,代码来源:__test_execution_context_api.py


示例7: test__single_cluster_environment_api

    def test__single_cluster_environment_api(self):
        """ Test the single cluster environment API.
        """

        from radical.ensemblemd import SingleClusterEnvironment

        sec = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=1
        )

        try:
            sec.allocate()
            sec.run("wrong_type")
            assert False, "TypeError execption expected."
        except Exception, ex:
            pass
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:18,代码来源:test_execution_context_api.py


示例8: enmd_setup

def enmd_setup():
    from radical.ensemblemd import SingleClusterEnvironment
    try:
        sec = SingleClusterEnvironment(
            resource="local.localhost",
            cores=1,
            walltime=1,
            database_url='mongodb://suvigya:[email protected]:51585',
            database_name='rutgers_thesis'
            )
        ret_allocate = sec.allocate(wait=True)
        ret_deallocate = False
        ret_deallocate= sec.deallocate()

    except Exception as e:
        print 'test failed'
        raise

    return ret_allocate,ret_deallocate
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:19,代码来源:__test_execution_context_api.py


示例9: test_pipeline_remote

    def test_pipeline_remote(self,cmdopt):
#if __name__ == "__main__":
        resource = cmdopt
        home = expanduser("~")
        try:

            with open('%s/workspace/EnsembleMDTesting/config.json'%home) as data_file:    
                  config = json.load(data_file)
            #resource='xsede.stampede'
            print "project: ",config[resource]['project']
            print "username: ", config[resource]['username'] 
            # Create a new static execution context with one resource and a fixed
            # number of cores and runtime.
            cluster = SingleClusterEnvironment(
                        resource=resource,
                        cores=1,
                        walltime=15,
                        #username='tg831932',
                        username=config[resource]['username'],
                        #project="TG-MCB090174",
                        #access_schema="ssh",
                        #queue="development",
                        project=config[resource]['project'],
                        access_schema = config[resource]['schema'],
                        queue = config[resource]['queue'],

                        database_url='mongodb://suvigya:[email protected]:51585',
                        database_name='rutgers_thesis',
                  )

            os.system('/bin/echo remote > input_file.txt')

            # Allocate the resources.
            cluster.allocate()

            # Set the 'instances' of the pipeline to 1. This means that 1 instance
            # of each pipeline step is executed.
            app = _TestPipeline(steps=1,instances=1)

            cluster.run(app)

            # Deallocate the resources. 
            cluster.deallocate()
            f = open("%s/workspace/EnsembleMDTesting/temp_results/remote_file.txt"%home)
            print "Name of file: ", f.name
            print "file closed or not: ", f.closed
            fname = f.readline().split()
            print "fname: ", fname
            assert fname == ['remote']
            f.close()
            os.remove("%s/workspace/EnsembleMDTesting/temp_results/remote_file.txt"%home)

        except EnsemblemdError, er:

            print "Ensemble MD Toolkit Error: {0}".format(str(er))
            raise # Just raise the execption again to get the backtrace
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:56,代码来源:test_j_pipeline_E2E.py


示例10: test_copy_input_data_single

      def test_copy_input_data_single(self):
#if __name__ == '__main__':

          #resource = 'local.localhost'
          try:

              with open('%s/config.json'%os.path.dirname(os.path.abspath(__file__))) as data_file:    
                    config = json.load(data_file)

                  # Create a new static execution context with one resource and a fixed
                  # number of cores and runtime.
              
              cluster = SingleClusterEnvironment(
                              resource='xsede.stampede',
                              cores=1,
                              walltime=15,
                              #username=None,
	    		      username='tg831932',
	    		      project='TG-MCB090174',
	    		      access_schema='ssh',
	    		      queue='development',

                              #project=config[resource]['project'],
                              #access_schema = config[resource]['schema'],
                              #queue = config[resource]['queue'],

                              database_url='mongodb://suvigya:[email protected]:51585/rutgers_thesis'
                        )

              os.system('/bin/echo passwd > input_file.txt')

                  # Allocate the resources.
              cluster.allocate(wait=True)

                  # Set the 'instances' of the pipeline to 1. This means that 1 instance
                  # of each pipeline step is executed.
      ##        app = _TestMyApp(instances=1,
      ##                         copy_directives="/etc/passwd",
      ##                         checksum_inputfile="passwd",
      ##                         download_output="CHKSUM_1"
      ##                         )
              app = _TestMyApp(steps=1,instances=1)
              cluster.run(app)
              f = open("./output_file.txt")
              print "Name of file: ", f.name
              print "file closed or not: ", f.closed
              fname = f.readline().split()
              print "fname: ", fname
              cluster.deallocate()
              assert fname == ['passwd']
              f.close()
              os.remove("./output_file.txt")

          except Exception as er:
              print "Ensemble MD Toolkit Error: {0}".format(str(er))
              raise # Just raise the execption again to get the backtrace
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:56,代码来源:test_copy_input_data.py


示例11: test__throw_on_malformed_kernel

    def test__throw_on_malformed_kernel(self):
        """Test if an exception is thrown in case things go wrong in the Simulation-Analysis pattern.
        """
        try:
            # Create a new static execution context with one resource and a fixed
            # number of cores and runtime.
            cluster = SingleClusterEnvironment(
                resource="localhost",
                cores=1,
                walltime=1,
                username=None,
                allocation=None
            )

            ccount = _FaultyPattern(maxiterations=1, simulation_instances=1, analysis_instances=1)
            cluster.run(ccount)

            assert False, "Expected exception due to malformed URL in Pattern description."

        except EnsemblemdError, er:
            # Exception should pop up.
            assert True
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:22,代码来源:test_simana_eh.py


示例12: enmd_setup

def enmd_setup():
    from radical.ensemblemd import SingleClusterEnvironment
    try:
        sec = SingleClusterEnvironment(
            resource="xsede.stampede",
            cores=1,
            walltime=1,
	    username='tg831932',
	    project='TG-MCB090174',
	    access_schema='ssh',
	    queue='development',
            database_url='mongodb://suvigya:[email protected]:51585',
            database_name='rutgers_thesis'
            )
        ret_allocate = sec.allocate(wait=True)
        ret_deallocate = False
        ret_deallocate= sec.deallocate()

    except Exception as e:
        print 'test failed'
        raise

    return ret_allocate,ret_deallocate
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:23,代码来源:test_execution_context_api.py


示例13: test__copy_input_data_multi

    def test__copy_input_data_multi(self):
        """Check if we can copy input data from a location on the execution host - multiple input.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=15
        )

        test = _TestCopyInputData_Pattern(
            instances=1,
            copy_directives=["/etc/passwd", "/etc/group"],
            checksum_inputfile="passwd",
            download_output="CHKSUM_3"
        )
        cluster.allocate()
        cluster.run(test)

        f = open("./CHKSUM_3")
        csum, fname = f.readline().split()
        assert "passwd" in fname
        f.close()
        os.remove("./CHKSUM_3")
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:23,代码来源:test_copy_input_data.py


示例14: test__upload_input_data_single_rename

    def test__upload_input_data_single_rename(self):
        """Check if we can upload input data from a location on the host running these tests - single input with rename.
        """
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=15
        )

        test = _TestUploadInputData_Pattern(
            instances=1,
            upload_directives="/etc/passwd > input",
            checksum_inputfile="input",
            download_output="CHKSUM_2"
        )
        cluster.allocate()
        cluster.run(test)

        f = open("./CHKSUM_2")
        csum, fname = f.readline().split()
        assert "input" in fname
        f.close()
        os.remove("./CHKSUM_2")
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:23,代码来源:test_upload_input_data.py


示例15: test_sal

    def test_sal(self,cmdopt):
#if __name__ == "__main__":

        resource = cmdopt
        home = expanduser("~")
        try:

            with open('%s/workspace/EnsembleMDTesting/config.json'%home) as data_file:    
                config = json.load(data_file)

            print 'Project: ',config[resource]['project']
            print 'Username: ',config[resource]['username']
     
           # Create a new static execution context with one resource and a fixed
            # number of cores and runtime.
            cluster = SingleClusterEnvironment(
                            resource=resource,
                            cores=1,
                            walltime=15,
                            username=config[resource]['username'],

                            project=config[resource]['project'],
                            access_schema = config[resource]['schema'],
                            queue = config[resource]['queue'],

                            database_url='mongodb://suvigya:[email protected]:51585/rutgers_thesis',
                            #database_name='myexps',
            )

            # Allocate the resources.
            cluster.allocate()
            randomsa = RandomSA(maxiterations=1, simulation_instances=1, analysis_instances=1)
            cluster.run(randomsa)
            cluster.deallocate()


            # After execution has finished, we print some statistical information
            # extracted from the analysis results that were transferred back.
            for it in range(1, randomsa.iterations+1):
                print "\nIteration {0}".format(it)
                ldists = []
                for an in range(1, randomsa.analysis_instances+1):
                    ldists.append(int(open("analysis-{0}-{1}.dat".format(it, an), "r").readline()))
                print "   * Levenshtein Distances: {0}".format(ldists)
                print "   * Mean Levenshtein Distance: {0}".format(sum(ldists) / len(ldists))
            assert os.path.isfile("%s/workspace/EnsembleMDTesting/E2E_test/analysis-1-1.dat"%home)
            os.remove("%s/workspace/EnsembleMDTesting/E2E_test/analysis-1-1.dat"%home)
        except EnsemblemdError, er:

            print "Ensemble MD Toolkit Error: {0}".format(str(er))
            raise # Just raise the execption again to get the backtrace
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:51,代码来源:test_j_simulation_analysis_loop.py


示例16: test_all_pairs_remote

    def test_all_pairs_remote(self,cmdopt):
#if __name__ == "__main__":


    # use the resource specified as argument, fall back to localhost
        resource = cmdopt
        home = expanduser("~")
        try:

            with open('%s/workspace/EnsembleMDTesting/config.json'%home) as data_file:    
                config = json.load(data_file)
            print 'project: ', config[resource]['project']
            print 'username: ',config[resource]['username']
            # Create a new static execution context with one resource and a fixed
            # number of cores and runtime.
            cluster = SingleClusterEnvironment(
                            resource=resource,
                            cores=1,
                            walltime=15,
                            username=config[resource]['username'],

                            project=config[resource]['project'],
                            access_schema = config[resource]['schema'],
                            queue = config[resource]['queue'],

                            database_url='mongodb://suvigya:[email protected]:51585',
                            database_name='rutgers_thesis',
            )

            # Allocate the resources.
            cluster.allocate()

            # For example the set has 5 elements.
            ElementsSet1 = range(1,2)
            randAP = _TestRandomAP(set1elements=ElementsSet1,windowsize1=1)

            cluster.run(randAP)

            cluster.deallocate()
            print "Pattern Execution Completed Successfully! Result files are downloaded!"
            assert os.path.isfile("./comparison_1_1.log")
            os.remove("./comparison_1_1.log")
            
        except EnsemblemdError, er:

            print "Ensemble MD Toolkit Error: {0}".format(str(er))
            raise # Just raise the execption again to get the backtrace
开发者ID:suvigya91,项目名称:EnsembleMD-Testsuit,代码行数:47,代码来源:test_j_allpairs_example.py


示例17: open

            resource = 'local.localhost'

      try:

            with open('%s/config.json'%os.path.dirname(os.path.abspath(__file__))) as data_file:    
                  config = json.load(data_file)

            # Create a new static execution context with one resource and a fixed
            # number of cores and runtime.
            cluster = SingleClusterEnvironment(
                        resource=resource,
                        cores=1,
                        walltime=15,
                        #username=None,

                        project=config[resource]['project'],
                        access_schema = config[resource]['schema'],
                        queue = config[resource]['queue'],

                        database_url='mongodb://ec2-54-221-194-147.compute-1.amazonaws.com:24242',
                        database_name='myexps',
                  )

            os.system('/bin/echo Welcome! > input_file.txt')

            # Allocate the resources.
            cluster.allocate()

            # Set the 'instances' of the pipeline to 1. This means that 1 instance
            # of each pipeline step is executed.
            app = MyApp(steps=1,instances=1)
开发者ID:dotsdl,项目名称:radical.ensemblemd,代码行数:31,代码来源:add_data.py


示例18: SingleClusterEnvironment

        param_i = replica_i.parameter
        replica_i.parameter = replica_j.parameter
        replica_j.parameter = param_i

# ------------------------------------------------------------------------------
#
if __name__ == "__main__":

    try:
        # Create a new static execution context with one resource and a fixed
        # number of cores and runtime.
        
        cluster = SingleClusterEnvironment(
            resource="localhost",
            cores=1,
            walltime=15,
            database_name='enmd-tests',
            username="",  #Username is entered as a string. Used when running on remote machine
            project=""    #Project ID is entered as a string. Used when running on remote machine
        )
        
        # Allocate the resources.
        cluster.allocate()

        # creating RE pattern object
        re_pattern = RePattern()

        # set number of replicas
        re_pattern.replicas = 32
 
        # set number of cycles
        re_pattern.nr_cycles = 3
开发者ID:mingtaiha,项目名称:EnMD_documentation,代码行数:32,代码来源:replica_exchange.py


示例19: SingleClusterEnvironment

            parser.error("Please enter a RP configuration file")
            sys.exit(1)
        if args.Kconfig is None:
            parser.error("Please enter a Kernel configuration file")
            sys.exit(0)

        RPconfig = imp.load_source("RPconfig", args.RPconfig)
        Kconfig = imp.load_source("Kconfig", args.Kconfig)

        # Create a new static execution context with one resource and a fixed
        # number of cores and runtime.
        cluster = SingleClusterEnvironment(
            resource=RPconfig.REMOTE_HOST,
            cores=RPconfig.PILOTSIZE,
            walltime=RPconfig.WALLTIME,
            username=RPconfig.UNAME,  # username
            project=RPconfig.ALLOCATION,  # project
            queue=RPconfig.QUEUE,
            database_url=RPconfig.DBURL,
        )

        cluster.shared_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}/pre_analyze.py".format(Kconfig.misc_loc),
            "{0}/post_analyze.py".format(Kconfig.misc_loc),
            "{0}/selection.py".format(Kconfig.misc_loc),
开发者ID:yuhangwang,项目名称:radical.ensemblemd,代码行数:31,代码来源:01_static_gromacs_lsdmap_loop.py


示例20: SingleClusterEnvironment

        traj_numpy = np.load(traj_filename)
        traj_count = traj_numpy.shape[0]

        data=open('input.txt','w')
        
        for coordinates in traj_numpy:
            data.write('%s,%s,%s\n'%(coordinates.tolist()[0],coordinates.tolist()[1],coordinates.tolist()[2]))
        
        data.close()

        cluster = SingleClusterEnvironment(
                resource="xsede.comet",
                cores=core_count,
                walltime=60,
                username="solejar",
                project="unc100",
                #queue='debug',
                database_url="mongodb://sean:[email protected]:19678/pilot_test"
            )

        cluster.shared_data =[
            '/home/sean/midas/leaflet_finder/Vanilla/input.txt'
        ]

        
        
        # Allocate the resources.
        cluster.allocate()
        #stage input data???
开发者ID:radical-cybertools,项目名称:midas,代码行数:29,代码来源:lf_finder_enMD_comet.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python entk.Pipeline类代码示例发布时间:2022-05-26
下一篇:
Python ensemblemd.SimulationAnalysisLoop类代码示例发布时间: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