]> SALOME platform Git repositories - tools/ydefx.git/commitdiff
Salome HOME
[bos #35138][EDF] (2023-T1) Specialization of resources in KERNEL. JobParameters... kleontev/35138_specialization_resources_in_KERNEL 4/head
authorKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Fri, 11 Aug 2023 10:44:41 +0000 (11:44 +0100)
committerKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Fri, 11 Aug 2023 10:44:41 +0000 (11:44 +0100)
12 files changed:
src/pydefx/parameters.py
src/pydefx/salome_proxy.py
src/pydefx/slurmstudy.py
src/pyexample/exemple_fr.py
src/pyexample/multijob/launch.py
src/pyexample/multijob/launch_local_basic.py
src/pyexample/multijob/launch_local_jobs.py
src/pyexample/multijob/launch_multi.py
src/pyexample/multijob/launch_slurm_light.py
src/pyexample/multijob/launch_srun.py
src/pyexample/syrthes_launch.py
src/pytools/mpmcn.py

index e2734bc4dbec36b187d79844ca4ce2901244e582..870bac9974d0e1cb632ad448ebd2e9ec475f5d0a 100644 (file)
@@ -20,6 +20,7 @@
 import tempfile
 from . import salome_proxy
 from . import configuration
+import copy
 
 class Parameters:
   def __init__(self, resource="localhost",
@@ -33,12 +34,11 @@ class Parameters:
       job_params.work_directory = configuration.defaultWorkingDir(resource)
       if nb_branches is None:
         nb_branches = configuration.defaultNbBranches(resource)
-      job_params.resource_required.nb_proc = nb_branches
       self.nb_branches = nb_branches
       self.salome_parameters = job_params
     else:
       if nb_branches is None:
-        nb_branches = salome_parameters.resource_required.nb_proc
+        nb_branches = 1
       self.nb_branches = nb_branches
       self.salome_parameters = salome_parameters
 
@@ -47,7 +47,6 @@ class Parameters:
     self.salome_parameters.work_directory = configuration.defaultWorkingDir(
                                                                        resource)
     nb_branches = configuration.defaultNbBranches(resource)
-    self.salome_parameters.resource_required.nb_proc = nb_branches
     self.nb_branches = nb_branches
     self.salome_parameters.wckey = configuration.defaultWckey(resource)
 
@@ -84,14 +83,7 @@ class Parameters:
     newobj.salome_parameters.wckey = self.salome_parameters.wckey
     newobj.salome_parameters.extra_params = self.salome_parameters.extra_params
     #newobj.salome_parameters.specific_parameters = self.salome_parameters.specific_parameters
-    newobj.salome_parameters.resource_required.name = self.salome_parameters.resource_required.name
-    newobj.salome_parameters.resource_required.hostname = self.salome_parameters.resource_required.hostname
-    newobj.salome_parameters.resource_required.OS = self.salome_parameters.resource_required.OS
-    newobj.salome_parameters.resource_required.nb_proc = self.salome_parameters.resource_required.nb_proc
-    newobj.salome_parameters.resource_required.mem_mb = self.salome_parameters.resource_required.mem_mb
-    newobj.salome_parameters.resource_required.cpu_clock = self.salome_parameters.resource_required.cpu_clock
-    newobj.salome_parameters.resource_required.nb_node = self.salome_parameters.resource_required.nb_node
-    newobj.salome_parameters.resource_required.nb_proc_per_node = self.salome_parameters.resource_required.nb_proc_per_node
+    newobj.salome_parameters.resource_required = copy.deepcopy(self.salome_parameters.resource_required)
 
     return newobj
 
@@ -122,12 +114,6 @@ class Parameters:
           "resource_required" : {
               "name" : self.salome_parameters.resource_required.name,
               "hostname" : self.salome_parameters.resource_required.hostname,
-              "OS" : self.salome_parameters.resource_required.OS,
-              "nb_proc" : self.salome_parameters.resource_required.nb_proc,
-              "mem_mb" : self.salome_parameters.resource_required.mem_mb,
-              "cpu_clock" : self.salome_parameters.resource_required.cpu_clock,
-              "nb_node" : self.salome_parameters.resource_required.nb_node,
-              "nb_proc_per_node" : self.salome_parameters.resource_required.nb_proc_per_node
           }
       }
     }
