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

Method submit

python/lbann/launcher/pjm.py:132–165  ·  view source on GitHub ↗

Submit batch job. The script file is written before being submitted. Args: overwrite (bool): Whether to overwrite script file if it already exists (default: False). Returns: int: Exit status from script.

(self, overwrite=False)

Source from the content-addressed store, hash-verified

130 self.add_command(args)
131
132 def submit(self, overwrite=False):
133 """Submit batch job.
134
135 The script file is written before being submitted.
136
137 Args:
138 overwrite (bool): Whether to overwrite script file if it
139 already exists (default: False).
140
141 Returns:
142 int: Exit status from script.
143
144 """
145
146 # Construct script file
147 self.write(overwrite=overwrite)
148
149 # Submit batch script and pipe output to log files
150 run_proc = subprocess.Popen(['pjsub', self.script_file],
151 stdout=subprocess.PIPE,
152 stderr=subprocess.PIPE,
153 cwd=self.work_dir)
154 out_proc = subprocess.Popen(['tee', self.out_log_file],
155 stdin=run_proc.stdout,
156 cwd=self.work_dir)
157 err_proc = subprocess.Popen(['tee', self.err_log_file],
158 stdin=run_proc.stderr,
159 cwd=self.work_dir)
160 run_proc.stdout.close()
161 run_proc.stderr.close()
162 run_proc.wait()
163 out_proc.wait()
164 err_proc.wait()
165 return run_proc.returncode

Callers 5

runFunction · 0.45
runFunction · 0.45
main.pyFile · 0.45
randproj.pyFile · 0.45
main.pyFile · 0.45

Calls 2

writeMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected