From f5669bfab06b403f87b7cec6a156c3515944b21f Mon Sep 17 00:00:00 2001 From: Xunwu Zuo Date: Fri, 15 Dec 2023 15:51:25 +0100 Subject: [PATCH 1/2] Add CentOS7 option in FCCAnalysisRun so older version still runs. --- python/FCCAnalysisRun.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/FCCAnalysisRun.py b/python/FCCAnalysisRun.py index 9d42631079..36875a3028 100644 --- a/python/FCCAnalysisRun.py +++ b/python/FCCAnalysisRun.py @@ -301,6 +301,16 @@ def sendToBatch(rdfModule, chunkList, process, analysisFile): LOGGER.warning('I/O error(%i): %s', e.errno, e.strerror) time.sleep(10) frun_condor = open(frunfull_condor, 'w') + makeConfig = open(localDir+'/build/CMakeFiles/CMakeConfigureLog.yaml', 'r') + make_content = makeConfig.read() + sysVer_str = '' + if 'centos7' in make_content: + sysVer_str = '(OpSysAndVer =?= "CentOS7")' + if 'almalinux9' in make_content: + sysVer_str = '(OpSysAndVer =?= "AlmaLinux9")' + if sysVer_str == '': + LOGGER.warning('FCCAnalysis was compiled in an environment not available in lxplus HTcondor. Please check.' + 'Submitting jobs to default operating system. There may be compatibility issues.') subprocess.getstatusoutput('chmod 777 {}'.format(frunfull_condor)) frun_condor.write('executable = $(filename)\n') frun_condor.write('Log = {}/condor_job.{}.$(ClusterId).$(ProcId).log\n'.format(logDir,process)) @@ -308,7 +318,7 @@ def sendToBatch(rdfModule, chunkList, process, analysisFile): frun_condor.write('Error = {}/condor_job.{}.$(ClusterId).$(ProcId).error\n'.format(logDir,process)) frun_condor.write('getenv = False\n') frun_condor.write('environment = "LS_SUBCWD={}"\n'.format(logDir)) # not sure - frun_condor.write('requirements = ( (Machine =!= LastRemoteHost) && (TARGET.has_avx2 =?= True) )\n') + frun_condor.write('requirements = ({} && (Machine =!= LastRemoteHost) && (TARGET.has_avx2 =?= True) )\n'.format(sysVer_str)) frun_condor.write('on_exit_remove = (ExitBySignal == False) && (ExitCode == 0)\n') frun_condor.write('max_retries = 3\n') frun_condor.write('+JobFlavour = "{}"\n'.format(getElement(rdfModule, "batchQueue"))) From 17046e2c5f2bf7208d3711505d96958de7ddc460 Mon Sep 17 00:00:00 2001 From: Xunwu Zuo Date: Mon, 18 Dec 2023 16:31:46 +0100 Subject: [PATCH 2/2] In FCCAnalysisRun, add handling of missing CMakeConfigureLog.yaml --- python/FCCAnalysisRun.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/python/FCCAnalysisRun.py b/python/FCCAnalysisRun.py index 36875a3028..b1f7072497 100644 --- a/python/FCCAnalysisRun.py +++ b/python/FCCAnalysisRun.py @@ -301,13 +301,19 @@ def sendToBatch(rdfModule, chunkList, process, analysisFile): LOGGER.warning('I/O error(%i): %s', e.errno, e.strerror) time.sleep(10) frun_condor = open(frunfull_condor, 'w') - makeConfig = open(localDir+'/build/CMakeFiles/CMakeConfigureLog.yaml', 'r') - make_content = makeConfig.read() sysVer_str = '' - if 'centos7' in make_content: - sysVer_str = '(OpSysAndVer =?= "CentOS7")' - if 'almalinux9' in make_content: - sysVer_str = '(OpSysAndVer =?= "AlmaLinux9")' + try: + f_make = open(localDir+'/build/CMakeFiles/CMakeConfigureLog.yaml', 'r') + except IOError as e: + LOGGER.warning('I/O error(%i): %s', e.errno, e.strerror) + LOGGER.warning('File not found: ' + localDir+'/build/CMakeFiles/CMakeConfigureLog.yaml') + else: + with open(localDir+'/build/CMakeFiles/CMakeConfigureLog.yaml', 'r') as makeConfig: + make_content = makeConfig.read() + if 'centos7' in make_content: + sysVer_str = '(OpSysAndVer =?= "CentOS7")' + ' &&' + if 'almalinux9' in make_content: + sysVer_str = '(OpSysAndVer =?= "AlmaLinux9")' + ' &&' if sysVer_str == '': LOGGER.warning('FCCAnalysis was compiled in an environment not available in lxplus HTcondor. Please check.' 'Submitting jobs to default operating system. There may be compatibility issues.') @@ -318,7 +324,7 @@ def sendToBatch(rdfModule, chunkList, process, analysisFile): frun_condor.write('Error = {}/condor_job.{}.$(ClusterId).$(ProcId).error\n'.format(logDir,process)) frun_condor.write('getenv = False\n') frun_condor.write('environment = "LS_SUBCWD={}"\n'.format(logDir)) # not sure - frun_condor.write('requirements = ({} && (Machine =!= LastRemoteHost) && (TARGET.has_avx2 =?= True) )\n'.format(sysVer_str)) + frun_condor.write('requirements = ({} (Machine =!= LastRemoteHost) && (TARGET.has_avx2 =?= True) )\n'.format(sysVer_str)) frun_condor.write('on_exit_remove = (ExitBySignal == False) && (ExitCode == 0)\n') frun_condor.write('max_retries = 3\n') frun_condor.write('+JobFlavour = "{}"\n'.format(getElement(rdfModule, "batchQueue")))