Exemplo n.º 1
0
    def run(self, strong_scaled=1, autoterminate=True, queue='high', walltime=1440):
        pipelines = set()
        input_data = list()

        for protocol in self._protocols:
            gen_pipeline = protocol.generate_pipeline()
            pipelines.add(gen_pipeline)
            input_data.extend(protocol.input_data)
            self.ids[protocol.id()] = gen_pipeline
            # protocol.id is the uuid, gen_pipeline.uid is the pipeline

            self.total_replicas += protocol.replicas

        self._cores = self._cores * self.total_replicas
        print 'Running on', self._cores, 'cores.'

        res_dict = {'resource': 'ncsa.bw_aprun',
                    'walltime': walltime,
                    'cores': int(self._cores*strong_scaled),
                    'project': 'bamm',
                    'queue': queue,
                    'access_schema': 'gsissh'}

        # Create Resource Manager object with the above resource description
        resource_manager = ResourceManager(res_dict)
        resource_manager.shared_data = input_data

        # Create Application Manager
        self.app_manager = AppManager(hostname=self._hostname, port=self._port, autoterminate=autoterminate)
        self.app_manager.resource_manager = resource_manager
        self.app_manager.assign_workflow(pipelines)

        self._prof.prof('execution_run')
        print 'Running...'
        self.app_manager.run()    # this method is blocking until all pipelines show state = completed
            }
        else:
            print("use_gpus not recognized")

        print res_dict
        # Create Resource Manager object with the above resource description
        rman = ResourceManager(res_dict)
        # Data common to multiple tasks -- transferred only once to common staging area
        rman.shared_data = [
            Kconfig.md_input_file,
            Kconfig.md_run_file,
            Kconfig.lsdm_config_file,
            '%s/spliter.py' % Kconfig.helper_scripts,
            '%s/gro.py' % Kconfig.helper_scripts,
            #'%s/run.py' % Kconfig.helper_scripts,
            #'%s/run_openmm.py' % Kconfig.helper_scripts,
            #'%s/pre_analyze.py' % Kconfig.helper_scripts,
            '%s/pre_analyze_openmm.py' % Kconfig.helper_scripts,
            '%s/post_analyze.py' % Kconfig.helper_scripts,
            #'%s/selection.py' % Kconfig.helper_scripts,
            '%s/selection-cluster.py' % Kconfig.helper_scripts,
            '%s/reweighting.py' % Kconfig.helper_scripts
        ]

        #if Kconfig.ndx_file is not None:
        #    rman.shared_data.append(Kconfig.ndx_file)

        # Create Application Manager, only one extasy script on one rabbit-mq server now
        appman = AppManager(hostname='two.radical-project.org',
                            port=33134)  #port=args.port)
        # appman = AppManager(port=) # if using docker, specify port here.
Exemplo n.º 3
0
        else:
            print("use_gpus not recognized")

        print res_dict
        # Create Resource Manager object with the above resource description
        rman = ResourceManager(res_dict)
        # Data common to multiple tasks -- transferred only once to common staging area
        rman.shared_data = [
            Kconfig.md_dir + Kconfig.md_input_file,
            Kconfig.md_dir + Kconfig.md_run_file,
            args.Kconfig,
            #'%s > %s/%s' % (args.Kconfig, combined_path, args.Kconfig),
            #Kconfig.lsdm_config_file,
            #'%s/spliter-tica.py' % Kconfig.helper_scripts,
            '%s/run-tica-msm.py' % Kconfig.helper_scripts,
            #'%s/run.py' % Kconfig.helper_scripts,
            #'%s/run_openmm.py' % Kconfig.helper_scripts,
            #'%s/pre_analyze.py' % Kconfig.helper_scripts,
            #'%s/pre_analyze_openmm.py' % Kconfig.helper_scripts,
            #'%s/post_analyze.py' % Kconfig.helper_scripts,
            #'%s/selection.py' % Kconfig.helper_scripts,
            #'%s/selection-cluster.py' % Kconfig.helper_scripts,
            #'%s/reweighting.py' % Kconfig.helper_scripts
        ]

        #if Kconfig.ndx_file is not None:
        #    rman.shared_data.append(Kconfig.ndx_file)

        # Create Application Manager, only one extasy script on one rabbit-mq server now
        appman = AppManager(hostname='two.radical-project.org',
                            port=33134)  #port=args.port)
Exemplo n.º 4
0
        'cores': total_cores,
        'project': 'TG-MCB090174',
        'access_schema': 'gsissh'
    }

    # Download analysis file from MobleyLab repo
    os.system(
        'curl -O https://raw.githubusercontent.com/MobleyLab/alchemical-analysis/master/alchemical_analysis/alchemical_analysis.py'
    )

    # Create Resource Manager object with the above resource description
    rman = ResourceManager(res_dict)
    # Data common to multiple tasks -- transferred only once to common staging area
    rman.shared_data = [
        './CB7G3.gro', './CB7G3.ndx', './CB7G3.top', './CB7G3_template.mdp',
        './analysis_1.py', './analysis_2.py', './determine_convergence.py',
        './alchemical_analysis.py', './3atomtypes.itp', './3_GMX.itp',
        './cucurbit_7_uril_GMX.itp'
    ]

    # Create Application Manager
    appman = AppManager()
    #appman = AppManager(port=) # if using docker, specify port here.

    # Assign resource manager to the Application Manager
    appman.resource_manager = rman

    # Assign the workflow as a set of Pipelines to the Application Manager
    appman.assign_workflow(pipes_set)

    # Run the Application Manager
    appman.run()
Exemplo n.º 5
0
    print pilot_cores

    # Create a dictionary describe four mandatory keys:
    # resource, walltime, cores and project
    # resource is 'local.localhost' to execute locally
    res_dict = {
        'resource': res_name,
        'walltime': res_coll[res_name]['walltime'],
        'cores': pilot_cores,
        'project': res_coll[res_name]['project'],
        'access_schema': res_coll[res_name]['schema']
    }

    # Create Resource Manager object with the above resource description
    rman = ResourceManager(res_dict)
    rman.shared_data = [
        './ip_data/input.gro', './ip_data/grompp.mdp', './ip_data/topol.top'
    ]

    # Create Application Manager
    appman = AppManager(port=32769)

    # Assign resource manager to the Application Manager
    appman.resource_manager = rman

    # Assign the workflow as a set of Pipelines to the Application Manager
    appman.assign_workflow(pipes_set)

    # Run the Application Manager
    appman.run()
Exemplo n.º 6
0
        'access_schema': 'gsissh'
    }

    # Download analysis file from MobleyLab repo
    os.system(
        'curl -O https://raw.githubusercontent.com/MobleyLab/alchemical-analysis/master/alchemical_analysis/alchemical_analysis.py'
    )

    # Create Resource Manager object with the above resource description
    rman = ResourceManager(res_dict)
    # Data common to multiple tasks -- transferred only once to common staging area
    rman.shared_data = [
        './CB7G3.gro', './CB7G3.ndx', './CB7G3.top', './CB7G3_template.mdp',
        './analysis_1.py', './analysis_2.py', './determine_convergence.py',
        './alchemical_analysis.py', './3atomtypes.itp', './3_GMX.itp',
        './cucurbit_7_uril_GMX.itp', './CB7G3_1.gro', './CB7G3_2.gro',
        './CB7G3_3.gro', './CB7G3_4.gro', './CB7G3_5.gro', './CB7G3_6.gro',
        './CB7G3_7.gro', './CB7G3_8.gro', './CB7G3_9.gro', './CB7G3_10.gro',
        './CB7G3_11.gro', './CB7G3_12.gro', './CB7G3_13.gro', './CB7G3_14.gro',
        './CB7G3_15.gro', './CB7G3_0.gro'
    ]

    # Create Application Manager
    appman = AppManager()
    #appman = AppManager(port=) # if using docker, specify port here.

    # Assign resource manager to the Application Manager
    appman.resource_manager = rman

    # Assign the workflow as a set of Pipelines to the Application Manager
    appman.assign_workflow(pipelines_set)
Exemplo n.º 7
0
    def run(self, resource=None, walltime=None, strong_scaled=1, queue=None, access_schema=None, dry_run=False):
        """Run protocols.

        Parameters
        ----------
        resource: str
            The specific resource and sub-resource you want to use.
        walltime: int
            Wall time in minutes.
        strong_scaled: float
            For testing strong scaling. Number of cores will be multiplied by this number before execution.
        queue: str
            Name of the queue. If there is a default for your resource that will be used.
        access_schema: str
            One of ssh, gsissh, local
        dry_run: bool
            Whether to execute the `.run` command or not.
        """

        pipelines = set()
        shared_data = set()
        cores = 0

        max_cu_count = self.resource.get('max_cu_count', 0)

        for protocol in self._protocols:
            gen_pipeline = protocol.generate_pipeline()

            cu_count = len(gen_pipeline.stages[0].tasks)
            if max_cu_count and cu_count > max_cu_count:
                raise ValueError('Resource allows up to {} concurrent CUs. You have {}.'.format(max_cu_count, cu_count))

            pipelines.add(gen_pipeline)
            shared_data.update(protocol.shared_data)
            cores += protocol.cores

        cores *= strong_scaled
        cores += self.resource.get('agent_cores', 0)

        self.resource['resource_dictionary']['cores'] = cores

        if resource:
            self.resource['resource_dictionary']['resource'] = resource
        if walltime:
            self.resource['resource_dictionary']['walltime'] = walltime
        if queue:
            self.resource['resource_dictionary']['queue'] = queue
        if access_schema:
            self.resource['resource_dictionary']['access_schema'] = access_schema

        logger.info('Using total number of cores: {}.'.format(cores))
        logger.info('Resource dictionary:\n{}'.format(pprint.pformat(self.resource['resource_dictionary'])))

        # Create Resource Manager object with the above resource description
        resource_manager = ResourceManager(self.resource['resource_dictionary'])
        resource_manager.shared_data = list(shared_data)

        # Create Application Manager
        self._app_manager.resource_manager = resource_manager
        self._app_manager.assign_workflow(pipelines)

        logger.info("\n".join("Stage {}: {}*{} cores.".
                              format(i, len(s.tasks), next(iter(s.tasks)).cores)
                              for i, s in enumerate(next(iter(pipelines)).stages)))

        self._prof.prof('execution_run')
        logger.info('Running workflow.')

        if not dry_run:
            self._app_manager.run()    # this method is blocking until all pipelines show state = completed