Skip to content
Snippets Groups Projects
Commit ba0e668d authored by jce's avatar jce
Browse files

modified for new api

parent c3df43e4
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
......@@ -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);
......
......@@ -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");
......
......@@ -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);
}
......@@ -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);
}
}
......
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