|
15 | 15 | },
|
16 | 16 | {
|
17 | 17 | "cell_type": "code",
|
18 |
| - "execution_count": 1, |
| 18 | + "execution_count": null, |
19 | 19 | "metadata": {
|
20 | 20 | "pycharm": {}
|
21 | 21 | },
|
|
42 | 42 | },
|
43 | 43 | {
|
44 | 44 | "cell_type": "code",
|
45 |
| - "execution_count": 2, |
| 45 | + "execution_count": null, |
46 | 46 | "metadata": {
|
47 | 47 | "pycharm": {}
|
48 | 48 | },
|
49 |
| - "outputs": [ |
50 |
| - { |
51 |
| - "name": "stdout", |
52 |
| - "output_type": "stream", |
53 |
| - "text": [ |
54 |
| - "=== START ===\n", |
55 |
| - "foo = 1\n", |
56 |
| - "bar = 2\n", |
57 |
| - "baz = $(foo)\n", |
58 |
| - "qux = 3\n", |
59 |
| - "\n", |
60 |
| - "=== END ===\n", |
61 |
| - "1\n" |
62 |
| - ] |
63 |
| - } |
64 |
| - ], |
| 49 | + "outputs": [], |
65 | 50 | "source": [
|
66 | 51 | "sub = htcondor.Submit({\"foo\": \"1\", \"bar\": \"2\", \"baz\": \"$(foo)\"})\n",
|
67 | 52 | "sub.setdefault(\"qux\", \"3\")\n",
|
|
80 | 65 | },
|
81 | 66 | {
|
82 | 67 | "cell_type": "code",
|
83 |
| - "execution_count": 3, |
| 68 | + "execution_count": null, |
84 | 69 | "metadata": {
|
85 | 70 | "pycharm": {}
|
86 | 71 | },
|
|
106 | 91 | },
|
107 | 92 | {
|
108 | 93 | "cell_type": "code",
|
109 |
| - "execution_count": 4, |
| 94 | + "execution_count": null, |
110 | 95 | "metadata": {
|
111 | 96 | "pycharm": {}
|
112 | 97 | },
|
113 |
| - "outputs": [ |
114 |
| - { |
115 |
| - "name": "stdout", |
116 |
| - "output_type": "stream", |
117 |
| - "text": [ |
118 |
| - "2\n" |
119 |
| - ] |
120 |
| - } |
121 |
| - ], |
| 98 | + "outputs": [], |
122 | 99 | "source": [
|
123 | 100 | "schedd = htcondor.Schedd() # Create a schedd object using default settings.\n",
|
124 | 101 | "with schedd.transaction() as txn: # txn will now represent the transaction.\n",
|
|
138 | 115 | },
|
139 | 116 | {
|
140 | 117 | "cell_type": "code",
|
141 |
| - "execution_count": 5, |
| 118 | + "execution_count": null, |
142 | 119 | "metadata": {},
|
143 |
| - "outputs": [ |
144 |
| - { |
145 |
| - "name": "stdout", |
146 |
| - "output_type": "stream", |
147 |
| - "text": [ |
148 |
| - "3\n" |
149 |
| - ] |
150 |
| - } |
151 |
| - ], |
| 120 | + "outputs": [], |
152 | 121 | "source": [
|
153 | 122 | "schedd = htcondor.Schedd() # Create a fresh Schedd object, pointint at the current schedd.\n",
|
154 | 123 | "with schedd.transaction() as txn: # Start a new transaction\n",
|
|
165 | 134 | },
|
166 | 135 | {
|
167 | 136 | "cell_type": "code",
|
168 |
| - "execution_count": 6, |
| 137 | + "execution_count": null, |
169 | 138 | "metadata": {},
|
170 |
| - "outputs": [ |
171 |
| - { |
172 |
| - "data": { |
173 |
| - "text/plain": [ |
174 |
| - "[[ ClusterId = 3; ProcId = 0; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
175 |
| - " [ ClusterId = 3; ProcId = 1; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
176 |
| - " [ ClusterId = 3; ProcId = 2; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
177 |
| - " [ ClusterId = 3; ProcId = 3; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
178 |
| - " [ ClusterId = 3; ProcId = 4; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
179 |
| - " [ ClusterId = 3; ProcId = 5; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
180 |
| - " [ ClusterId = 3; ProcId = 6; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
181 |
| - " [ ClusterId = 3; ProcId = 7; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
182 |
| - " [ ClusterId = 3; ProcId = 8; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ],\n", |
183 |
| - " [ ClusterId = 3; ProcId = 9; EnteredCurrentStatus = 1563826270; JobStatus = 1; ServerTime = 1563826270 ]]" |
184 |
| - ] |
185 |
| - }, |
186 |
| - "execution_count": 6, |
187 |
| - "metadata": {}, |
188 |
| - "output_type": "execute_result" |
189 |
| - } |
190 |
| - ], |
| 139 | + "outputs": [], |
191 | 140 | "source": [
|
192 | 141 | "schedd.query(constraint='ClusterId=?={}'.format(cluster_id),\n",
|
193 | 142 | " attr_list=[\"ClusterId\", \"ProcId\", \"JobStatus\", \"EnteredCurrentStatus\"])"
|
|
204 | 153 | },
|
205 | 154 | {
|
206 | 155 | "cell_type": "code",
|
207 |
| - "execution_count": 7, |
| 156 | + "execution_count": null, |
208 | 157 | "metadata": {},
|
209 | 158 | "outputs": [],
|
210 | 159 | "source": [
|
|
220 | 169 | },
|
221 | 170 | {
|
222 | 171 | "cell_type": "code",
|
223 |
| - "execution_count": 8, |
| 172 | + "execution_count": null, |
224 | 173 | "metadata": {},
|
225 |
| - "outputs": [ |
226 |
| - { |
227 |
| - "name": "stdout", |
228 |
| - "output_type": "stream", |
229 |
| - "text": [ |
230 |
| - "4\n" |
231 |
| - ] |
232 |
| - }, |
233 |
| - { |
234 |
| - "data": { |
235 |
| - "text/plain": [ |
236 |
| - "[[ Args = \"0m\"; ClusterId = 4; ProcId = 0; JobStatus = 1; ServerTime = 1563826271 ],\n", |
237 |
| - " [ Args = \"1m\"; ClusterId = 4; ProcId = 1; JobStatus = 1; ServerTime = 1563826271 ],\n", |
238 |
| - " [ Args = \"2m\"; ClusterId = 4; ProcId = 2; JobStatus = 1; ServerTime = 1563826271 ],\n", |
239 |
| - " [ Args = \"3m\"; ClusterId = 4; ProcId = 3; JobStatus = 1; ServerTime = 1563826271 ],\n", |
240 |
| - " [ Args = \"4m\"; ClusterId = 4; ProcId = 4; JobStatus = 1; ServerTime = 1563826271 ],\n", |
241 |
| - " [ Args = \"5m\"; ClusterId = 4; ProcId = 5; JobStatus = 1; ServerTime = 1563826271 ],\n", |
242 |
| - " [ Args = \"6m\"; ClusterId = 4; ProcId = 6; JobStatus = 1; ServerTime = 1563826271 ],\n", |
243 |
| - " [ Args = \"7m\"; ClusterId = 4; ProcId = 7; JobStatus = 1; ServerTime = 1563826271 ],\n", |
244 |
| - " [ Args = \"8m\"; ClusterId = 4; ProcId = 8; JobStatus = 1; ServerTime = 1563826271 ],\n", |
245 |
| - " [ Args = \"9m\"; ClusterId = 4; ProcId = 9; JobStatus = 1; ServerTime = 1563826271 ]]" |
246 |
| - ] |
247 |
| - }, |
248 |
| - "execution_count": 8, |
249 |
| - "metadata": {}, |
250 |
| - "output_type": "execute_result" |
251 |
| - } |
252 |
| - ], |
| 174 | + "outputs": [], |
253 | 175 | "source": [
|
254 | 176 | "with schedd.transaction() as txn: # Start a new transaction\n",
|
255 | 177 | " cluster_id = sub.queue(txn, count=10) # Submit 10 identical jobs\n",
|
|
275 | 197 | },
|
276 | 198 | {
|
277 | 199 | "cell_type": "code",
|
278 |
| - "execution_count": 9, |
| 200 | + "execution_count": null, |
279 | 201 | "metadata": {},
|
280 | 202 | "outputs": [],
|
281 | 203 | "source": [
|
|
298 | 220 | },
|
299 | 221 | {
|
300 | 222 | "cell_type": "code",
|
301 |
| - "execution_count": 10, |
| 223 | + "execution_count": null, |
302 | 224 | "metadata": {},
|
303 |
| - "outputs": [ |
304 |
| - { |
305 |
| - "name": "stdout", |
306 |
| - "output_type": "stream", |
307 |
| - "text": [ |
308 |
| - "{'filename': 'job_0.txt'}\n", |
309 |
| - "{'filename': 'job_1.txt'}\n", |
310 |
| - "{'filename': 'job_2.txt'}\n", |
311 |
| - "{'filename': 'job_3.txt'}\n", |
312 |
| - "{'filename': 'job_4.txt'}\n", |
313 |
| - "{'filename': 'job_5.txt'}\n", |
314 |
| - "{'filename': 'job_6.txt'}\n", |
315 |
| - "{'filename': 'job_7.txt'}\n", |
316 |
| - "{'filename': 'job_8.txt'}\n", |
317 |
| - "{'filename': 'job_9.txt'}\n" |
318 |
| - ] |
319 |
| - } |
320 |
| - ], |
| 225 | + "outputs": [], |
321 | 226 | "source": [
|
322 | 227 | "sub = htcondor.Submit({\"executable\": \"/bin/cat\"})\n",
|
323 | 228 | "sub[\"arguments\"] = \"$(filename)\"\n",
|
|
333 | 238 | },
|
334 | 239 | {
|
335 | 240 | "cell_type": "code",
|
336 |
| - "execution_count": 11, |
| 241 | + "execution_count": null, |
337 | 242 | "metadata": {},
|
338 |
| - "outputs": [ |
339 |
| - { |
340 |
| - "name": "stdout", |
341 |
| - "output_type": "stream", |
342 |
| - "text": [ |
343 |
| - "5\n" |
344 |
| - ] |
345 |
| - } |
346 |
| - ], |
| 243 | + "outputs": [], |
347 | 244 | "source": [
|
348 | 245 | "with schedd.transaction() as txn:\n",
|
349 | 246 | " # Submit one job per entry in the iterator.\n",
|
|
366 | 263 | },
|
367 | 264 | {
|
368 | 265 | "cell_type": "code",
|
369 |
| - "execution_count": 12, |
| 266 | + "execution_count": null, |
370 | 267 | "metadata": {},
|
371 |
| - "outputs": [ |
372 |
| - { |
373 |
| - "data": { |
374 |
| - "text/plain": [ |
375 |
| - "[[ Out = \"results.0\"; JobStatus = 1; TransferInput = \"input_directory/job_0.txt\"; ServerTime = 1563826277; Args = \"job_0.txt\"; ClusterId = 5; ProcId = 0 ],\n", |
376 |
| - " [ Out = \"results.1\"; JobStatus = 1; TransferInput = \"input_directory/job_1.txt\"; ServerTime = 1563826277; Args = \"job_1.txt\"; ClusterId = 5; ProcId = 1 ],\n", |
377 |
| - " [ Out = \"results.2\"; JobStatus = 1; TransferInput = \"input_directory/job_2.txt\"; ServerTime = 1563826277; Args = \"job_2.txt\"; ClusterId = 5; ProcId = 2 ],\n", |
378 |
| - " [ Out = \"results.3\"; JobStatus = 1; TransferInput = \"input_directory/job_3.txt\"; ServerTime = 1563826277; Args = \"job_3.txt\"; ClusterId = 5; ProcId = 3 ],\n", |
379 |
| - " [ Out = \"results.4\"; JobStatus = 1; TransferInput = \"input_directory/job_4.txt\"; ServerTime = 1563826277; Args = \"job_4.txt\"; ClusterId = 5; ProcId = 4 ],\n", |
380 |
| - " [ Out = \"results.5\"; JobStatus = 1; TransferInput = \"input_directory/job_5.txt\"; ServerTime = 1563826277; Args = \"job_5.txt\"; ClusterId = 5; ProcId = 5 ],\n", |
381 |
| - " [ Out = \"results.6\"; JobStatus = 1; TransferInput = \"input_directory/job_6.txt\"; ServerTime = 1563826277; Args = \"job_6.txt\"; ClusterId = 5; ProcId = 6 ],\n", |
382 |
| - " [ Out = \"results.7\"; JobStatus = 1; TransferInput = \"input_directory/job_7.txt\"; ServerTime = 1563826277; Args = \"job_7.txt\"; ClusterId = 5; ProcId = 7 ],\n", |
383 |
| - " [ Out = \"results.8\"; JobStatus = 1; TransferInput = \"input_directory/job_8.txt\"; ServerTime = 1563826277; Args = \"job_8.txt\"; ClusterId = 5; ProcId = 8 ],\n", |
384 |
| - " [ Out = \"results.9\"; JobStatus = 1; TransferInput = \"input_directory/job_9.txt\"; ServerTime = 1563826277; Args = \"job_9.txt\"; ClusterId = 5; ProcId = 9 ]]" |
385 |
| - ] |
386 |
| - }, |
387 |
| - "execution_count": 12, |
388 |
| - "metadata": {}, |
389 |
| - "output_type": "execute_result" |
390 |
| - } |
391 |
| - ], |
| 268 | + "outputs": [], |
392 | 269 | "source": [
|
393 | 270 | "schedd.query(constraint='ClusterId=?={}'.format(results.cluster()),\n",
|
394 | 271 | " attr_list=[\"ClusterId\", \"ProcId\", \"JobStatus\", \"TransferInput\", \"Out\", \"Args\"])"
|
|
428 | 305 | },
|
429 | 306 | {
|
430 | 307 | "cell_type": "code",
|
431 |
| - "execution_count": 13, |
| 308 | + "execution_count": null, |
432 | 309 | "metadata": {
|
433 | 310 | "pycharm": {}
|
434 | 311 | },
|
435 |
| - "outputs": [ |
436 |
| - { |
437 |
| - "name": "stdout", |
438 |
| - "output_type": "stream", |
439 |
| - "text": [ |
440 |
| - "=== START JOB STATUS ===\n", |
441 |
| - "0: foo=bar, job_status = 1\n", |
442 |
| - "1: foo=bar, job_status = 1\n", |
443 |
| - "2: foo=default_string, job_status = 1\n", |
444 |
| - "3: foo=default_string, job_status = 1\n", |
445 |
| - "4: foo=default_string, job_status = 1\n", |
446 |
| - "=== END ===\n", |
447 |
| - "=== START JOB STATUS ===\n", |
448 |
| - "0: foo=bar, job_status = 1\n", |
449 |
| - "1: foo=bar, job_status = 1\n", |
450 |
| - "2: foo=default_string, job_status = 5\n", |
451 |
| - "3: foo=default_string, job_status = 5\n", |
452 |
| - "4: foo=default_string, job_status = 5\n", |
453 |
| - "=== END ===\n" |
454 |
| - ] |
455 |
| - } |
456 |
| - ], |
| 312 | + "outputs": [], |
457 | 313 | "source": [
|
458 | 314 | "with schedd.transaction() as txn:\n",
|
459 | 315 | " clusterId = sub.queue(txn, 5) # Queues 5 copies of this job.\n",
|
|
515 | 371 | }
|
516 | 372 | },
|
517 | 373 | "nbformat": 4,
|
518 |
| - "nbformat_minor": 2 |
| 374 | + "nbformat_minor": 4 |
519 | 375 | }
|
0 commit comments