@@ -155,9 +141,3 @@ class Parameters:
     self.salome_parameters.extra_params = dico["salome_parameters"]["extra_params"]
     self.salome_parameters.resource_required.name = dico["salome_parameters"]["resource_required"]["name"]
     self.salome_parameters.resource_required.hostname = dico["salome_parameters"]["resource_required"]["hostname"]
-    self.salome_parameters.resource_required.OS = dico["salome_parameters"]["resource_required"]["OS"]
-    self.salome_parameters.resource_required.nb_proc = dico["salome_parameters"]["resource_required"]["nb_proc"]
-    self.salome_parameters.resource_required.mem_mb = dico["salome_parameters"]["resource_required"]["mem_mb"]
-    self.salome_parameters.resource_required.cpu_clock = dico["salome_parameters"]["resource_required"]["cpu_clock"]
-    self.salome_parameters.resource_required.nb_node = dico["salome_parameters"]["resource_required"]["nb_node"]
-    self.salome_parameters.resource_required.nb_proc_per_node = dico["salome_parameters"]["resource_required"]["nb_proc_per_node"]
index dca0e4185a5a94536f3aa60ce21f385abb3f7956..1e55e5d711cefeff97c0f90e3229766b3bbc2929 100644 (file)
@@ -27,7 +27,7 @@ def createSalomeParameters():
   _default()
   if _use_salome_servers:
     result = salome.JobParameters()
-    result.resource_required = salome.ResourceParametersContainer()
+    result.resource_required = salome.ResourceParametersJob()
   else:
     result = pylauncher.JobParameters_cpp()
   return result
index 5554e2a862864809d63488694f505064419c99f4..c296f2ecdfb274a1389fc34cf69c255fda89b4da 100644 (file)
@@ -55,8 +55,6 @@ class SlurmStudy(pystudy.PyStudy):
     dicconfig["studymodule"] = "idefixstudy"
     dicconfig["sampleIterator"] = self.sampleManager.getModuleName()
     dicconfig["plugin"] = self.schemaBuilder.getPluginName()
-    nbproc = self.params.salome_parameters.resource_required.nb_proc
-    dicconfig["tasksPerEval"] = nbproc // self.params.nb_branches
     configpath = configuration.exportConfig(dicconfig, result_directory)
     studypath = os.path.join(result_directory, "idefixstudy.py")
     with open(studypath, "w") as f:
index 0319129bb5b79c0bb747b07154d02777c253ee18..6d7bbad754232d2adfa91f9db46704b46352aa66 100644 (file)
@@ -39,10 +39,6 @@ myParams.salome_parameters.in_files = []
 
 print("ressource de calcul:", myParams.salome_parameters.resource_required.name)
 print("nombre d'évaluations parallèles:", myParams.nb_branches)
-print("nombre de coeurs demandés:",
-      myParams.salome_parameters.resource_required.nb_proc)
-print("nombre de noeuds demandés:",
-      myParams.salome_parameters.resource_required.nb_node)
 print("répertoire de travail:", myParams.salome_parameters.work_directory)
 print("répertoire local de gestion:",
       myParams.salome_parameters.result_directory)
index f90755fb28977bb8f99979babf0daa13ced306b2..3414d5d7142a76a557efc56ad3a24778133ee761 100755 (executable)
@@ -5,7 +5,6 @@ myParams = pydefx.Parameters()
 myParams.configureResource("eole")
 #myParams.createResultDirectory("/tmp")
 myParams.nb_branches = 4
-myParams.salome_parameters.resource_required.nb_proc = 4
 myParams.salome_parameters.result_directory=os.path.join(os.getcwd(),"rundir")
 myParams.salome_parameters.work_directory="/scratch/I35256/workingdir/testjob/"
 myParams.salome_parameters.local_directory = os.getcwd()
index 282006b89923af35b2c9620299d1f744e96f78f0..3fd725369563d09cf17435abe602d82bf44096a3 100755 (executable)
@@ -4,7 +4,6 @@ import os
 myParams = pydefx.Parameters()
 myParams.configureResource("localhost")
 myParams.nb_branches = 4
