[slurm-users] Slurm Perl API use and examples

Yair Yarom irush at cs.huji.ac.il
Tue Mar 24 10:04:07 UTC 2020

I also haven't got along with the Perl API shipped with slurm. I got it to
work, but there were things missing.
Currently I have some wrapper functions for most of slurm commands, and a
general parsing function to slurm's common outputs (of scontrol, sacctmgr,
Not in CPAN, but you can see it under in the cshuji::Slurm module in:

I haven't checked it yet, but now with the slurm rest API, I think getting
the information should be simpler.


On Mon, Mar 23, 2020 at 10:27 PM Thomas M. Payerle <payerle at umd.edu> wrote:

> 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
> https://metacpan.org/release/Slurm-Sacctmgr
> https://metacpan.org/release/Slurm-Sshare
> (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).
> On Mon, Mar 23, 2020 at 3:49 PM Burian, John <
> John.Burian at nationwidechildrens.org> wrote:
>> I have some questions about the Slurm Perl API
>> - Is it still actively supported? I see it's still in the source in Git.
>> - Does anyone use it? If so, do you have a pointer to some example code?
>> 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,
>> --
>> John Burian
>> Senior Systems Programmer, Technical Lead
>> Institutional High Performance Computing
>> Abigail Wexner Research Institute, Nationwide Children’s Hospital
> --
> Tom Payerle
> DIT-ACIGS/Mid-Atlantic Crossroads        payerle at umd.edu
> 5825 University Research Park               (301) 405-6135
> University of Maryland
> College Park, MD 20740-3831
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20200324/5d72e9be/attachment.htm>

More information about the slurm-users mailing list