コード例 #1
0
    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
コード例 #2
0
    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__)
コード例 #3
0
    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
コード例 #4
0
    def print_dark_ave_batch_log(self):
        path = fnm.path_peds_aver_batch_log()
        if not os.path.exists(path):
            msg = 'File: %s does not exist' % path
            self.log(msg, 2)
            return

        txt = self.sep + 'psana log file %s:\n\n' % path \
            + gu.load_textfile(path) \
            + 'End of psana log file %s' % path
        self.log(txt, 1)
コード例 #5
0
 def print_dark_ave_batch_log(self) :
     path = fnm.path_peds_aver_batch_log()
     if not os.path.exists(path) :
         msg = 'File: %s does not exist' % path
         self.log(msg,2)            
         return
     
     txt = self.sep + 'psana log file %s:\n\n' % path \
         + gu.load_textfile(path) \
         + 'End of psana log file %s' % path
     self.log(txt,1)
コード例 #6
0
    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
コード例 #7
0
    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
コード例 #8
0
    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.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
        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 is stopped due to batch submission error!!!', __name__)
コード例 #9
0
 def print_dark_ave_batch_log(self) :
     path = fnm.path_peds_aver_batch_log()
     txt = self.sep + 'psana log file %s:\n\n' % path \
         + gu.load_textfile(fnm.path_peds_aver_batch_log()) \
         + 'End of psana log file %s' % path
     self.log(txt,1)
コード例 #10
0
 def print_dark_ave_batch_log(self):
     path = fnm.path_peds_aver_batch_log()
     txt = self.sep + 'psana log file %s:\n\n' % path \
         + gu.load_textfile(fnm.path_peds_aver_batch_log()) \
         + 'End of psana log file %s' % path
     self.log(txt, 1)
コード例 #11
0
 def print_dark_ave_batch_log(self) :
     path = fnm.path_peds_aver_batch_log()
     txt = '\n' + 50*'-' + '\npsana log file %s:\n\n' % path \
         + gu.load_textfile(fnm.path_peds_aver_batch_log()) \
         + 'End of psana log file %s' % path
     print txt
コード例 #12
0
 def print_dark_ave_batch_log(self):
     path = fnm.path_peds_aver_batch_log()
     txt = '\n' + 50*'-' + '\npsana log file %s:\n\n' % path \
         + gu.load_textfile(fnm.path_peds_aver_batch_log()) \
         + 'End of psana log file %s' % path
     print txt