<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 29, 2019 at 4:49 PM Lux, Jim (US 337K) <<a href="mailto:james.p.lux@jpl.nasa.gov">james.p.lux@jpl.nasa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-8868269028578082400WordSection1">
<p class="MsoNormal">True, there’s tons of info in qstat -f, however, doesn’t qstat stop showing my job after it completes, though? </p></div></div></blockquote><div><br></div><div>Unless the system administrator sets a grace period for completed jobs to stay on the queue.</div><div></div><div>You could ask your sysadmin to set that up:</div><div><br></div><div>qmgr -c 'set server keep_completed=7200'</div><div><br></div><div>will keep the completed jobs information available for two hours (time in seconds).</div><div>I think the default is zero seconds, maybe a bit more.</div><div>I think it increases the pbs_server memory use, hence there may be some reluctance to do this,</div><div>but for a modest amount of time in a not extremely busy server it may not be too bad.<br></div><div><br></div><div>However, most (maybe all) of this information is stored in the accounting logs, after the job completes.</div><div>I think read access to those logs is by default blocked to regular users, but maybe you can try to mollify the sysadmin policy. :)</div><div>There are three records there for each job, one for when the job is submitted, <br></div><div>another for when the job starts, and one for when it ends, tagged by Q,S,E, respectively.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-8868269028578082400WordSection1"><p class="MsoNormal">Maybe there’s a switch that retrieves “last data”?<br>
<br></p></div></div></blockquote><div><br></div><div>I don't know, but a longer "keep_completed" (above) may produce a similar effect.</div><div><br></div><div>You can also ask the system administrator to write a PBS epilogue script to print out the job requested and used resources</div><div>to the job STDOUT log. I did this here. It is useful information for every user. <br></div><div>Sample output:</div><div><br>job_id=95649.master<br>job_user=gus<br>job_group=gus<br>job_name=FJXndg<br>job_session_id=10623<br>job_requested_resources=neednodes=3:ppn=32,nodes=3:ppn=32,walltime=24:00:00<br>job_used_resources=cput=875:53:15,mem=105991292kb,vmem=152856944kb,walltime=09:36:08<br>job_queue=production<br>job_account=<br>job_exit_code=0</div><div><br></div><div>This is just printing variables that are available from PBS at the job's end.</div><div><br></div><div>Prologue/epilogue scripts are documented here:</div><div><a href="http://docs.adaptivecomputing.com/torque/3-0-5/a.gprologueepilogue.php">http://docs.adaptivecomputing.com/torque/3-0-5/a.gprologueepilogue.php</a></div><div><br></div><div><br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-8868269028578082400WordSection1"><p class="MsoNormal">
I suppose I could put a qstat -f in as the last thing in the sub job file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.cpupercent = 99<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.cput = 00:34:26<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.mem = 11764kb<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.ncpus = 4<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.vmem = 1135264kb<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New";color:black"> resources_used.walltime = 00:34:28</span></p></div></div></blockquote><div> </div><div>qstat -f $PBS_JOBID (I think this is the environment variable.)<br></div><div>It may work.<br></div><div>Wouldn't some statistics extracted with qstat -f from previous jobs provide a reasonable guess for the information</div><div>you need to set up future jobs? <br></div><div><br></div><div>Gus Correa<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-8868269028578082400WordSection1"><p class="MsoNormal"> <u></u></p>
<p class="MsoNormal">and then there’s /usr/bin/time which might also help.<u></u><u></u></p>
<p class="MsoNormal"> <br></p></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-8868269028578082400WordSection1"><p class="MsoNormal"> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) currentcolor currentcolor;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">Beowulf <<a href="mailto:beowulf-bounces@beowulf.org" target="_blank">beowulf-bounces@beowulf.org</a>> on behalf of Gus Correa <<a href="mailto:gus@ldeo.columbia.edu" target="_blank">gus@ldeo.columbia.edu</a>><br>
<b>Date: </b>Tuesday, October 29, 2019 at 11:34 AM<br>
<b>To: </b>"<a href="mailto:beowulf@beowulf.org" target="_blank">beowulf@beowulf.org</a>" <<a href="mailto:beowulf@beowulf.org" target="_blank">beowulf@beowulf.org</a>><br>
<b>Subject: </b>[EXTERNAL] Re: [Beowulf] PBS question<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Oct 29, 2019 at 2:00 PM Lux, Jim (US 337K) via Beowulf <<a href="mailto:beowulf@beowulf.org" target="_blank">beowulf@beowulf.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">I’m doing some EP job arrays using PBS, and I was wondering if there’s a way to find out how much resources the job actually consumed.<u></u><u></u></p>
<p class="MsoNormal">For instance, if I do a select 1:ncpus=4 does it actually use 4 CPUs?<u></u><u></u></p>
<p class="MsoNormal">Likewise, is there a “memory high water mark”.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">The idea here is that since my job competes with all the other jobs, the better I can describe my resource needs (i.e. not over-require) the faster my job gets through the system.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Or are these things I need to instrument in some other way.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">-- <u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">ncpus=4 requests 4 cpus/cores, which PBS/Torque will allocate to your job alone (unless the nodes are tagged as work shared).
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">It is up to you use these cpus (e.g. MPI: mpirun np=4; OpenMP: OMP_THREAD_NUM=4) or not (a serial program).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">"qstat -f" produces a fair amount of information about the job resources.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The accounting logs, in server_priv/accounting/YYYMMDD also do, if you have access to them.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You can request a certain amount of memory with the -l (lowercase L) switch of qsub.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">See 'man qsub' for syntax, and 'man pbs_resources' for which resources can be requested (particularly pmem, pvmem, vmem).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I hope this helps,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Gus Correa<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org" target="_blank">Beowulf@beowulf.org</a> sponsored by Penguin Computing<br>
To change your subscription (digest mode or unsubscribe) visit <a href="https://beowulf.org/cgi-bin/mailman/listinfo/beowulf" target="_blank">
https://beowulf.org/cgi-bin/mailman/listinfo/beowulf</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div></div>