Skip to content

Commit 5c683f8

Browse files
authored
Merge pull request #92 from LSSTDESC/in2p3-update
Update site for in2p3 for their new SLURM launcher
2 parents 90e11f5 + 693647f commit 5c683f8

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

ceci/minirunner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import subprocess
1010
import time
1111
from timeit import default_timer
12+
import sys
1213

1314
# Constant indicators
1415
COMPLETE = 0
@@ -279,6 +280,7 @@ def _launch(self, job, alloc):
279280
EVENT_LAUNCH,
280281
{"job": job, "stdout": stdout_file, "process": p, "nodes": alloc},
281282
)
283+
sys.stdout.flush()
282284

283285
def _ready_jobs(self):
284286
# Find jobs ready to be run now
@@ -366,7 +368,7 @@ def _check_completed(self):
366368
completed_jobs.append(job)
367369
for node in alloc:
368370
node.free()
369-
371+
sys.stdout.flush()
370372
self.running = continuing_jobs
371373

372374
for job in completed_jobs:

ceci/sites/ccin2p3.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

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

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

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

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

84-
if last_node_codes:
85-
i = len(nodes)
86-
nodes.append(Node(f"Node_{i}", last_node_codes))
87-
8883
self.info["nodes"] = nodes
8984

9085
def configure_for_cwl(self):

0 commit comments

Comments
 (0)