def __init__(self, argv, config=None, seed=None, cwd_lock=None): self.__argv = argv local_path = os.path.dirname(os.path.realpath(__file__)) self.__config_file_name = "cfdOpt_config.ini" #if no config object provided, load the config template if config is None: self.__config = ConfigParser.RawConfigParser() #Inits blackbox config self.__config.read(local_path + "/" + self.__config_file_name) #Load config template else: self.__config = config #use config from external function #if no seed provided, use the seed in the input file name if seed is None: self.__black_box_seed = self.__get_the_seed(argv) else: self.__black_box_seed = seed if cwd_lock is None: self.__cwd_lock = None else: self.__cwd_lock = cwd_lock BlackBoxInSerial.__init__(self, self.__argv, self.__config, self.__black_box_seed, cwd_lock)
def __init__(self, argv, config=None, seed=None, cwd_lock=None): self.__argv = argv local_path = os.path.dirname(os.path.realpath(__file__)) self.__config_file_name = "cfdOpt_config.ini" #if no config object provided, load the config template if config is None: self.__config = ConfigParser.RawConfigParser( ) #Inits blackbox config self.__config.read(local_path + "/" + self.__config_file_name) #Load config template else: self.__config = config #use config from external function #if no seed provided, use the seed in the input file name if seed is None: self.__black_box_seed = self.__get_the_seed(argv) else: self.__black_box_seed = seed if cwd_lock is None: self.__cwd_lock = None else: self.__cwd_lock = cwd_lock BlackBoxInSerial.__init__(self, self.__argv, self.__config, self.__black_box_seed, cwd_lock)
def __get_the_seed(self, argv): if BlackBoxInSerial.is_nomad_input_file(self, argv): input_file_name = argv[1] seed = input_file_name.split('.')[-3] else: print "Wrong input arguments!" exit(1) return seed
def launch(self): self.set_up_for_parallel() BlackBoxInSerial.launch(self)