Commit f08e1a73 authored by Wout De Nolf's avatar Wout De Nolf

[doc] small changes

parent 4d8d9ac5
......@@ -34,7 +34,7 @@ Hello world (specify resources and postpone execution):
command='echo "Hello word"',resource=resource)
job = jobdef.submit(hold=True)
job.wait(states=('Hold', 'Suspended'))
job.wait(states='Hold')
# job is waiting for you to resume it
job.resume()
job.wait()
......
This diff is collapsed.
......@@ -4,7 +4,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Hello world (minimal):"
"Hello world\n",
"=========\n",
"Minimal\n",
"------------"
]
},
{
......@@ -16,9 +19,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
".......\n",
"Interrupted:\n",
"None\n"
"............\n",
"Succes:\n",
"Hello word\n",
"\n"
]
}
],
......@@ -42,7 +46,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Hello world (specify resources and postpone execution):"
"With resources and postponed execution\n",
"-------------------------------------------------------------"
]
},
{
......@@ -54,7 +59,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"........\n",
".....................................\n",
"Succes:\n",
"Hello word\n",
"\n"
......@@ -65,12 +70,12 @@
"from oarpy import oarjob\n",
"from oarpy.oarresource import Resource\n",
"\n",
"resource = Resource(core=1,walltime={'hours':1},gpu=False)\n",
"resource = Resource(core=1,walltime={'hours':1,'minutes':30},gpu=False)\n",
"jobdef = oarjob.JobFactory(name='helloworld',project='oarpy',\n",
" command='echo \"Hello word\"',resource=resource)\n",
"\n",
"job = jobdef.submit(hold=True)\n",
"job.wait(states=('Hold', 'Suspended'))\n",
"job.wait(states='Hold')\n",
"# job is waiting for you to resume it\n",
"job.resume()\n",
"job.wait()\n",
......@@ -88,6 +93,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Job management\n",
"==============\n",
"\n",
"Find all jobs started in the last 5 minutes:"
]
},
......@@ -100,8 +108,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[Job(1103715), Job(1103724), Job(1103725), Job(1103726), Job(1103727), Job(976220)]\n",
"set([(u'denolf', u'Terminated'), (u'ljacques', u'Error'), (u'piault', u'Running'), (u'sallazda', u'Running')])\n"
"[Job(1122759), Job(1122760), Job(1125221), Job(976220)]\n",
"set([(u'denolf', u'Terminated'), (u'ljacques', u'Error'), (u'in1096', u'Waiting')])\n"
]
}
],
......@@ -109,7 +117,7 @@
"from oarpy import oarjob\n",
"from oarpy import timeutils\n",
"\n",
"start = timeutils.add(timeutils.now(),minutes=-5)\n",
"start = timeutils.add(timeutils.now(),minutes=-1)\n",
"jobs = oarjob.search(start=start)\n",
"print(sorted(jobs))\n",
"print(set([(job['owner'],job.status) for job in jobs]))"
......@@ -141,10 +149,10 @@
" (((((gpu='YES') AND desktop_computing = 'NO') AND cluster = 'NICE') AND opsys = 'debian8') AND interactive = 'MIXED') AND drain='NO'\n",
"\n",
"Job resource:\n",
" -l host=1/core=16,walltime=16:00:00 -p gpu='YES'\n",
" -l host=1/core=16,walltime=16:00:00 -p \"gpu='YES' and drain='NO'\"\n",
"\n",
"Job definition:\n",
" -n Gecko_2_0p7um_2474_3031__001_.par --project default -d /mntdirect/_data_visitor/md1189/id17/GeckosHR/Gecko_2/Gecko_2_0p7um_2474_3031__001_/Slices -O OAR.Gecko_2_0p7um_2474_3031__001_.par.%jobid%.stdout -E OAR.Gecko_2_0p7um_2474_3031__001_.par.%jobid%.stderr -l host=1/core=16,walltime=16:00:00 -p gpu='YES' /mntdirect/_data_visitor/md1189/id17/GeckosHR/Gecko_2/Gecko_2_0p7um_2474_3031__001_/Slices//./tmpmd1189.sh\n",
" -n Gecko_2_0p7um_2474_3031__001_.par --project default -d /mntdirect/_data_visitor/md1189/id17/GeckosHR/Gecko_2/Gecko_2_0p7um_2474_3031__001_/Slices -O OAR.Gecko_2_0p7um_2474_3031__001_.par.%jobid%.stdout -E OAR.Gecko_2_0p7um_2474_3031__001_.par.%jobid%.stderr -l host=1/core=16,walltime=16:00:00 -p \"gpu='YES' and drain='NO'\" /mntdirect/_data_visitor/md1189/id17/GeckosHR/Gecko_2/Gecko_2_0p7um_2474_3031__001_/Slices//./tmpmd1189.sh\n",
"\n"
]
}
......@@ -155,9 +163,10 @@
"job = oarjob.Job(1103714)\n",
"if job.exists:\n",
" jobdef = job.definition\n",
" print('Initial request:\\n {}\\n'.format(job.stats['initial_request']))\n",
" print('Wanted resources:\\n {}\\n'.format(job.stats['wanted_resources']))\n",
" print('Properties:\\n {}\\n'.format(job.stats['properties']))\n",
" stats = job.stats\n",
" print('Initial request:\\n {}\\n'.format(stats['initial_request']))\n",
" print('Wanted resources:\\n {}\\n'.format(stats['wanted_resources']))\n",
" print('Properties:\\n {}\\n'.format(stats['properties']))\n",
" print('Job resource:\\n {}\\n'.format(jobdef.resource))\n",
" print('Job definition:\\n {}\\n'.format(jobdef))"
]
......@@ -166,7 +175,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Remove the log files of all finished jobs of a particular user and project:"
"Remove the log files of all succesfully finished jobs of a particular user and project:"
]
},
{
......@@ -191,14 +200,14 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment