Just be sure you understand that by using slurm.h and linking against libslurm, your application will become GPL. IANAL, so you should check with one, if you care.
> On Nov 7, 2014, at 11:14 AM, José Román Bilbao Castro <[email protected]> > wrote: > > Going even further, I have realized you are following an outdated > documentation (12 releases behind from current one which is 14!!). > > Here is the current API: > > http://slurm.schedmd.com/api.html <http://slurm.schedmd.com/api.html> > > Have a look at the "Resource allocation" section, not the job steps one: > > slurm_init_job_desc_msg—Initialize the data structure used in resource > allocation requests. You can then just set the fields of particular interest > and let the others use default values. > slurm_job_will_run—Determine if a job would be immediately initiated if > submitted now. > slurm_allocate_resources—Allocate resources for a job. Response message must > be freed using slurm_free_resource_allocation_response_msg to avoid a memory > leak. > slurm_free_resource_allocation_response_msg— Frees memory allocated by > slurm_allocate_resources. > slurm_allocate_resources_and_run—Allocate resources for a job and spawn a job > step. Response message must be freed > usingslurm_free_resource_allocation_and_run_response_msg to avoid a memory > leak. > slurm_free_resource_allocation_and_run_response_msg— Frees memory allocated > by slurm_allocate_resources_and_run. > slurm_submit_batch_job—Submit a script for later execution. Response message > must be freed using slurm_free_submit_response_response_msg to avoid a memory > leak. > slurm_free_submit_response_response_msg— Frees memory allocated by > slurm_submit_batch_job. > slurm_confirm_allocation—Test if a resource allocation has already been made > for a given job id. Response message must be freed > usingslurm_free_resource_allocation_response_msg to avoid a memory leak. This > can be used to confirm that an allocation is still active or for error > recovery > The steps one is to manage the steps concept I suppose. I mean, once you > submit a job it follows a series of steps that change its status. I think > this is the concept of step here. Steps should not be created nor modified by > the user but by the scheduler itself. So it is up to the programmer to submit > a job and query steps if needed, but not to modify them... > > By the way, I have never programmed using slurm but I think I could be > correct ;). If not, I will be delighted to get responses because I will be > using job submission API in a few days! > > Bests > > > > > Enviado desde mi iPad > > El 7/11/2014, a las 20:02, José Román Bilbao Castro <[email protected] > <mailto:[email protected]>> escribió: > >> >> I have read a bit further. I think this can be a misunderstanding of >> documentation. It does not say you cannot submit jobs but that you >> should use this API to create and populate new jobs information. There >> is a structure that defines a job but it shouldn't be manipulated >> directly but through the API. Once the job is defined, you can submit >> it using a different API: >> >> http://slurm.schedmd.com/launch_plugins.html >> <http://slurm.schedmd.com/launch_plugins.html> >> >> Have a look at the last sentence on the first section. It states to >> have a look at the src/plugins/launch/slurm/launch_slurm.c file. >> >> Also, for a broader picture, have a look at this page on the Developers >> section: >> >> http://slurm.schedmd.com/documentation.html >> <http://slurm.schedmd.com/documentation.html> >> >> Specially on the Design subsection where the process of creating and >> submitting a job is further described (it consists of multiple steps >> and APIs). >> >> Hope this helps >> >> Enviado desde mi iPad >> >>> El 7/11/2014, a las 16:08, Всеволод Никоноров <[email protected] >>> <mailto:[email protected]>> escribió: >>> >>> >>> Hello Walter, >>> >>> Maybe you could just use "system" function? >>> >>> #include <cstdlib> >>> #include <cstdio> >>> int main (int argc, char** argv) >>> { >>> printf ("begin\n"); >>> system ("sleep 1"); >>> printf ("end\n"); >>> } >>> >>> Place you sbatch call instead my "sleep 1", shouldn't this do what you want? >>> >>> 06.11.2014, 09:49, "Walter Landry" <[email protected] >>> <mailto:[email protected]>>: >>>> Hello Everyone, >>>> >>>> What is the recommended way for a C++ program to submit a job? О©╫The >>>> API documentation says >>>> >>>> О©╫О©╫SLURM job steps involve numerous interactions with the slurmd >>>> О©╫О©╫daemon. The job step creation is only the first step in the >>>> О©╫О©╫process. We don't advise direct user creation of job steps, but >>>> О©╫О©╫include the information here for completeness. >>>> >>>> Should I use system("srun")? О©╫DRMAA? >>>> >>>> Thank you, >>>> Walter Landry >>>> [email protected] <mailto:[email protected]> >>> >>> --О©╫ >>> Vsevolod Nikonorov, JSC NIKIET >>> О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫, О©╫О©╫О©╫ >>> О©╫О©╫О©╫О©╫О©╫О©╫ >
