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

Minor change to output format for node indicies.

parent e899ea15
No related branches found
No related tags found
No related merge requests found
...@@ -230,14 +230,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) ...@@ -230,14 +230,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
} }
sprintf(tmp_line, " %sIndices=", nodelist); sprintf(tmp_line, " %sIndices=", nodelist);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
for (j = 0; job_ptr->node_inx; j++) { for (j = 0; (job_ptr->node_inx && (job_ptr->node_inx[j] != -1));
j+=2) {
if (j > 0) if (j > 0)
sprintf(tmp_line, ",%d", job_ptr->node_inx[j]); xstrcat(out, ",");
else sprintf(tmp_line, "%d-%d", job_ptr->node_inx[j],
sprintf(tmp_line, "%d", job_ptr->node_inx[j]); job_ptr->node_inx[j+1]);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
if (job_ptr->node_inx[j] == -1)
break;
} }
if (one_liner) if (one_liner)
xstrcat(out, " "); xstrcat(out, " ");
...@@ -296,14 +295,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) ...@@ -296,14 +295,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
snprintf(tmp_line, sizeof(tmp_line), "Req%s=%s Req%sIndices=", snprintf(tmp_line, sizeof(tmp_line), "Req%s=%s Req%sIndices=",
nodelist, job_ptr->req_nodes, nodelist); nodelist, job_ptr->req_nodes, nodelist);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
for (j = 0; job_ptr->req_node_inx; j++) { for (j = 0; (job_ptr->req_node_inx && (job_ptr->req_node_inx[j] != -1));
j+=2) {
if (j > 0) if (j > 0)
sprintf(tmp_line, ",%d", job_ptr->req_node_inx[j]); xstrcat(out, ",");
else sprintf(tmp_line, "%d-%d", job_ptr->req_node_inx[j],
sprintf(tmp_line, "%d", job_ptr->req_node_inx[j]); job_ptr->req_node_inx[j+1]);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
if (job_ptr->req_node_inx[j] == -1)
break;
} }
if (one_liner) if (one_liner)
xstrcat(out, " "); xstrcat(out, " ");
...@@ -314,14 +312,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) ...@@ -314,14 +312,13 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
snprintf(tmp_line, sizeof(tmp_line), "Exc%s=%s Exc%sIndices=", snprintf(tmp_line, sizeof(tmp_line), "Exc%s=%s Exc%sIndices=",
nodelist, job_ptr->exc_nodes, nodelist); nodelist, job_ptr->exc_nodes, nodelist);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
for (j = 0; job_ptr->exc_node_inx; j++) { for (j = 0; (job_ptr->exc_node_inx && (job_ptr->exc_node_inx[j] != -1));
j+=2) {
if (j > 0) if (j > 0)
sprintf(tmp_line, ",%d", job_ptr->exc_node_inx[j]); xstrcat(out, ",");
else sprintf(tmp_line, "%d-%d", job_ptr->exc_node_inx[j],
sprintf(tmp_line, "%d", job_ptr->exc_node_inx[j]); job_ptr->exc_node_inx[j+1]);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
if (job_ptr->exc_node_inx[j] == -1)
break;
} }
if (one_liner) if (one_liner)
xstrcat(out, " "); xstrcat(out, " ");
......
...@@ -205,14 +205,13 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, ...@@ -205,14 +205,13 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
sprintf(tmp_line, "Nodes=%s NodeIndices=", part_ptr->nodes); sprintf(tmp_line, "Nodes=%s NodeIndices=", part_ptr->nodes);
#endif #endif
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
for (j = 0; part_ptr->node_inx; j++) { for (j = 0; (part_ptr->node_inx && (part_ptr->node_inx[j] != -1));
j+=2) {
if (j > 0) if (j > 0)
sprintf(tmp_line, ",%d", part_ptr->node_inx[j]); xstrcat(out, ",");
else sprintf(tmp_line, "%d-%d", part_ptr->node_inx[j],
sprintf(tmp_line, "%d", part_ptr->node_inx[j]); part_ptr->node_inx[j+1]);
xstrcat(out, tmp_line); xstrcat(out, tmp_line);
if (part_ptr->node_inx[j] == -1)
break;
} }
if (one_liner) if (one_liner)
xstrcat(out, "\n"); xstrcat(out, "\n");
......
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