diff --git a/testsuite/slurm_unit/api/manual/allocate-tst.c b/testsuite/slurm_unit/api/manual/allocate-tst.c index 0616073cd29a1f30ac95a03da4e68c695b48f505..4cab1570479c8d2a3b38d16138f0e42256f85487 100644 --- a/testsuite/slurm_unit/api/manual/allocate-tst.c +++ b/testsuite/slurm_unit/api/manual/allocate-tst.c @@ -10,44 +10,72 @@ int main (int argc, char *argv[]) { int error_code; - char *node_list; - uint32_t job_id; - error_code = slurm_allocate_resources - ("User=1500 JobName=job01 TotalNodes=400 TotalProcs=1000 ReqNodes=lx[3000-3003] Partition=batch MinRealMemory=1024 MinTmpDisk=2034 Groups=students,employee MinProcs=4 Contiguous=YES Key=1234 Immediate", - &node_list, &job_id); + job_desc_msg_t job_mesg; + + slurm_init_job_desc_msg( &job_mesg ); + job_mesg. contiguous = 1; + job_mesg. features = "bigDisk\0"; + job_mesg. groups = ("students,employee\0"); + job_mesg. job_id = 12345; + job_mesg. name = ("job01\0"); + job_mesg. partition_key = NULL; + 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 = 100; + job_mesg. num_procs = 1000; + job_mesg. num_nodes = 400; + job_mesg. user_id = 1500; + + + error_code = slurm_allocate_resources ( &job_mesg ); if (error_code) printf ("allocate error %d\n", error_code); else { - printf ("allocate nodes %s to job %u\n", node_list, job_id); - free (node_list); + printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); } + while (1) { - error_code = slurm_allocate_resources - ("User=1500 JobName=more TotalProcs=4000 Partition=batch Key=1234 Immediate", - &node_list, &job_id); + /* the string also had Immediate */ + slurm_init_job_desc_msg( &job_mesg ); + job_mesg. name = ("more\0"); + job_mesg. partition_key = "1234"; + job_mesg. partition = "batch\0"; + job_mesg. num_procs = 4000; + job_mesg. user_id = 1500; + + error_code = slurm_allocate_resources( &job_mesg ); if (error_code) { printf ("allocate error %d\n", error_code); break; } else { - printf ("allocate nodes %s to job %u\n", node_list, job_id); - free (node_list); + printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); } } while (1) { - error_code = slurm_allocate_resources - ("User=1500 JobName=more TotalProcs=40 Partition=batch Key=1234 Immediate", - &node_list, &job_id); + slurm_init_job_desc_msg( &job_mesg ); + job_mesg. name = ("more\0"); + job_mesg. partition_key = "1234"; + job_mesg. partition = "batch\0"; + job_mesg. num_procs = 40; + job_mesg. user_id = 1500; + + error_code = slurm_allocate_resources( &job_mesg ); if (error_code) { printf ("allocate error %d\n", error_code); break; } else { - printf ("allocate nodes %s to job %u\n", node_list, job_id); - free (node_list); + printf ("allocate nodes %s to job %u\n", job_mesg.req_nodes, job_mesg.job_id); } } diff --git a/testsuite/slurm_unit/api/manual/job_info-tst.c b/testsuite/slurm_unit/api/manual/job_info-tst.c index 3dd3ddf4548fc19c570fb4945673d589258b1e30..f19999c50f7f2f6bca45e2f008eceb6c9f4f8c31 100644 --- a/testsuite/slurm_unit/api/manual/job_info-tst.c +++ b/testsuite/slurm_unit/api/manual/job_info-tst.c @@ -20,7 +20,7 @@ main (int argc, char *argv[]) return (error_code); } - slurm_print_job_info_msg ( job_info_msg_ptr ) ; + slurm_print_job_info_msg ( stdout, job_info_msg_ptr ) ; slurm_free_job_info ( job_info_msg_ptr ) ; return (0); diff --git a/testsuite/slurm_unit/api/manual/node_info-tst.c b/testsuite/slurm_unit/api/manual/node_info-tst.c index ccdc5e6f0517fb3f0299584db2ca8e122ea77a4f..93546ee7867bcf2f9576d35b71d75b8a37d3e87d 100644 --- a/testsuite/slurm_unit/api/manual/node_info-tst.c +++ b/testsuite/slurm_unit/api/manual/node_info-tst.c @@ -30,7 +30,7 @@ main (int argc, char *argv[]) * last 1 entry, and every 200th entry */ if ((i < 10) || (i % 200 == 0) || ((i + 1) == node_info_msg_ptr-> record_count)) { - slurm_print_node_table ( & node_ptr[i] ) ; + slurm_print_node_table ( stdout, & node_ptr[i] ) ; } else if ((i==10) || (i % 200 == 1)) printf ("skipping...\n"); diff --git a/testsuite/slurm_unit/api/manual/partition_info-tst.c b/testsuite/slurm_unit/api/manual/partition_info-tst.c index 35c12cb455acf8ffe9a0c06e2ba62ab7897ce812..34448da70ba02ca7668d7aad52913cf58df199ee 100644 --- a/testsuite/slurm_unit/api/manual/partition_info-tst.c +++ b/testsuite/slurm_unit/api/manual/partition_info-tst.c @@ -23,7 +23,7 @@ main (int argc, char *argv[]) note("Updated at %lx, record count %d\n", (time_t) part_info_ptr->last_update, part_info_ptr->record_count); - slurm_print_partition_info ( part_info_ptr ); + slurm_print_partition_info ( stdout, part_info_ptr ); slurm_free_partition_info (part_info_ptr); return (0); } diff --git a/testsuite/slurm_unit/api/manual/submit-tst.c b/testsuite/slurm_unit/api/manual/submit-tst.c index f92acebae1bb5834997c779c2245d3be476467a9..0404e26f0e659b699d181f84b905b29d52935c59 100644 --- a/testsuite/slurm_unit/api/manual/submit-tst.c +++ b/testsuite/slurm_unit/api/manual/submit-tst.c @@ -11,17 +11,34 @@ int main (int argc, char *argv[]) { int error_code, i, count; - uint32_t job_id; + job_desc_msg_t job_mesg; + + job_mesg. contiguous = 1; + job_mesg. features = "bigDisk\0"; + job_mesg. groups = ("students,employee\0"); + job_mesg. job_id = 12345; + job_mesg. name = ("job01\0"); + job_mesg. partition_key = NULL; + 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 = 100; + job_mesg. num_procs = 1000; + job_mesg. num_nodes = 400; + job_mesg. user_id = 1500; - error_code = slurm_submit_batch_job - ("User=1500 Script=/bin/hostname JobName=job01 TotalNodes=400 TotalProcs=1000 ReqNodes=lx[3000-3003] Partition=batch MinRealMemory=1024 MinTmpDisk=2034 Groups=students,employee MinProcs=4 Contiguous=YES Key=1234", - &job_id); + error_code = slurm_submit_batch_job( &job_mesg ); if (error_code) { printf ("submit error %d\n", error_code); return (error_code); } else - printf ("job %u submitted\n", job_id); + printf ("job %u submitted\n", job_mesg.job_id); if (argc > 1) count = atoi (argv[1]); @@ -29,15 +46,14 @@ main (int argc, char *argv[]) count = 5; for (i=0; i<count; i++) { - error_code = slurm_submit_batch_job - ("User=1500 Script=/bin/hostname JobName=more TotalProcs=4000 Partition=batch Key=1234 ", - &job_id); + job_mesg.job_id = job_mesg.job_id + i; + error_code = slurm_submit_batch_job( &job_mesg); if (error_code) { printf ("submit error %d\n", error_code); break; } else { - printf ("job %u submitted\n", job_id); + printf ("job %u submitted\n", job_mesg.job_id); } }