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

Fixed code to check version numbers on messages.

Also added printing for node info.
parent c4f63b84
No related branches found
No related tags found
No related merge requests found
...@@ -344,31 +344,24 @@ print_job (char * job_id_str) ...@@ -344,31 +344,24 @@ print_job (char * job_id_str)
* input: node_name - NULL to print all node information * input: node_name - NULL to print all node information
* node_ptr - pointer to node table of information * node_ptr - pointer to node table of information
* NOTE: call this only after executing load_node, called from print_node_list * NOTE: call this only after executing load_node, called from print_node_list
* NOTE: To avoid linear searches, we remember the location of the last name match
*/ */
void void
print_node (char *node_name, node_info_msg_t * node_buffer_ptr) print_node (char *node_name, node_info_msg_t * node_buffer_ptr)
{ {
int i, j; int i, j;
static int last_inx = 0; static int last_inx = 0;
struct node_table *node_ptr;
node_ptr = node_buffer_ptr->node_array;
for (j = 0; j < node_buffer_ptr->record_count; j++) { for (j = 0; j < node_buffer_ptr->record_count; j++) {
if (node_name) { if (node_name) {
i = (j + last_inx) % node_buffer_ptr->record_count; i = (j + last_inx) % node_buffer_ptr->record_count;
if (strcmp (node_name, node_ptr[i].name) != 0) if (strcmp (node_name, node_buffer_ptr->node_array[i].name) != 0)
continue; continue;
} }
else else
i = j; i = j;
printf ("NodeName=%s CPUs=%u ", slurm_print_node_table (stdout, & node_buffer_ptr->node_array[i]);
node_ptr[i].name, node_ptr[i].cpus);
printf ("RealMemory=%u TmpDisk=%u ",
node_ptr[i].real_memory, node_ptr[i].tmp_disk);
printf ("State=%u Weight=%u ",
node_ptr[i].node_state, node_ptr[i].weight);
printf ("Features=%s Partition=%s\n",
node_ptr[i].features, node_ptr[i].partition);
if (node_name) { if (node_name) {
last_inx = i; last_inx = i;
break; break;
...@@ -416,10 +409,11 @@ print_node_list (char *node_list) ...@@ -416,10 +409,11 @@ print_node_list (char *node_list)
old_node_info_ptr = node_info_ptr; old_node_info_ptr = node_info_ptr;
if (quiet_flag == -1) if (quiet_flag == -1)
printf ("last_update_time=%ld\n", (long) node_info_ptr->last_update); printf ("last_update_time=%ld, records=%d\n",
(long) node_info_ptr->last_update, node_info_ptr->record_count);
if (node_list == NULL) { if (node_list == NULL) {
/*print_node (NULL, node_info_ptr);*/ print_node (NULL, node_info_ptr);
} }
else { else {
format = NULL; format = NULL;
...@@ -459,7 +453,7 @@ print_node_list (char *node_list) ...@@ -459,7 +453,7 @@ print_node_list (char *node_list)
sizeof (this_node_name)); sizeof (this_node_name));
else else
sprintf (this_node_name, format, i); sprintf (this_node_name, format, i);
/*print_node (this_node_name, node_info_ptr);*/ print_node (this_node_name, node_info_ptr);
} }
if (format) if (format)
xfree (format); xfree (format);
...@@ -484,10 +478,8 @@ print_part (char *partition_name) ...@@ -484,10 +478,8 @@ print_part (char *partition_name)
partition_table_msg_t *part_ptr = NULL; partition_table_msg_t *part_ptr = NULL;
if (old_part_info_ptr) { if (old_part_info_ptr) {
printf("old1=%ld, time1=%ld\n",(long)old_part_info_ptr, (long)old_part_info_ptr->last_update);
error_code = slurm_load_partitions (old_part_info_ptr->last_update, error_code = slurm_load_partitions (old_part_info_ptr->last_update,
&part_info_ptr); &part_info_ptr);
printf("time2=%ld, err=%d\n",(long)part_info_ptr->last_update, error_code);
if (error_code == 0) { if (error_code == 0) {
/* slurm_free_partition_info (old_part_info_ptr); */ /* slurm_free_partition_info (old_part_info_ptr); */
} }
...@@ -507,7 +499,6 @@ printf("time2=%ld, err=%d\n",(long)part_info_ptr->last_update, error_code); ...@@ -507,7 +499,6 @@ printf("time2=%ld, err=%d\n",(long)part_info_ptr->last_update, error_code);
} }
else else
old_part_info_ptr = part_info_ptr; old_part_info_ptr = part_info_ptr;
printf("old2=%ld\n",(long)old_part_info_ptr);
if (quiet_flag == -1) if (quiet_flag == -1)
printf ("last_update_time=%ld\n", (long) part_info_ptr->last_update); printf ("last_update_time=%ld\n", (long) part_info_ptr->last_update);
...@@ -521,6 +512,7 @@ printf("old2=%ld\n",(long)old_part_info_ptr); ...@@ -521,6 +512,7 @@ printf("old2=%ld\n",(long)old_part_info_ptr);
if (partition_name) if (partition_name)
break; break;
} }
/* Temporary logic to clean out immediately */
slurm_free_partition_info (old_part_info_ptr); slurm_free_partition_info (old_part_info_ptr);
old_part_info_ptr=NULL; old_part_info_ptr=NULL;
} }
......
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