-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathsubmit_variations.shtml
425 lines (382 loc) · 10.8 KB
/
submit_variations.shtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
---
layout: default
title: HTCondor Submit File Variations
---
<br>
<b>The examples and information in this guide work best for the below cases*:</b>
<ol>
<li>Submission to an HTCondor System with file transfer (rather than a shared filesystem).</li>
<li>Submission to an HTCondor System that is unix-based (Linux or Mac operating system, as Windows may have important differences).</li>
</ol>
<small>(*see the HTCondor software manual and online examples from other organizations for cases outside of those we cover on the CHTC website)</small>
<br>
<br>
<b>To best understand the below information, users should already have an understanding of:</b>
<ol>
<li>Using the command line to: navigate within directories, create/copy/move/delete files and directories, and run their intended programs (aka "executables").</li>
<!-- coming soon <li>The CHTC’s Roadmap for High Throughput Computing</li> -->
<li><a href="{{'/helloworld' | relative_url }}">The CHTC's Intro to Running HTCondor Jobs</a></li>
<li>The importance of indicating the below submit file lines, which are left
out of the below examples for simplicity:
<pre>
universe = vanilla # or other
request_memory = <MB>
request_disk = <KB>
request_cpus = <positive integer>
should_transfer_files = YES
when_to_transfer_output = ON_EXIT # or other
</ol>
<h2>Click on the links below to go directly to the appropriate example</h2>
<ol>
<li><b><a href="#int-files">Organizing many jobs with integer-numbered filenames</a></b></li>
<li><b><a href="#int-dir">Organizing job files within integer-numbered directories</a></b></li>
<ul>
<li><a href="#int-dir-process">Numbered directories using $(Process)</a></li>
<li><a href="#int-dir-initialdir">Numbered directories using $(Process) as the InitialDir</a></li>
</ul>
<li><b><a href="#own-variables">Using your own non-HTCondor variables in the submit file</a></b></li>
<li><b><a href="#notint">Jobs with un-numbered data</a></b></li>
<ul>
<li><a href="#notint-files">Using a different, non-numbered input file for each job</a></li>
<li><a href="#notint-dir">Using a different, non-numbered directory for each job</a></li>
</ul>
</ol>
<!-- Submitting Many Jobs with a Single Submit File -->
<br>
<a name="int-files"></a>
<h1> 1. Organizing many jobs with integer-numbered filenames: </h1>
<p>This example is most similar to our
<a href="{{'/helloworld' | relative_url }}">Intro to Running HTCondor
Jobs</a> and uses HTCondor's $(Process) variable to indicate
filename differences for each job. For "queue <i>N</i>" in the submit file,
the $(Process) variable will start with
"0" and end with <i>N</i>-1, such that you can use $(Process) to indicate
filenames and filepaths. </p>
<b>Submit file:</b>
<pre>
executable = my.exec
arguments = $(Process).data comparison.data $(Process).out
output = $(Process).out
error = $(Process).err
log = $(Process).log
transfer_input_files = $(Process).data,comparison.data
queue 3
</pre>
<!-- this "directory" class for these tables is at the end of web.css-->
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0.data
1.data
2.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0.data 0.out 0.err 0.log
1.data 1.out 1.err 1.log
2.data 2.out 2.err 2.log
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
0.data
comparison.data
(other HTCondor tracking files)
</pre>
<br>
<a name="int-dir"></a>
<h1>2. Organizing job files within integer-numbered sub-directories</h1>
<a name="int-dir-process"></a>
<h2>A. Numbered directories using $(Process)</h2>
<p>The below example uses $(Process) to organize input, error, output,
and log files into numbered directories. Note that other files produced
within the job will still return to the submission directory.</p>
<b>Submit file:</b>
<pre>
executable = my.exec
arguments = input.data comparison.data $(Process).out
output = $(Process)/job.out
error = $(Process)/job.err
log = $(Process)/job.log
transfer_input_files = $(Process)/input.data,comparison.data
queue 3
</pre>
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0/ input.data
1/ input.data
2/ input.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0.out 1.out 2.out
0/ input.data job.out
job.err job.log
1/ input.data job.out
job.err job.log
2/ input.data job.out
job.err job.log
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
input.data
comparison.data
(other HTCondor tracking files)
</pre>
<a name="int-dir-initialdir"></a>
<h2>B. Numbered directories using $(Process) as the InitialDir</h2>
<p>Most users prefer using "IntitialDir" to organize all job data, including
files created within the job, as opposed to the previous method. Below,
HTCondor's "InitialDir"
variable is used to set the initial directory of <i>each</i> job, establishing
the location for log/output/error, as well as input files needed by the job and
any files produced by the job.<br>
<b>NOTE that HTCondor still expects the executable to exist relative to
submission directory.</b></p>
<b>Submit file:</b>
<pre>
InitialDir = $(Process)
executable = my.exec
arguments = input.data comparison.data my.out
output = job.out
error = job.err
log = job.log
transfer_input_files = input.data,../comparison.data
queue 3
</pre>
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0/ input.data
1/ input.data
2/ input.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
0/ input.data job.out my.out
job.err job.log
1/ input.data job.out my.out
job.err job.log
2/ input.data job.out my.out
job.err job.log
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
input.data
comparison.data
(other HTCondor tracking files)
</pre>
<br>
<a name="own-variables"></a>
<h1>3. Using your own non-HTCondor variables in the submit file </h1>
<p>You can define your own variable(s), named as you like, for use
throughout the submit file. Just make sure to not use a built-in
variable that is already used by HTCondor ("output" for example).</p>
<b>Submit file:</b>
<pre>
# My variables:
myvar = compare-states
sharedfile = comparison.data
#
executable = $(myvar).exec
arguments = $(Process).data $(sharedfile) $(myvar).out
output = $(Process).out
error = $(Process).err
log = $(Process).log
transfer_input_files = $(Process).data,$(sharedfile)
queue 3
</pre>
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
compare-states.exec
comparison.data
0.data
1.data
2.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
compare-states.exec
comparison.data
0.data 0.out 0.err 0.log
1.data 1.out 1.err 1.log
2.data 2.out 2.err 2.log
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
0.data
comparison.data
(other HTCondor tracking files)
</pre>
<br>
<a name="notint"></a>
<h1>4. Jobs with non-numbered data</h1>
<p>Rather than creating multiple submit files for individual jobs
or having to number your files, it is possible to write a single
submit file that uses different non-numbered files by adding
multiple "queue" statements.
<p>Essentially, the submit file establishes a set of
overall submit file lines, but in combination with a set of
submit file lines that are redefined with each instance of
"queue <i>N</i>".
</p>
<a name="notint-files"></a>
<h2>Using a different, non-numbered input file for each job </h2>
<p>A. Using the ideas from the previous example with non-HTCondor
submit file variables, you can redefine
your own non-HTCondor variable for each instance of "queue":</p>
<b>Submit file:</b>
<pre>
executable = my.exec
arguments = $(state).data comparison.data my_$(state).out
output = $(state).out
error = $(state).err
log = $(state).log
transfer_input_files = $(state).data,comparison.data
state = iowa
queue 1
state = missouri
queue 1
state = wisconsin
queue 1
</pre>
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
iowa.data
missouri.data
wisconsin.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
iowa.err iowa.data
iowa.log iowa.out
missouri.err missouri.data
missouri.log missouri.out
wisconsin.err wisconsin.data
wisconsin.log wisconsin.out
my_iowa.out
my_missouri.out
my_wisconsin.out
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
iowa.data
comparison.data
(other HTCondor tracking files)
</pre>
<a name="notint-dir"></a>
<h2>B. Using a different non-numbered directory for each job</h2>
<p>In this example, we once again use multiple "queue" statements,
but redefine the "InitialDir" each time.
</p>
<b>Submit file:</b>
<pre>
executable = my.exec
arguments = state.data comparison.data my_$(InitialDir).out
output = job.out
error = job.err
log = job.log
transfer_input_files = input.data,../comparison.data
InitialDir = iowa
queue 1
InitialDir = missouri
queue 1
InitialDir = wisconsin
queue 1
</pre>
<table class="directory">
<tr>
<th>Submit directory before submitting</th>
<th>After completion</th>
</tr>
<tr>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
iowa/ state.data
missouri/ state.data
wisconsin/ state.data
</pre></td>
<td class="directory"><pre>
(submit_dir)/ submit.file
my.exec
comparison.data
iowa/ state.data job.out
job.err job.log
my_iowa.out
missouri/ state.data job.out
job.err job.log
my_missouri.out
wisconsin/ state.data job.out
job.err job.log
my_wisconsin.out
</pre> </td>
</tr>
</table>
<b>Job working directory after input transfer, before execution</b>
<pre>
(working_dir)/ my.exec
missouri.data
comparison.data
(other HTCondor tracking files)
</pre>
<!-- V. Separately organizing Output, Error, and Log files -->