def parseoptions(self, options_list=None): """ Handle mpirun mode: - continue with reduced set of commandline options - These options are the keys of opts_to_remove. - The values of opts_to_remove are the number of arguments of these options, that also need to be removed. """ if options_list is None: options_list = self.default_parseoptions() newopts = options_list[:] # copy if self.mpirunmode: opts_to_remove = { '-np': 1, '-machinefile': 1 } for opt in opts_to_remove.keys(): try: pos = newopts.index(opt) # remove 1 + args del newopts[pos:pos + 1 + opts_to_remove[opt]] except ValueError: continue GeneralOption.parseoptions(self, newopts)
def parseoptions(self, options_list=None): """ Handle mpirun mode: - continue with reduced set of commandline options - These options are the keys of opts_to_remove. - The values of opts_to_remove are the number of arguments of these options, that also need to be removed. """ if options_list is None: options_list = self.default_parseoptions() newopts = options_list[:] # copy if self.mpirunmode: opts_to_remove = { '-np': 1, '-machinefile': 1 } for opt in opts_to_remove.keys(): try: pos = newopts.index(opt) # remove 1 + args del newopts[pos:pos + 1 + opts_to_remove[opt]] except ValueError: continue GeneralOption.parseoptions(self, newopts) # set error logging to file as soon as possible if self.options.logtofile: print("logtofile %s" % self.options.logtofile) if os.path.exists(self.options.logtofile): os.remove(self.options.logtofile) fancylogger.logToFile(self.options.logtofile) fancylogger.logToScreen(False)
def parseoptions(self, options_list=None): """Handle mpirun mode: continue with reduced set of commandline options These options are the keys of optsToRemove. The values of optsToRemove are the number of arguments of these options, that also need to be removed. """ if options_list is None: options_list = self.default_parseoptions() optsToRemove = {'-np': 1, '-machinefile': 1} newopts = options_list[:] # copy if self.mpirunmode: for opt in optsToRemove.keys(): try: pos = newopts.index(opt) # remove 1 + args del newopts[pos:pos + 1 + optsToRemove[opt]] except ValueError: continue GeneralOption.parseoptions(self, newopts)
def __init__(self, ismpirun=False): self.mpirunmode = ismpirun # super(MympirunOption, self).__init__() GeneralOption.__init__(self)
def __init__(self, ismpirun=False): self.mpirunmode = ismpirun GeneralOption.__init__(self)