MCPcopy Create free account
hub / github.com/LBANN/lbann / __init__

Method __init__

python/lbann/launcher/pjm.py:19–80  ·  view source on GitHub ↗

Construct PJM script manager. Args: script_file (str): Script file. work_dir (str, optional): Working directory (default: current working directory). nodes (int, optional): Number of compute nodes (default: 1).

(self,
                 script_file=None,
                 work_dir=os.getcwd(),
                 nodes=1,
                 procs_per_node=1,
                 time_limit=None,
                 job_name=None,
                 partition=None,
                 launcher='mpiexec',
                 launcher_args=[],
                 interpreter='/bin/bash')

Source from the content-addressed store, hash-verified

17 """Utility class to write PJM scripts."""
18
19 def __init__(self,
20 script_file=None,
21 work_dir=os.getcwd(),
22 nodes=1,
23 procs_per_node=1,
24 time_limit=None,
25 job_name=None,
26 partition=None,
27 launcher='mpiexec',
28 launcher_args=[],
29 interpreter='/bin/bash'):
30 """Construct PJM script manager.
31
32 Args:
33 script_file (str): Script file.
34 work_dir (str, optional): Working directory
35 (default: current working directory).
36 nodes (int, optional): Number of compute nodes
37 (default: 1).
38 procs_per_node (int, optional): Parallel processes per
39 compute node (default: 1).
40 time_limit (int, optional): Job time limit, in minutes
41 (default: none).
42 job_name (str, optional): Job name (default: none).
43 partition (str, optional): Scheduler partition
44 (default: none).
45 launcher (str, optional): Parallel command launcher
46 (default: mpiexec).
47 launcher_args (`Iterable` of `str`, optional):
48 Command-line arguments to mpiexec.
49 interpreter (str, optional): Script interpreter
50 (default: /bin/bash).
51
52 """
53 super().__init__(script_file=script_file,
54 work_dir=work_dir,
55 interpreter=interpreter)
56 self.nodes = nodes
57 self.procs_per_node = procs_per_node
58 self.time_limit = time_limit
59 self.job_name = job_name
60 self.partition = partition
61 self.launcher = launcher
62 self.launcher_args = launcher_args
63
64 # Configure header with PJM job options
65 # Number of node
66 self.add_header_line(f'#PJM -L "node={self.nodes}"')
67
68 if self.time_limit is not None:
69 # Job run time limit value
70 self.add_header_line(f'#PJM -L "elapse={_time_string(self.time_limit)}"')
71 if self.job_name is not None:
72 self.add_header_line(f'#PJM --name {self.job_name}')
73 if self.partition is not None:
74 # Specify resource group
75 self.add_header_line(f'#PJM -L "rscgrp={self.partition}"')
76

Callers

nothing calls this directly

Calls 2

add_header_lineMethod · 0.80
_time_stringFunction · 0.70

Tested by

no test coverage detected