def submit_batch_for_peds_aver(self): self.exportLocalPars() # export run_number to cp.str_run_number if not self.job_can_be_submitted(self.job_id_peds_str, self.time_peds_job_submitted, 'peds'): return self.time_peds_job_submitted = gu.get_time_sec() self.command_for_peds_scan() cfg.make_psana_cfg_file_for_peds_aver() command = 'psana -c ' + fnm.path_peds_aver_psana_cfg( ) + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() queue = self.queue.value() bat_log_file = fnm.path_peds_aver_batch_log() self.job_id_peds_str, out, err = gu.batch_job_submit( command, queue, bat_log_file) self.procDarkStatus ^= 2 # set bit to 1 if err != '': self.stop_auto_processing(is_stop_on_button_click=False) logger.warning( 'Autoprocessing for run %s is stopped due to batch submission error!!!' % self.str_run_number, __name__)
def submit_batch_for_peds_aver(self) : self.exportLocalPars() # export run_number to cp.str_run_number if not self.job_can_be_submitted(self.job_id_peds_str, self.time_peds_job_submitted, 'peds') : return self.time_peds_job_submitted = gu.get_time_sec() self.command_for_peds_scan() if not cfg.make_psana_cfg_file_for_peds_aver() : self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False if not self.is_good_lsf() : self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False #command = 'psana -c ' + fnm.path_peds_aver_psana_cfg() + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() command = 'psana -c ' + fnm.path_peds_aver_psana_cfg() + self.opt + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() queue = self.queue.value() bat_log_file = fnm.path_peds_aver_batch_log() self.job_id_peds_str, out, err = gu.batch_job_submit(command, queue, bat_log_file) self.procDarkStatus ^= 2 # set bit to 1 if err != '' : self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('Autoprocessing for run %s is stopped due to batch submission error!!!' % self.str_run_number, __name__) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False return True
def command_for_peds_aver(self): if not cfg.make_psana_cfg_file_for_peds_aver(): logger.warning('INTERACTIVE JOB IS NOT STARTED !!!', __name__) return False command = 'psana -c ' + fnm.path_peds_aver_psana_cfg( ) # + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() command_seq = command.split() msg = 'Avereging xtc file(s) using command:\n%s' % command \ + '\nand save results in the log-file: %s' % fnm.path_peds_aver_batch_log() logger.info(msg, __name__) err = gu.subproc_in_log( command_seq, fnm.path_peds_aver_batch_log()) # , shell=True) if err != '': logger.warning( '\nWarning/error message from subprocess:\n%s' % (err), __name__) return False else: logger.info( 'Avereging for run %s is completed' % self.str_run_number, __name__) return True
def submit_batch_for_peds_aver(self): self.exportLocalPars() # export run_number to cp.str_run_number if not self.job_can_be_submitted(self.job_id_peds_str, self.time_peds_job_submitted, 'peds'): return self.time_peds_job_submitted = gu.get_time_sec() self.command_for_peds_scan() if not cfg.make_psana_cfg_file_for_peds_aver(): self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False if not self.is_good_lsf(): self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False #command = 'psana -c ' + fnm.path_peds_aver_psana_cfg() + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() command = 'psana -c ' + fnm.path_peds_aver_psana_cfg( ) + self.opt + ' ' + fnm.path_to_xtc_files_for_run( ) # fnm.path_dark_xtc_cond() queue = self.queue.value() bat_log_file = fnm.path_peds_aver_batch_log() self.job_id_peds_str, out, err = gu.batch_job_submit( command, queue, bat_log_file) self.procDarkStatus ^= 2 # set bit to 1 if err != 'Warning: job being submitted without an AFS token.': logger.warning( 'This job is running on LCLS NFS, it does not need in AFS, ignore warning and continue.', __name__) return True elif err != '': self.stop_auto_processing(is_stop_on_button_click=False) logger.warning( 'Autoprocessing for run %s is stopped due to batch submission error!!!' % self.str_run_number, __name__) logger.warning('BATCH JOB IS NOT SUBMITTED !!!', __name__) return False return True
def command_for_peds_aver(self) : if not cfg.make_psana_cfg_file_for_peds_aver() : logger.warning('INTERACTIVE JOB IS NOT STARTED !!!', __name__) return False command = 'psana -c ' + fnm.path_peds_aver_psana_cfg() # + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() command_seq = command.split() msg = 'Avereging xtc file(s) using command:\n%s' % command \ + '\nand save results in the log-file: %s' % fnm.path_peds_aver_batch_log() logger.info(msg, __name__) err = gu.subproc_in_log(command_seq, fnm.path_peds_aver_batch_log()) # , shell=True) if err != '' : logger.warning('\nWarning/error message from subprocess:\n%s' % (err), __name__) return False else : logger.info('Avereging for run %s is completed' % self.str_run_number, __name__) return True
def make_psana_cfg_file_for_peds_aver(self) : cfg.make_psana_cfg_file_for_peds_aver()
def make_psana_cfg_file_for_peds_aver(self): cfg.make_psana_cfg_file_for_peds_aver()