<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Thanks, Yair and Thomas. I’ll check out wrappers. My interest in this case is primarily in job submission and control. I was hoping that by using an API into Slurm, I would avoid problems I’ve had in the past, with interpreting inconsistent
 exit codes of command line executables, and parsing output, that may be mixed between stdout and stderr, to understand exactly what happened.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">John<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">slurm-users <slurm-users-bounces@lists.schedmd.com> on behalf of Yair Yarom <irush@cs.huji.ac.il><br>
<b>Reply-To: </b>Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Date: </b>Tuesday, March 24, 2020 at 6:05 AM<br>
<b>To: </b>Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Subject: </b>Re: [slurm-users] Slurm Perl API use and examples<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<table class="MsoNormalTable" border="0" cellpadding="0" width="99%" style="width:99.0%">
<tbody>
<tr>
<td style="background:#394A58;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;color:white">[WARNING: External Email - Use Caution]</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">I also haven't got along with the Perl API shipped with slurm. I got it to work, but there were things missing.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Currently I have some wrapper functions for most of slurm commands, and a general parsing function to slurm's common outputs (of scontrol, sacctmgr, etc.).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Not in CPAN, but you can see it under in the cshuji::Slurm module in:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.com/v3/__https:/github.com/irush-cs/slurm-scripts/__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12M7jMgQkQ$">https://github.com/irush-cs/slurm-scripts/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I haven't checked it yet, but now with the slurm rest API, I think getting the information should be simpler.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HTH,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">    Yair.<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Mar 23, 2020 at 10:27 PM Thomas M. Payerle <<a href="mailto:payerle@umd.edu">payerle@umd.edu</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">I was never able to figure out how to use the Perl API shipped with Slurm, but instead have written some wrappers around some of the Slurm commands for Perl.  My wrappers for the sacctmgr and share commands are available at CPAN:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.com/v3/__https:/metacpan.org/release/Slurm-Sacctmgr__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12MoehiSxw$" target="_blank">https://metacpan.org/release/Slurm-Sacctmgr</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.com/v3/__https:/metacpan.org/release/Slurm-Sshare__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12M3gXdUuA$" target="_blank">https://metacpan.org/release/Slurm-Sshare</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">(I have similar wrappers for a few other commands, but have not polished enough for CPAN release, but am willing to share if you contact me).<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Mar 23, 2020 at 3:49 PM Burian, John <<a href="mailto:John.Burian@nationwidechildrens.org" target="_blank">John.Burian@nationwidechildrens.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">I have some questions about the Slurm Perl API<br>
- Is it still actively supported? I see it's still in the source in Git.<br>
- Does anyone use it? If so, do you have a pointer to some example code?<br>
<br>
My immediate question is, for methods that take a data structure as an input argument, how does one define that data structure? In Perl, it's just a hash, am I supposed to populate the keys of the hash by reading the matching C structure in slurm.h? Or do I
 only need to populate the keys that I care to provide a value for, and Slurm assigns defaults to the other keys/fields? Thanks,<br>
<br>
-- <br>
John Burian<br>
Senior Systems Programmer, Technical Lead<br>
Institutional High Performance Computing<br>
Abigail Wexner Research Institute, Nationwide Children’s Hospital<br>
<br>
<o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Tom Payerle <br>
DIT-ACIGS/Mid-Atlantic Crossroads        <a href="mailto:payerle@umd.edu" target="_blank">
payerle@umd.edu</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">5825 University Research Park               (301) 405-6135<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">University of Maryland<br>
College Park, MD 20740-3831<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>