def __setRunId__(self): """ Set the current run id. Needed for the distant launching scripts """ if self.run_prefix: idx = 0 # Check if case exists if prefix is forced search_dir = os.path.join(self.case_dir, 'RESU', self.run_prefix) + '*' dirlist = glob(search_dir) dirlist.sort() if len(dirlist) > 0: idx = int(dirlist[-1].split("_")[-1]) self.run_id = self.run_prefix + '{:0>4}'.format(idx + 1) else: from code_saturne.cs_script import master_script id_args = ['run', '--suggest-id'] ms = master_script(id_args, self.pkg) retcode = ms.execute() self.run_id = retcode[0]
def launch(self, force_submit=False): os.chdir(self.case_id) from code_saturne.cs_script import master_script run_args = ['run'] ms = master_script(run_args, self.pkg) retcode = ms.execute()
def launch(self, force_submit=False): script_dir = os.path.join(self.case_dir, 'SCRIPTS') os.chdir(script_dir) from code_saturne.cs_script import master_script run_args = ['run', '-p', self.paramfile, '-n', str(self.nprocs)] ms = master_script(run_args, self.pkg) retcode = ms.execute()
def __createCase__(self): """ Creating the case for a given evaluation based on the user defined reference case """ from code_saturne.model.NotebookModel import NotebookModel # Creating the case from the ref case from code_saturne.cs_script import master_script case_create_args = ['create', '-c', os.path.join(self.study_path, self.case_id), '--copy-from', os.path.join(self.study_path, self.ref_case) ] ms = master_script(case_create_args, self.pkg) retcode = ms.execute() self.__setCsCase__() self.__setOtVarsVals__()