It is a bug in Slurm. Add "job_desc_msg.contiguous = 0;" to your program for now.
Quoting caohaijun <[email protected]>: > > Hi > > I found a problem on resource allocation interface in "slurm.h". > Exactly, the function "slurm_allocate_resources_blocking" and " > slurm_allocate_resources". > > when using the command "salloc -w vm3,vm5", it's correct. > > However, when specifying job_desc_msg.req_nodes = "vm3,vm5"; the > allocated result will be "vm[3-5]". see as the following code. > =================================== > #include <stdio.h> > #include <stdlib.h> > > #include <signal.h> > #include <slurm/slurm.h> > #include <slurm/slurm_errno.h> > #include <string.h> > > > #define SIZE 8192 > > int main(){ > job_desc_msg_t job_desc_msg; > resource_allocation_response_msg_t *job_alloc_resp_msg; > > slurm_init_job_desc_msg (&job_desc_msg); > job_desc_msg.user_id = getuid(); > job_desc_msg.group_id = getgid(); > job_desc_msg.req_nodes = "vm3,vm5"; > > job_alloc_resp_msg = > slurm_allocate_resources_blocking(&job_desc_msg, 10, NULL); > > //slurm_allocate_resources(&job_desc_msg, &job_alloc_resp_msg); > > > if (!job_alloc_resp_msg) { > slurm_perror ("ERROR: slurm_allocate_resources_blocking"); > exit (1); > } > > > printf ("job_id = %u, allocated node_list = %s\n", > job_alloc_resp_msg->job_id, job_alloc_resp_msg->node_list); > > return 0; > } > =================================== > output: > job_id = 125, allocated node_list = vm[3-5] > =================================== > > -- > Best Regards! > > Haijun Cao > ----------------------------------------------------------- > Tel: +86-188 1787 9959 > Email:[email protected] > -----------------------------------------------------------
