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

changed print functions to print to a FILE*

fixed a couple of inconsistancies in slurm.h
parent 6687448c
No related branches found
No related tags found
No related merge requests found
...@@ -40,58 +40,58 @@ ...@@ -40,58 +40,58 @@
/* print the entire job_info_msg */ /* print the entire job_info_msg */
void void
slurm_print_job_info_msg ( job_info_msg_t * job_info_msg_ptr ) slurm_print_job_info_msg ( FILE* out, job_info_msg_t * job_info_msg_ptr )
{ {
int i; int i;
job_table_t * job_ptr = job_info_msg_ptr -> job_array ; job_table_t * job_ptr = job_info_msg_ptr -> job_array ;
printf("Jobs updated at %d, record count %d\n", fprintf( out, "Jobs updated at %d, record count %d\n",
job_info_msg_ptr ->last_update, job_info_msg_ptr->record_count); job_info_msg_ptr ->last_update, job_info_msg_ptr->record_count);
for (i = 0; i < job_info_msg_ptr-> record_count; i++) for (i = 0; i < job_info_msg_ptr-> record_count; i++)
{ {
slurm_print_job_table ( & job_ptr[i] ) ; slurm_print_job_table ( out, & job_ptr[i] ) ;
} }
} }
/* print an individual job_table entry */ /* print an individual job_table entry */
void void
slurm_print_job_table (job_table_t * job_ptr ) slurm_print_job_table ( FILE* out, job_table_t * job_ptr )
{ {
int j; int j;
printf ("JobId=%u UserId=%u ", job_ptr->job_id, job_ptr->user_id); fprintf ( out, "JobId=%u UserId=%u ", job_ptr->job_id, job_ptr->user_id);
printf ("JobState=%u TimeLimit=%u ", job_ptr->job_state, job_ptr->time_limit); fprintf ( out, "JobState=%u TimeLimit=%u ", job_ptr->job_state, job_ptr->time_limit);
printf ("Priority=%u Partition=%s\n", job_ptr->priority, job_ptr->partition); fprintf ( out, "Priority=%u Partition=%s\n", job_ptr->priority, job_ptr->partition);
printf (" Name=%s NodeList=%s ", job_ptr->name, job_ptr->nodes); fprintf ( out, " Name=%s NodeList=%s ", job_ptr->name, job_ptr->nodes);
printf ("StartTime=%x EndTime=%x\n", (uint32_t) job_ptr->start_time, (uint32_t) job_ptr->end_time); fprintf ( out, "StartTime=%x EndTime=%x\n", (uint32_t) job_ptr->start_time, (uint32_t) job_ptr->end_time);
printf (" NodeListIndecies="); fprintf ( out, " NodeListIndecies=");
for (j = 0; job_ptr->node_inx; j++) { for (j = 0; job_ptr->node_inx; j++) {
if (j > 0) if (j > 0)
printf(",%d", job_ptr->node_inx[j]); fprintf( out, ",%d", job_ptr->node_inx[j]);
else else
printf("%d", job_ptr->node_inx[j]); fprintf( out, "%d", job_ptr->node_inx[j]);
if (job_ptr->node_inx[j] == -1) if (job_ptr->node_inx[j] == -1)
break; break;
} }
printf("\n"); fprintf( out, "\n");
printf (" ReqProcs=%u ReqNodes=%u ", job_ptr->num_procs, job_ptr->num_nodes); fprintf ( out, " ReqProcs=%u ReqNodes=%u ", job_ptr->num_procs, job_ptr->num_nodes);
printf ("Shared=%u Contiguous=%u ", job_ptr->shared, job_ptr->contiguous); fprintf ( out, "Shared=%u Contiguous=%u ", job_ptr->shared, job_ptr->contiguous);
printf ("MinProcs=%u MinMemory=%u ", job_ptr->min_procs, job_ptr->min_memory); fprintf ( out, "MinProcs=%u MinMemory=%u ", job_ptr->min_procs, job_ptr->min_memory);
printf ("MinTmpDisk=%u\n", job_ptr->min_tmp_disk); fprintf ( out, "MinTmpDisk=%u\n", job_ptr->min_tmp_disk);
printf (" ReqNodeList=%s Features=%s ", job_ptr->req_nodes, job_ptr->features); fprintf ( out, " ReqNodeList=%s Features=%s ", job_ptr->req_nodes, job_ptr->features);
printf ("JobScript=%s\n", job_ptr->job_script); fprintf ( out, "JobScript=%s\n", job_ptr->job_script);
printf (" ReqNodeListIndecies="); fprintf ( out, " ReqNodeListIndecies=");
for (j = 0; job_ptr->req_node_inx; j++) { for (j = 0; job_ptr->req_node_inx; j++) {
if (j > 0) if (j > 0)
printf(",%d", job_ptr->req_node_inx[j]); fprintf( out, ",%d", job_ptr->req_node_inx[j]);
else else
printf("%d", job_ptr->req_node_inx[j]); fprintf( out, "%d", job_ptr->req_node_inx[j]);
if (job_ptr->req_node_inx[j] == -1) if (job_ptr->req_node_inx[j] == -1)
break; break;
} }
printf("\n\n"); fprintf( out, "\n\n");
} }
/* slurm_load_job - load the supplied job information buffer if changed */ /* slurm_load_job - load the supplied job information buffer if changed */
......
...@@ -46,32 +46,32 @@ ...@@ -46,32 +46,32 @@
/* print the entire node_info_msg */ /* print the entire node_info_msg */
void void
slurm_print_node_info_msg ( node_info_msg_t * node_info_msg_ptr ) slurm_print_node_info_msg ( FILE* out, node_info_msg_t * node_info_msg_ptr )
{ {
int i; int i;
node_table_t * node_ptr = node_info_msg_ptr -> node_array ; node_table_t * node_ptr = node_info_msg_ptr -> node_array ;
printf("Nodes updated at %d, record count %d\n", fprintf( out, "Nodes updated at %d, record count %d\n",
node_info_msg_ptr ->last_update, node_info_msg_ptr->record_count); node_info_msg_ptr ->last_update, node_info_msg_ptr->record_count);
for (i = 0; i < node_info_msg_ptr-> record_count; i++) for (i = 0; i < node_info_msg_ptr-> record_count; i++)
{ {
slurm_print_node_table ( & node_ptr[i] ) ; slurm_print_node_table ( out, & node_ptr[i] ) ;
} }
} }
/* print an individual node_table entry */ /* print an individual node_table entry */
void void
slurm_print_node_table (node_table_t * node_ptr ) slurm_print_node_table ( FILE* out, node_table_t * node_ptr )
{ {
printf ("NodeName=%s CPUs=%u ", fprintf ( out, "NodeName=%s CPUs=%u ",
node_ptr->name, node_ptr->cpus); node_ptr->name, node_ptr->cpus);
printf ("RealMemory=%u TmpDisk=%u ", fprintf ( out, "RealMemory=%u TmpDisk=%u ",
node_ptr->real_memory, node_ptr->tmp_disk); node_ptr->real_memory, node_ptr->tmp_disk);
printf ("State=%u Weight=%u ", fprintf ( out, "State=%u Weight=%u ",
node_ptr->node_state, node_ptr->weight); node_ptr->node_state, node_ptr->weight);
printf ("Features=%s Partition=%s\n\n", fprintf ( out, "Features=%s Partition=%s\n\n",
node_ptr->features, node_ptr->partition); node_ptr->features, node_ptr->partition);
} }
......
...@@ -17,37 +17,37 @@ ...@@ -17,37 +17,37 @@
#include <src/common/slurm_protocol_api.h> #include <src/common/slurm_protocol_api.h>
void slurm_print_partition_info ( partition_info_msg_t * part_info_ptr ) void slurm_print_partition_info ( FILE* out, partition_info_msg_t * part_info_ptr )
{ {
int i ; int i ;
partition_table_t * part_ptr = part_info_ptr->partition_array ; partition_table_t * part_ptr = part_info_ptr->partition_array ;
for (i = 0; i < part_info_ptr->record_count; i++) { for (i = 0; i < part_info_ptr->record_count; i++) {
slurm_print_partition_table ( & part_ptr[i] ) ; slurm_print_partition_table ( out, & part_ptr[i] ) ;
} }
} }
void slurm_print_partition_table ( partition_table_t * part_ptr ) void slurm_print_partition_table ( FILE* out, partition_table_t * part_ptr )
{ {
int j ; int j ;
printf ("PartitionName=%s MaxTime=%u ", part_ptr->name, part_ptr->max_time); fprintf ( out, "PartitionName=%s MaxTime=%u ", part_ptr->name, part_ptr->max_time);
printf ("MaxNodes=%u TotalNodes=%u ", part_ptr->max_nodes, part_ptr->total_nodes); fprintf ( out, "MaxNodes=%u TotalNodes=%u ", part_ptr->max_nodes, part_ptr->total_nodes);
printf ("TotalCPUs=%u Key=%u\n", part_ptr->total_cpus, part_ptr->key); fprintf ( out, "TotalCPUs=%u Key=%u\n", part_ptr->total_cpus, part_ptr->key);
printf (" Default=%u ", part_ptr->default_part); fprintf ( out, " Default=%u ", part_ptr->default_part);
printf ("Shared=%u StateUp=%u ", part_ptr->shared, part_ptr->state_up); fprintf ( out, "Shared=%u StateUp=%u ", part_ptr->shared, part_ptr->state_up);
printf ("Nodes=%s AllowGroups=%s\n", part_ptr->nodes, part_ptr->allow_groups); fprintf ( out, "Nodes=%s AllowGroups=%s\n", part_ptr->nodes, part_ptr->allow_groups);
printf (" NodeIndecies="); fprintf ( out, " NodeIndecies=");
for (j = 0; part_ptr->node_inx; j++) { for (j = 0; part_ptr->node_inx; j++) {
if (j > 0) if (j > 0)
printf(",%d", part_ptr->node_inx[j]); fprintf( out, ",%d", part_ptr->node_inx[j]);
else else
printf("%d", part_ptr->node_inx[j]); fprintf( out, "%d", part_ptr->node_inx[j]);
if (part_ptr->node_inx[j] == -1) if (part_ptr->node_inx[j] == -1)
break; break;
} }
printf("\n\n"); fprintf( out, "\n\n");
} }
......
...@@ -117,27 +117,27 @@ extern void slurm_free_node_info (node_info_msg_t * node_buffer_ptr); ...@@ -117,27 +117,27 @@ extern void slurm_free_node_info (node_info_msg_t * node_buffer_ptr);
* slurm_print_job_info_msg - prints the job information buffer (if allocated) * slurm_print_job_info_msg - prints the job information buffer (if allocated)
* NOTE: buffer is loaded by slurm_load_job_info . * NOTE: buffer is loaded by slurm_load_job_info .
*/ */
extern void slurm_print_job_info_msg ( job_info_msg_t * job_info_msg_ptr ) ; extern void slurm_print_job_info_msg ( FILE* , job_info_msg_t * job_info_msg_ptr ) ;
/* slurm_print_job_table - prints the job table object (if allocated) */ /* slurm_print_job_table - prints the job table object (if allocated) */
extern void slurm_print_job_table ( job_table_t * job_ptr ); extern void slurm_print_job_table ( FILE*, job_table_t * job_ptr );
/* /*
* slurm_print_node_info_msg - prints the node information buffer (if allocated) * slurm_print_node_info_msg - prints the node information buffer (if allocated)
* NOTE: buffer is loaded by slurm_load_node_info . * NOTE: buffer is loaded by slurm_load_node_info .
*/ */
extern void slurm_print_node_info_msg ( node_info_msg_t * node_info_msg_ptr ) ; extern void slurm_print_node_info_msg ( FILE*, node_info_msg_t * node_info_msg_ptr ) ;
/* slurm_print_node_table - prints the node table object (if allocated) */ /* slurm_print_node_table - prints the node table object (if allocated) */
extern void slurm_print_node_table (node_table_t * node_ptr ); extern void slurm_print_node_table ( FILE*, node_table_t * node_ptr );
/* /*
* slurm_free_part_info - free the partition information buffer (if allocated) * slurm_free_part_info - free the partition information buffer (if allocated)
* NOTE: buffer is loaded by load_part. * NOTE: buffer is loaded by load_part.
*/ */
extern void slurm_free_partition_info ( partition_info_msg_t * part_info_ptr); extern void slurm_free_partition_info ( partition_info_msg_t * part_info_ptr);
extern void slurm_print_partition_info ( partition_info_msg_t * part_info_ptr ) ; extern void slurm_print_partition_info ( FILE*, partition_info_msg_t * part_info_ptr ) ;
extern void slurm_print_partition_table ( partition_table_t * part_ptr ) ; extern void slurm_print_partition_table ( FILE*, partition_table_t * part_ptr ) ;
/* /*
* slurm_load_build - load the slurm build information buffer for use by info * slurm_load_build - load the slurm build information buffer for use by info
...@@ -191,7 +191,7 @@ extern int slurm_load_partitions (time_t update_time, partition_info_msg_t **par ...@@ -191,7 +191,7 @@ extern int slurm_load_partitions (time_t update_time, partition_info_msg_t **par
* Shared=<YES|NO> TimeLimit=<minutes> TotalNodes=<count> * Shared=<YES|NO> TimeLimit=<minutes> TotalNodes=<count>
* TotalProcs=<count> Immediate=<YES|NO> * TotalProcs=<count> Immediate=<YES|NO>
*/ */
extern int slurm_submit (char *spec, uint32_t *job_id); extern int slurm_submit_batch_job (job_desc_msg_t * job_desc_msg );
/* /*
* slurm_will_run - determine if a job would execute immediately * slurm_will_run - determine if a job would execute immediately
......
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