Skip to content

Commit

Permalink
More gricad Guix
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jul 19, 2024
1 parent 7b9a602 commit cf5a46f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
7 changes: 6 additions & 1 deletion doc/examples/clusters/gricad/ciment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ class DahuGuix(ClusterOARGuix):
"export OMPI_MCA_btl_openib_allow_ib=true",
"export OMPI_MCA_pml=cm",
"export OMPI_MCA_mtl=psm2",
'''MPI_PREFIX="`guix shell -m manifest.scm -f python-fluidsim.scm -- /bin/sh -c 'echo $GUIX_ENVIRONMENT'`"''',
]


class DahuGuixDevel(DahuGuix):
devel = True
frontends = ["dahu-oar3"]



class DahuGuix16_6130(DahuGuix):
nb_cores_per_node = 16
resource_conditions = "cpumodel='Gold 6130' and n_cores=16"
Expand Down
13 changes: 9 additions & 4 deletions doc/examples/clusters/gricad/dev_print_oar_script.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
from ciment import DahuGuix16_6130 as Cluster
from ciment import DahuGuixDevel as Cluster

cluster = Cluster()

# 2 full nodes
nb_nodes = 2
nb_cores_per_node = None
nb_mpi_processes = "auto"

# 2 cores on 1 node
nb_nodes = 1
nb_mpi_processes = 2

nb_cores_per_node = None

nb_cores_per_node, nb_mpi_processes = cluster._parse_cores_procs(
nb_nodes, nb_cores_per_node, nb_mpi_processes
)

txt = cluster._create_txt_launching_script(
command="--prefix $MPI_PREFIX fluidsim-bench 128 -d 3 -s ns3d -o .",
command="--prefix $GUIX_ENVIRONMENT \\\n fluidsim-bench 128 -d 3 -s ns3d -o .",
name_run="bench_fluidsim",
nb_nodes=nb_nodes,
nb_cores_per_node=nb_cores_per_node,
walltime="00:30:00",
nb_mpi_processes=nb_mpi_processes,
devel=True,
project="pr-strat-turb",
)
print(txt)
1 change: 1 addition & 0 deletions doc/examples/clusters/gricad/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"python-pythran"
; convenient to be able to check
"which"
"emacs"
)
)
10 changes: 7 additions & 3 deletions doc/examples/clusters/gricad/oar.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class ClusterOAR(Cluster):
name_cluster = ""
nb_cores_per_node = 12
has_to_add_name_cluster = False
devel = False

_doc_commands = """
Useful commands
Expand Down Expand Up @@ -166,7 +167,7 @@ def submit_command(
run_with_exec=True,
resource_conditions=None,
use_oar_envsh=None,
devel=False,
devel=None,
):
self.check_oar()

Expand Down Expand Up @@ -245,11 +246,14 @@ def _create_txt_launching_script(
run_with_exec=True,
resource_conditions=None,
use_oar_envsh=None,
devel=False,
devel=None,
project=None,
):
txt = f"#!/bin/bash\n\n#OAR -n {name_run}\n"

if devel is None:
devel = self.devel

if devel:
txt += "#OAR -t devel\n"

Expand Down Expand Up @@ -316,7 +320,7 @@ def _create_txt_launching_script(
if nb_mpi_processes is not None:
txt += f"mpirun -np {nb_mpi_processes} "

if nb_nodes > 1:
if nb_mpi_processes > 1:
txt += "-machinefile $OAR_NODEFILE "

txt += command + "\n"
Expand Down
11 changes: 4 additions & 7 deletions doc/examples/clusters/gricad/submit_bench_fluidsim.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from ciment import DahuGuix16_6130 as Cluster
from ciment import DahuGuixDevel as Cluster

cluster = Cluster()


cluster.submit_command(
command="--prefix $MPI_PREFIX fluidsim-bench 128 -d 3 -s ns3d -o .",
command="--prefix $GUIX_ENVIRONMENT \\\n fluidsim-bench 256 -d 3 -s ns3d -o .",
name_run="bench_fluidsim",
nb_nodes=2,
nb_mpi_processes="auto",
nb_nodes=1,
nb_mpi_processes=2,
walltime="00:30:00",
project="pr-strat-turb",
submit=False,
devel=True,
)

0 comments on commit cf5a46f

Please sign in to comment.