Skip to content
Snippets Groups Projects
Commit 205f9f4d authored by Moe Jette's avatar Moe Jette
Browse files

Move some code to re-initialize job allocate data-structure between

allocate calls.
parent 7fd19547
No related branches found
No related tags found
No related merge requests found
...@@ -9,15 +9,18 @@ ...@@ -9,15 +9,18 @@
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
int error_code; int error_code, job_count, max_jobs;
job_desc_msg_t job_mesg; job_desc_msg_t job_mesg;
job_allocation_response_msg_t resp_msg ; resource_allocation_response_msg_t resp_msg ;
if (argc > 1)
max_jobs = atoi (argv[1]);
else
max_jobs = 1000;
slurm_init_job_desc_msg( &job_mesg ); slurm_init_job_desc_msg( &job_mesg );
job_mesg. contiguous = 1; job_mesg. contiguous = 1;
job_mesg. groups = ("students,employee\0"); job_mesg. groups = ("students,employee\0");
job_mesg. job_id = 12345;
job_mesg. name = ("job01\0"); job_mesg. name = ("job01\0");
job_mesg. partition_key = "1234"; job_mesg. partition_key = "1234";
job_mesg. min_procs = 4; job_mesg. min_procs = 4;
...@@ -38,28 +41,28 @@ main (int argc, char *argv[]) ...@@ -38,28 +41,28 @@ main (int argc, char *argv[])
if (error_code) if (error_code)
printf ("allocate error %d\n", error_code); printf ("allocate error %d\n", error_code);
else { else {
printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); printf ("allocate nodes %s to job %u\n", "TBD", job_mesg.job_id);
} }
job_count = 1;
for ( ; job_count <max_jobs; job_count++) {
slurm_init_job_desc_msg( &job_mesg );
job_mesg. contiguous = 1;
job_mesg. groups = ("students,employee\0");
job_mesg. name = ("more.big\0");
job_mesg. partition_key = "1234";
job_mesg. min_procs = 4;
job_mesg. min_memory = 1024;
job_mesg. min_tmp_disk = 2034;
job_mesg. partition = "batch\0";
job_mesg. priority = 100;
job_mesg. req_nodes = "lx[3000-3003]\0";
job_mesg. job_script = "/bin/hostname\0";
job_mesg. shared = 0;
job_mesg. time_limit = 200;
job_mesg. num_procs = 4000;
job_mesg. user_id = 1500;
slurm_init_job_desc_msg( &job_mesg );
job_mesg. contiguous = 1;
job_mesg. groups = ("students,employee\0");
job_mesg. name = ("more.big\0");
job_mesg. partition_key = "1234";
job_mesg. min_procs = 4;
job_mesg. min_memory = 1024;
job_mesg. min_tmp_disk = 2034;
job_mesg. partition = "batch\0";
job_mesg. priority = 100;
job_mesg. req_nodes = "lx[3000-3003]\0";
job_mesg. job_script = "/bin/hostname\0";
job_mesg. shared = 0;
job_mesg. time_limit = 200;
job_mesg. num_procs = 4000;
job_mesg. user_id = 1500;
while (1) {
/* the string also had Immediate */ /* the string also had Immediate */
error_code = slurm_allocate_resources ( &job_mesg , & resp_msg , true ); error_code = slurm_allocate_resources ( &job_mesg , & resp_msg , true );
...@@ -69,14 +72,15 @@ main (int argc, char *argv[]) ...@@ -69,14 +72,15 @@ main (int argc, char *argv[])
break; break;
} }
else { else {
printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); printf ("allocate nodes %s to job %u\n", "TBD", job_mesg.job_id);
} }
} }
job_mesg. name = ("more.tiny\0"); for ( ; job_count <max_jobs; job_count++) {
job_mesg. num_procs = 40;
while (1) {
slurm_init_job_desc_msg( &job_mesg ); slurm_init_job_desc_msg( &job_mesg );
job_mesg. name = ("more.tiny\0");
job_mesg. num_procs = 40;
job_mesg. user_id = 1500;
error_code = slurm_allocate_resources ( &job_mesg , & resp_msg , false ); error_code = slurm_allocate_resources ( &job_mesg , & resp_msg , false );
if (error_code) { if (error_code) {
...@@ -84,7 +88,7 @@ main (int argc, char *argv[]) ...@@ -84,7 +88,7 @@ main (int argc, char *argv[])
break; break;
} }
else { else {
printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); printf ("allocate nodes %s to job %u\n", "TBD", job_mesg.job_id);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment