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

Method run

python/lbann/launcher/batch_script.py:140–175  ·  view source on GitHub ↗

Execute the script. The script is executed directly and is _not_ submitted to a job scheduler. The script file is written before being executed. Args: overwrite (bool): Whether to overwrite script file if it already exists (default: false

(self, overwrite=False)

Source from the content-addressed store, hash-verified

138 os.chmod(self.script_file, 0o755)
139
140 def run(self, overwrite=False):
141 """Execute the script.
142
143 The script is executed directly and is _not_ submitted to a
144 job scheduler. The script file is written before being
145 executed.
146
147 Args:
148 overwrite (bool): Whether to overwrite script file if it
149 already exists (default: false).
150
151 Returns:
152 int: Exit status from executing script.
153
154 """
155
156 # Construct script file
157 self.write(overwrite=overwrite)
158
159 # Run script and pipe output to log files
160 run_proc = subprocess.Popen(self.script_file,
161 stdout=subprocess.PIPE,
162 stderr=subprocess.PIPE,
163 cwd=self.work_dir)
164 out_proc = subprocess.Popen(['tee', self.out_log_file],
165 stdin=run_proc.stdout,
166 cwd=self.work_dir)
167 err_proc = subprocess.Popen(['tee', self.err_log_file],
168 stdin=run_proc.stderr,
169 cwd=self.work_dir)
170 run_proc.stdout.close()
171 run_proc.stderr.close()
172 run_proc.wait()
173 out_proc.wait()
174 err_proc.wait()
175 return run_proc.returncode
176
177 def submit(self, overwrite=False):
178 """Submit batch job to job scheduler.

Callers 15

grid_searchFunction · 0.80
runFunction · 0.80
radial_profile.pyFile · 0.80
fftshift.pyFile · 0.80
evaluateFunction · 0.80
submitMethod · 0.80
runFunction · 0.80
funcFunction · 0.80
test_lenet_trainFunction · 0.80

Calls 2

writeMethod · 0.95
waitMethod · 0.45

Tested by 6

funcFunction · 0.64
test_lenet_trainFunction · 0.64
test_funcFunction · 0.64