Re: [slurm-users] Slurm Perl API use and examples

2020-03-25 Thread Marcus Wagner

Hi John,

no, we just use the API for monitoring issues.


Best
Marcus

Am 25.03.2020 um 13:35 schrieb Burian, John:

Marcus,

Do you use the Perl API to submit jobs/request allocations, or only to query 
the state of jobs, etc.? If you submit jobs, how do you populate the hash that 
is passed as a job_desc_msg_t structure? Thanks,

John


-Original Message-
From: slurm-users  on behalf of Marcus Wagner 

Reply-To: Slurm User Community List 
Date: Tuesday, March 24, 2020 at 9:49 AM
To: "slurm-users@lists.schedmd.com" 
Subject: Re: [slurm-users] Slurm Perl API use and examples

 [WARNING: External Email - Use Caution]
 
 In fact, we ARE using the perl API, but there are some flaws.
 
 E.g. the array_task_str of the jobinfo structure. Slurm abbreviates long

 list of array indices, like scontrol does:
 
 e.g.

 1-3,5-8,45-...
 
 yes, you can really find there three dots. In my opinion, this is ok for

 a general tool like scontrol to abbreviate the output, but it does not
 make any sense within a API.
 
 Does anyone know, if the C-API also abbreviates things like that?
 
 
 Best

 Marcus
 
 Am 23.03.2020 um 20:47 schrieb Burian, John:

 > 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,
 >
 
 





Re: [slurm-users] Slurm Perl API use and examples

2020-03-25 Thread Burian, John
Marcus,

Do you use the Perl API to submit jobs/request allocations, or only to query 
the state of jobs, etc.? If you submit jobs, how do you populate the hash that 
is passed as a job_desc_msg_t structure? Thanks,

John


-Original Message-
From: slurm-users  on behalf of Marcus 
Wagner 
Reply-To: Slurm User Community List 
Date: Tuesday, March 24, 2020 at 9:49 AM
To: "slurm-users@lists.schedmd.com" 
Subject: Re: [slurm-users] Slurm Perl API use and examples

[WARNING: External Email - Use Caution]

In fact, we ARE using the perl API, but there are some flaws.

E.g. the array_task_str of the jobinfo structure. Slurm abbreviates long 
list of array indices, like scontrol does:

e.g.
1-3,5-8,45-...

yes, you can really find there three dots. In my opinion, this is ok for 
a general tool like scontrol to abbreviate the output, but it does not 
make any sense within a API.

Does anyone know, if the C-API also abbreviates things like that?


Best
Marcus

Am 23.03.2020 um 20:47 schrieb Burian, John:
> 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,
> 





Re: [slurm-users] Slurm Perl API use and examples

2020-03-24 Thread Burian, John
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.

John


From: slurm-users  on behalf of Yair 
Yarom 
Reply-To: Slurm User Community List 
Date: Tuesday, March 24, 2020 at 6:05 AM
To: Slurm User Community List 
Subject: Re: [slurm-users] Slurm Perl API use and examples

[WARNING: External Email - Use Caution]


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, 
etc.).
Not in CPAN, but you can see it under in the cshuji::Slurm module in:
https://github.com/irush-cs/slurm-scripts/<https://urldefense.com/v3/__https:/github.com/irush-cs/slurm-scripts/__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12M7jMgQkQ$>

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

HTH,
Yair.


On Mon, Mar 23, 2020 at 10:27 PM Thomas M. Payerle 
mailto:paye...@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 CPAN:
https://metacpan.org/release/Slurm-Sacctmgr<https://urldefense.com/v3/__https:/metacpan.org/release/Slurm-Sacctmgr__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12MoehiSxw$>
https://metacpan.org/release/Slurm-Sshare<https://urldefense.com/v3/__https:/metacpan.org/release/Slurm-Sshare__;!!ODYTt7Uqo6LDP14!xJHgy6HMnrNX3jBk-iSi2V-voXSbHh-FZR4knNxdELXegetUL0bm10gBxQQYnz3O_12M3gXdUuA$>
(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 
mailto:john.bur...@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 Crossroadspaye...@umd.edu<mailto:paye...@umd.edu>
5825 University Research Park   (301) 405-6135
University of Maryland
College Park, MD 20740-3831



Re: [slurm-users] Slurm Perl API use and examples

2020-03-24 Thread Marcus Wagner

In fact, we ARE using the perl API, but there are some flaws.

E.g. the array_task_str of the jobinfo structure. Slurm abbreviates long 
list of array indices, like scontrol does:


e.g.
1-3,5-8,45-...

yes, you can really find there three dots. In my opinion, this is ok for 
a general tool like scontrol to abbreviate the output, but it does not 
make any sense within a API.


Does anyone know, if the C-API also abbreviates things like that?


Best
Marcus

Am 23.03.2020 um 20:47 schrieb Burian, John:

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,





Re: [slurm-users] Slurm Perl API use and examples

2020-03-24 Thread Yair Yarom
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,
etc.).
Not in CPAN, but you can see it under in the cshuji::Slurm module in:
https://github.com/irush-cs/slurm-scripts/

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

HTH,
Yair.


On Mon, Mar 23, 2020 at 10:27 PM Thomas M. Payerle  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
> CPAN:
> 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.bur...@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 Crossroadspaye...@umd.edu
> 5825 University Research Park   (301) 405-6135
> University of Maryland
> College Park, MD 20740-3831
>


Re: [slurm-users] Slurm Perl API use and examples

2020-03-23 Thread Thomas M. Payerle
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:
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.bur...@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 Crossroadspaye...@umd.edu
5825 University Research Park   (301) 405-6135
University of Maryland
College Park, MD 20740-3831