diff --git a/cfg/clifton/oneApi.bashrc b/cfg/clifton/oneApi.bashrc index a3b39398ee7ab4a2a72182bd6a379ce039b77ce6..b87d57ad00fd18bb47079ec45e0c325bcc1d73ff 100644 --- a/cfg/clifton/oneApi.bashrc +++ b/cfg/clifton/oneApi.bashrc @@ -4,8 +4,12 @@ if [ -d /opt/intel ] ; then #. /opt/intel/oneapi/setvars.sh intel64 - . /opt/intel/oneapi/tbb/latest/env/vars.sh intel64 + # since last update of one api latest -> 2022.2.0 (not complete) + . /opt/intel/oneapi/tbb/latest/env/vars.sh intel64 . /opt/intel/oneapi/mkl/latest/env/vars.sh intel64 . /opt/intel/oneapi/compiler/latest/env/vars.sh intel64 + #. /opt/intel/oneapi/tbb/2021.6.0/env/vars.sh intel64 + #. /opt/intel/oneapi/mkl/2022.1.0/env/vars.sh intel64 + #. /opt/intel/oneapi/compiler/2022.1.0/env/vars.sh intel64 fi diff --git a/comp.py b/comp.py index ff8fa785fed14f85e6dfcbfc4b00565f27d0c987..fd0d728a9277ff5d1fa7250454ee5a8ba5e251d0 100755 --- a/comp.py +++ b/comp.py @@ -83,7 +83,7 @@ class CompJob(ParametricJob): TextPRM(self.pars, 'PYTHONEXE', 'Python executable', sys.executable) - TextPRM(self.pars, 'NICE_VALUE', 'nice value', "0") + TextPRM(self.pars, 'PRIORITY', 'priority [1-5]', "3") TextPRM(self.pars, 'NB_TASKS', 'nb of tasks launched in parallel', "1") TextPRM(self.pars, 'NB_THREADS', 'nb of threads by task', "1") @@ -91,6 +91,8 @@ class CompJob(ParametricJob): TextPRM(self.pars, 'GIT_DEPTH', 'git clone depth', '10') TextPRM(self.pars, 'GIT_BRANCH', 'git branch name', 'master') + MultiPRM(self.pars, 'BATTERY_ARG', 'battery argument', ["", "--fpe", "--withWER", "--keep"], "") + MultiPRM(self.pars, 'RUNMETHOD', 'Run Method', ["interactive", "at", "batch"], "batch") TextPRM(self.pars, 'AT_TIME' , 'Delay for at launch (no syntax check, use with care)', "now") @@ -108,10 +110,12 @@ class CompJob(ParametricJob): PRMAction(self.actions, 'g', self.pars['GIT_DEPTH']) PRMAction(self.actions, 'h', self.pars['GIT_BRANCH']) - PRMAction(self.actions, 'i', self.pars['NICE_VALUE']) + PRMAction(self.actions, 'i', self.pars['PRIORITY']) PRMAction(self.actions, 'j', self.pars['NB_TASKS']) PRMAction(self.actions, 'k', self.pars['NB_THREADS']) + PRMAction(self.actions, 'l', self.pars['BATTERY_ARG']) + PRMAction(self.actions, 'm', self.pars['RUNMETHOD']) # AT paramters PRMAction(self.actions, 'n', self.pars['AT_TIME']) @@ -132,11 +136,13 @@ class CompJob(ParametricJob): self.pars['NB_THREADS'].enable(self.pars['COMPILE'].val==True or self.pars['BATTERY'].val!=False) self.pars['CMAKELIST'].enable(self.pars['COMPILE'].val==True) self.pars['DEBUG_MODE'].enable(self.pars['COMPILE'].val==True) - self.pars['NICE_VALUE'].enable(self.pars['BATTERY'].val!=False and self.pars['RUNMETHOD'].val!='sge') + self.pars['PRIORITY'].enable(self.pars['BATTERY'].val!=False and self.pars['RUNMETHOD'].val!='sge') self.pars['GIT_DEPTH'].enable(self.pars['UNZIP'].val=="checkout" and not self.pars['GIT_FULLCLONE'].val) self.pars['GIT_BRANCH'].enable(self.pars['UNZIP'].val=="checkout") # Batch self.pars['AT_TIME'].enable(self.pars['RUNMETHOD'].val=='at') + # battery arg + self.pars['BATTERY_ARG'].enable(self.pars['BATTERY']!=False) def touchFiles(self): for repo in self.repos: @@ -256,9 +262,16 @@ class CompJob(ParametricJob): now = datetime.datetime.now() print("starting battery at %s (come back tomorrow)" % now.ctime()) os.chdir('oo_metaB/bin') - cmd="nice -%s %s battery.py run -j %s -k %s >battery.log 2>&1" % \ - (self.pars['NICE_VALUE'].val, self.pars['PYTHONEXE'].val, \ - self.pars['NB_TASKS'].val, self.pars['NB_THREADS'].val) + #cmd="nice -%s %s battery.py %s -j %s -k %s >battery.log 2>&1" % \ + # (self.pars['NICE_VALUE'].val, self.pars['PYTHONEXE'].val, \ + # self.pars['BATTERY_ARG'].val,\ + # self.pars['NB_TASKS'].val, self.pars['NB_THREADS'].val) + cmd="%s battery.py %s -p %s -j %s -k %s >battery.log 2>&1" % \ + (self.pars['PYTHONEXE'].val,\ + self.pars['BATTERY_ARG'].val,\ + self.pars['PRIORITY'].val,\ + self.pars['NB_TASKS'].val,\ + self.pars['NB_THREADS'].val) p = subprocess.Popen(cmd, shell=True) p.wait() # finish script diff --git a/launch.py b/launch.py index b73e5aa02193a4289e0cfe1d9ea7835fd6ed2917..71aa7529cceade66f49951d65badaabb696e83cf 100755 --- a/launch.py +++ b/launch.py @@ -47,7 +47,7 @@ class LaunchJob(ParametricJob): TextPRM(self.pars, 'RESTART_STEP', 'restart step', "-1") - TextPRM(self.pars, 'NICE_VALUE', 'nice value', "0") + TextPRM(self.pars, 'PRIORITY', 'priority [1-5]', "3") TextPRM(self.pars, 'AFFINITY', 'affinity (cores list)', "") TextPRM(self.pars, 'NB_TASKS', 'nb of task launched in parallel', "1") TextPRM(self.pars, 'NB_THREADS', 'nb of threads by task', "1") @@ -88,7 +88,7 @@ class LaunchJob(ParametricJob): PRMAction(self.actions, 'g', self.pars['RESTART_STEP']) PRMAction(self.actions, 'h', self.pars['MULTITEST']) - PRMAction(self.actions, 'i', self.pars['NICE_VALUE']) + PRMAction(self.actions, 'i', self.pars['PRIORITY']) PRMAction(self.actions, 'j', self.pars['AFFINITY']) PRMAction(self.actions, 'k', self.pars['NB_TASKS']) PRMAction(self.actions, 'l', self.pars['NB_THREADS']) @@ -155,8 +155,8 @@ class LaunchJob(ParametricJob): self.pars['FTP_PASS'].enable(self.pars['ENABLE_FTP'].val==True) self.pars['FTP_DIR'].enable(self.pars['ENABLE_FTP'].val==True) - self.pars['NICE_VALUE'].enable(self.pars['RUNMETHOD'].val!='sge' and - self.pars['RUNMETHOD'].val!='slurm') + self.pars['PRIORITY'].enable(self.pars['RUNMETHOD'].val!='sge' and + self.pars['RUNMETHOD'].val!='slurm') self.pars['AFFINITY'].enable(self.pars['RUNMETHOD'].val!='sge' and self.pars['RUNMETHOD'].val!='slurm' and @@ -184,7 +184,6 @@ class LaunchJob(ParametricJob): self.pars['MODEL'].enable(self.pars['RUNMETHOD'].val=='pbs') # cpu model (to choose subqueue) self.pars['PROJECT'].enable(self.pars['RUNMETHOD'].val=='pbs') # project (group access & facturation) - def getJobName(self): if (self.pars['MULTITEST'].val==False): jobname=os.path.basename(os.getcwd())+"."+self.pars['TEST_NAME'].val @@ -283,14 +282,15 @@ class LaunchJob(ParametricJob): fNames = [] if self.pars['RUNMETHOD'].val == 'sge': fNames.append(self.qDelScriptName(self.jobId)) - fNames.append(self.cfgfile) + #fNames.append(self.cfgfile) elif self.pars['RUNMETHOD'].val == 'slurm': fNames.append(self.sCancelScriptName(self.jobId)) - fNames.append(self.cfgfile) + #fNames.append(self.cfgfile) elif self.pars['RUNMETHOD'].val == 'at' or self.pars['RUNMETHOD'].val == 'batch': fNames.append("kill%s.py"%self.jobId) fNames.append("atrm%s.py"%self.jobId) - fNames.append(self.cfgfile) + fNames.append("runbatch%s.sh"%self.jobId) + #fNames.append(self.cfgfile) else: fNames.append("kill%s.py"%self.jobId) for fil in fNames: @@ -381,8 +381,7 @@ class LaunchJob(ParametricJob): if self.pars['RUNMETHOD'].val != 'sge' and self.pars['RUNMETHOD'].val != 'slurm': if self.pars['AFFINITY'].val != '': pin.write(('battery.setAffinity("%s")\n'%self.pars['AFFINITY'].val).encode('utf-8')) - if self.pars['NICE_VALUE'].val != '0': - pin.write(('battery.setNice(%s)\n'%self.pars['NICE_VALUE'].val).encode('utf-8')) + pin.write(('battery.setPriority(%s)\n'%self.pars['PRIORITY'].val).encode('utf-8')) pin.write(('battery.setNumTasks(%s)\n'%self.pars['NB_TASKS'].val).encode('utf-8')) pin.write(('battery.setNumThreads(%s)\n'%self.pars['NB_THREADS'].val).encode('utf-8')) diff --git a/launchGui.pyw b/launchGui.pyw index 2af43e93caee3420fe64323adc927ec53d5c8ce0..4c57d566dae71be25d6761b7e2af3da83015c005 100755 --- a/launchGui.pyw +++ b/launchGui.pyw @@ -135,7 +135,7 @@ class LaunchGui(QWidget): nbProcs = multiprocessing.cpu_count() self.sf['NB_TASKS'] = TextLine(self, grplay2, self.launch.pars['NB_TASKS'], 0, 0, 1, QIntValidator(1,nbProcs)) self.sf['NB_THREADS'] = TextLine(self, grplay2, self.launch.pars['NB_THREADS'], 0, 3, 1, QIntValidator(1,nbProcs)) - self.sf['NICE_VALUE'] = TextLine(self, grplay2, self.launch.pars['NICE_VALUE'], 1, 0, 1, QIntValidator(1,19)) + self.sf['PRIORITY'] = TextLine(self, grplay2, self.launch.pars['PRIORITY'], 1, 0, 1) #, QIntValidator(1,5)) self.sf['AFFINITY'] = TextLine(self, grplay2, self.launch.pars['AFFINITY'], 1, 3, 1) self.sf['RUNMETHOD'] = MultiPMRLine(self, grplay2, self.launch.pars['RUNMETHOD'],2,0) @@ -260,12 +260,7 @@ class LaunchGui(QWidget): mtfdir, mtfexe = os.path.split(self.launch.pars['EXEC_NAME'].val) ldlp = mtfdir+':'+env.value('LD_LIBRARY_PATH','') env.insert('LD_LIBRARY_PATH',ldlp) - self.process.setProcessEnvironment(env) - # gestion du nice sur le QProcess : pas arrive a faire marcher !!! - #self.process.setPriority (self.launch.pars['NICE_VALUE'].val) - #pid = self.process.pid() - #print "QProcess pid : ",self.process.pid() # self.process.readyReadStandardOutput.connect(self.readStdOutput) # launch.go() ... @@ -273,7 +268,6 @@ class LaunchGui(QWidget): except Exception as e: QMessageBox.information(self, 'Error', str(e)) - # re enable the gui modifications self.guiEnable(True) diff --git a/parametricJob.py b/parametricJob.py index b32cd617355d6e081d4032015f21b7dedd909d7a..9568a1686eb4d578bcd15d95ed54eeee9a9be9e5 100644 --- a/parametricJob.py +++ b/parametricJob.py @@ -326,24 +326,24 @@ class ParametricJob(PRMSet): if m: #cfgFileName, cfgFileExtension = os.path.splitext(self.cfgfile) #os.system("cp %s %s%s%s"%(self.cfgfile, cfgFileName, batchId, cfgFileExtension)) - self.atrmScript(batchId) + self.atrmScript(batchId, launchId) print("\tuse 'atq' and find job number %s to check the status of your job" % batchId) print("\t\t - 'a' means waiting in the queue 'a'") print("\t\t - '=' means running") print("\tuse 'atrm %s to kill the job" % batchId) - print("\t\t or 'atrm%s.py' to kill the job" % batchId) + print("\t\t or 'atrm%s.py' to kill the job" % launchId) # to avoid closing the gui if not (re.match(r'(.+)Gui.pyw', sys.argv[0])): sys.exit() - def atrmScript(self, pid): - filename = "atrm%s.py"%pid + def atrmScript(self, batchId, launchId): + filename = "atrm%s.py"%launchId file=open(filename,"w") file.write("#!/usr/bin/env python3\n") file.write("import os\n") - file.write("os.system('atrm %s')\n" % pid) - file.write("if os.path.isfile('kill%s.py'):\n" % pid) - file.write("\texecfile('kill%s.py')\n" % pid) + file.write("os.system('atrm %s')\n" % batchId) + file.write("if os.path.isfile('kill%s.py'):\n" % launchId) + file.write("\texecfile('kill%s.py')\n" % launchId) file.close() os.chmod(filename,0o700)