Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update site for in2p3 for their new SLURM launcher #92

Merged
merged 6 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading