Skip to content

Commit

Permalink
Merge pull request #92 from LSSTDESC/in2p3-update
Browse files Browse the repository at this point in the history
Update site for in2p3 for their new SLURM launcher
  • Loading branch information
joezuntz authored Aug 2, 2023
2 parents 90e11f5 + 693647f commit 5c683f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 3 additions & 1 deletion ceci/minirunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import subprocess
import time
from timeit import default_timer
import sys

# Constant indicators
COMPLETE = 0
Expand Down Expand Up @@ -279,6 +280,7 @@ def _launch(self, job, alloc):
EVENT_LAUNCH,
{"job": job, "stdout": stdout_file, "process": p, "nodes": alloc},
)
sys.stdout.flush()

def _ready_jobs(self):
# Find jobs ready to be run now
Expand Down Expand Up @@ -366,7 +368,7 @@ def _check_completed(self):
completed_jobs.append(job)
for node in alloc:
node.free()

sys.stdout.flush()
self.running = continuing_jobs

for job in completed_jobs:
Expand Down
11 changes: 3 additions & 8 deletions ceci/sites/ccin2p3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class CCParallel(Site):
"""Object representing execution in the local environment, e.g. a laptop."""
default_mpi_command = "mpirun -n"

def command(self, cmd, sec):
"""Generate a complete command line to be run with the specified execution variables.
Expand Down Expand Up @@ -74,17 +75,11 @@ def configure_for_parsl(self): # pylint: disable=no-self-use

def configure_for_mini(self):
"""Utility function to setup self for local execution"""
total_cores = int(os.environ["NSLOTS"])
cores_per_node = 16 # seems to be the case
nodes = total_cores // cores_per_node
last_node_codes = total_cores % cores_per_node
nodes = int(os.environ.get("SLURM_JOB_NUM_NODES", "1"))
cores_per_node = int(os.environ.get("SLURM_CPUS_ON_NODE", "1"))

nodes = [Node(f"Node_{i}", cores_per_node) for i in range(nodes)]

if last_node_codes:
i = len(nodes)
nodes.append(Node(f"Node_{i}", last_node_codes))

self.info["nodes"] = nodes

def configure_for_cwl(self):
Expand Down

0 comments on commit 5c683f8

Please sign in to comment.