-myParams.salome_parameters.resource_required.nb_proc = 1
 myParams.salome_parameters.work_directory=os.path.join(os.getcwd(),"runbasic")
 myParams.salome_parameters.local_directory = os.getcwd()
 
index 401789219ff0e2d6776e4523bb754ee7619b90be..582ac748e5c9bcb45db50428ad475219ca9345a8 100755 (executable)
@@ -5,7 +5,6 @@ myParams = pydefx.Parameters()
 myParams.nb_branches = 4
 myParams.salome_parameters.work_directory=os.path.join(os.getcwd(),"runbasic")
 myParams.salome_parameters.local_directory = os.getcwd()
-myParams.salome_parameters.resource_required.nb_proc = 1
 myParams.salome_parameters.job_name = "basic_job"
 myParams.salome_parameters.job_type = "command"
 myParams.salome_parameters.job_file = os.path.join(os.getcwd(), "simple_command.sh")
index 95fdc64037f6bf01e8092557e759e452d1903e03..ce9434e54acfa285e705113485da5c7bea18abdb 100755 (executable)
@@ -5,7 +5,6 @@ myParams = pydefx.Parameters()
 myParams.configureResource("gaia")
 #myParams.createResultDirectory("/tmp")
 myParams.nb_branches = 4
-myParams.salome_parameters.resource_required.nb_proc = 1
 myParams.salome_parameters.result_directory=os.path.join(os.getcwd(),"runmulti")
 myParams.salome_parameters.work_directory="/scratch/I35256/workingdir/test_multijob/"
 myParams.salome_parameters.local_directory = os.getcwd()
index d8a42b622c3e7f6f4b67f406c48f70d9879e217e..bf3b770f6e8dc886749e815d9de12868e063c66d 100755 (executable)
@@ -11,7 +11,6 @@ import os
 myParams = pydefx.Parameters()
 myParams.configureResource("gaia")
 myParams.nb_branches = 4
-myParams.salome_parameters.resource_required.nb_proc = 4
 myParams.salome_parameters.result_directory=os.path.join(os.getcwd(),"lightsrun")
 myParams.salome_parameters.work_directory="/scratch/I35256/workingdir/test_srunjob/"
 myParams.salome_parameters.local_directory = os.getcwd()
index b47e2f3ea234ca3b7ee88ff97797e5e8301c83a3..4f83ad1b4477ea7219b0657e3cdc83f98f843862 100755 (executable)
@@ -5,7 +5,6 @@ myParams = pydefx.Parameters()
 myParams.configureResource("eole")
 #myParams.createResultDirectory("/tmp")
 myParams.nb_branches = 4
-myParams.salome_parameters.resource_required.nb_proc = 4
 myParams.salome_parameters.result_directory=os.path.join(os.getcwd(),"runsrun")
 myParams.salome_parameters.work_directory="/scratch/I35256/workingdir/test_srunjob/"
 myParams.salome_parameters.local_directory = os.getcwd()
index 9158eadcf6e7cc8e1d13f84dedbb849ba21656fa..e8e74eaddd438223b2d45359e948856b1cd7bd0b 100755 (executable)
@@ -23,7 +23,6 @@ myParams.salome_parameters.work_directory = wd
 myParams.salome_parameters.local_directory = STUDY_DIR
 myParams.salome_parameters.in_files = ["brique_ech.syd", "Makefile", "Mesh",
                                        "run.sh", "syrthes.py", "user_cond.c"]
-#myParams.salome_parameters.resource_required.nb_node = 2
 myScript = pydefix.PyScript()
 myScript.loadFile(os.path.join(STUDY_DIR, "etude.py"))
 
index ccfea226765a0f90f3e83d7db666f605c0b9a548..d854e8f84c2805dbe551dece6982c86de4f86738 100644 (file)
@@ -130,12 +130,6 @@ def init(resourceName, resultDirectory = "/tmp"):
     Override default # of parallel evaluation :
     myParams.nb_branches
 
-    Override number of cores requested by the job when job resource is a cluster (for job scheduler query) :
-    myParams.salome_parameters.resource_required.nb_proc
-
-    Override number of computationnal nodes on cluster to be allocated when job resource is a cluster (for job scheduler query) :
-    myParams.salome_parameters.resource_required.nb_node
-
     Override working directory :
     myParams.salome_parameters.work_directory