Skip to content

Commit

Permalink
deploy: b8278f1
Browse files Browse the repository at this point in the history
  • Loading branch information
simongravelle committed Oct 25, 2024
1 parent 3f0f881 commit 4d9dcaf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
19 changes: 19 additions & 0 deletions _sources/oar.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ You can cancel all your jobs at once by typing:
where username should be replaced by your ID.

Record the last Job ID and state
--------------------------------

It can be useful to record the ID of the last launched job.

.. code:: bash
oarsub -S ./myjob.sh
oarstat -u username | awk '{print $1}' | tail -n 1 > last_job_id.txt
where username should be replaced by your ID. The file `last_job_id.txt`
will contain the ID of the last launched job. You can also record the entire state
of the job:

.. code:: bash
last_job_id=$(oarstat -u username | awk '{print $1}' | tail -n 1)
oarstat -u username -j "$last_job_id" > last_job_state.txt
Launch Multiple Jobs
--------------------

Expand Down
16 changes: 16 additions & 0 deletions oar.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ <h2>Cancel All Your Jobs at Once<a class="headerlink" href="#cancel-all-your-job
</div>
<p>where username should be replaced by your ID.</p>
</section>
<section id="record-the-last-job-id-and-state">
<h2>Record the last Job ID and state<a class="headerlink" href="#record-the-last-job-id-and-state" title="Link to this heading"></a></h2>
<p>It can be useful to record the ID of the last launched job.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>oarsub<span class="w"> </span>-S<span class="w"> </span>./myjob.sh
oarstat<span class="w"> </span>-u<span class="w"> </span>username<span class="w"> </span><span class="p">|</span><span class="w"> </span>awk<span class="w"> </span><span class="s1">&#39;{print $1}&#39;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>tail<span class="w"> </span>-n<span class="w"> </span><span class="m">1</span><span class="w"> </span>&gt;<span class="w"> </span>last_job_id.txt
</pre></div>
</div>
<p>where username should be replaced by your ID. The file <cite>last_job_id.txt</cite>
will contain the ID of the last launched job. You can also record the entire state
of the job:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">last_job_id</span><span class="o">=</span><span class="k">$(</span>oarstat<span class="w"> </span>-u<span class="w"> </span>username<span class="w"> </span><span class="p">|</span><span class="w"> </span>awk<span class="w"> </span><span class="s1">&#39;{print $1}&#39;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>tail<span class="w"> </span>-n<span class="w"> </span><span class="m">1</span><span class="k">)</span>
oarstat<span class="w"> </span>-u<span class="w"> </span>username<span class="w"> </span>-j<span class="w"> </span><span class="s2">&quot;</span><span class="nv">$last_job_id</span><span class="s2">&quot;</span><span class="w"> </span>&gt;<span class="w"> </span>last_job_state.txt
</pre></div>
</div>
</section>
<section id="launch-multiple-jobs">
<h2>Launch Multiple Jobs<a class="headerlink" href="#launch-multiple-jobs" title="Link to this heading"></a></h2>
<p>Here, tips to efficiently launch multiple jobs are provided.</p>
Expand Down Expand Up @@ -181,6 +196,7 @@ <h2>Launch Multiple Jobs<a class="headerlink" href="#launch-multiple-jobs" title
<li><a class="reference internal" href="#">OAR tips</a><ul>
<li><a class="reference internal" href="#submit-jobs-with-dependencies">Submit Jobs with Dependencies</a></li>
<li><a class="reference internal" href="#cancel-all-your-jobs-at-once">Cancel All Your Jobs at Once</a></li>
<li><a class="reference internal" href="#record-the-last-job-id-and-state">Record the last Job ID and state</a></li>
<li><a class="reference internal" href="#launch-multiple-jobs">Launch Multiple Jobs</a></li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4d9dcaf

Please sign in to comment.