Skip to content

Question for Olivier: does run.sh support more than one CPU core? Can it? Should it? #1001

@valassi

Description

@valassi

Question for Olivier: does run.sh support more than one CPU core? Can it? Should it?

Hi @oliviermattelaer just a question for you. This is from bits and pieces of skype with @choij1589 @Saptaparna @roiser

I am trying to understand if run.sh uses more than one core. This does not seem to be the case. The gridpack I have (slightly modified with profiling, but still) has

    def launch(self, nb_event, seed):
        """ launch the generation for the grid """
        print("__CUDACPP_DEBUG: GridPackCmd.launch starting")
        cudacpp_start = time.perf_counter()
        # 1) Restore the default data
        print("__CUDACPP_DEBUG: GridPackCmd.launch (1) restore_data")
        logger.info('generate %s events' % nb_event)
        logger.info('nb_core = %s' % self.options['nb_core'])
        self.set_run_name('GridRun_%s' % seed)
        if not self.readonly:
            self.update_status('restoring default data', level=None)
            misc.call([pjoin(self.me_dir,'bin','internal','restore_data'),
                         'default'], cwd=self.me_dir)

        if self.run_card['python_seed'] == -2:
            import random
            if not hasattr(random, 'mg_seedset'):
                random.seed(seed)  
                random.mg_seedset = seed
        elif self.run_card['python_seed'] > 0:
            import random
            if not hasattr(random, 'mg_seedset'):
                random.seed(self.run_card['python_seed'])  
                random.mg_seedset = self.run_card['python_seed']         
        # 2) Run the refine for the grid
        print("__CUDACPP_DEBUG: GridPackCmd.launch (2) refine4grid")
        self.update_status('Generating Events', level=None)
        #misc.call([pjoin(self.me_dir,'bin','refine4grid'),
        #                str(nb_event), '0', 'Madevent','1','GridRun_%s' % seed],
        #                cwd=self.me_dir)
        self.refine4grid(nb_event)
...
    def refine4grid(self, nb_event):
        """Special refine for gridpack run."""
        print("__CUDACPP_DEBUG: GridPackCmd.refine4grid starting")
        cudacpp_start = time.perf_counter()
        self.nb_refine += 1
        
        precision = nb_event

        self.opts = dict([(key,value[1]) for (key,value) in \
                          self._survey_options.items()])
        
        # initialize / remove lhapdf mode
        # self.configure_directory() # All this has been done before
        self.cluster_mode = 0 # force single machine

In other words, I have the impression that self.cluster_mode = 0 hardcodes the use of only one core?

Can you confirm (or otherwise clarify) please?
Thanks

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions