1
1

complete implementation of parseable output

This commit was SVN r24929.
Этот коммит содержится в:
Ralph Castain 2011-07-23 22:23:24 +00:00
родитель ffe6f5f40e
Коммит 199804fc35

Просмотреть файл

@ -54,6 +54,7 @@
#include <dirent.h> #include <dirent.h>
#endif /* HAVE_DIRENT_H */ #endif /* HAVE_DIRENT_H */
#include "opal/util/basename.h"
#include "opal/util/cmd_line.h" #include "opal/util/cmd_line.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/opal_environ.h" #include "opal/util/opal_environ.h"
@ -903,7 +904,8 @@ static int parseable_print(orte_ps_mpirun_info_t *hnpinfo)
orte_job_t **jobs; orte_job_t **jobs;
orte_node_t **nodes; orte_node_t **nodes;
orte_proc_t *proc; orte_proc_t *proc;
char *loc; orte_app_context_t *app;
char *appname;
int i, j; int i, j;
printf("mpirun:%lu:num nodes:%d:num jobs:%d\n", printf("mpirun:%lu:num nodes:%d:num jobs:%d\n",
@ -930,17 +932,18 @@ static int parseable_print(orte_ps_mpirun_info_t *hnpinfo)
if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(jobs[i]->procs, j))) { if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(jobs[i]->procs, j))) {
continue; continue;
} }
if (NULL == proc->node) { app = (orte_app_context_t*)opal_pointer_array_get_item(jobs[i]->apps, proc->app_idx);
loc = "unassigned"; if (NULL == app) {
} else if (NULL == proc->node->name) { appname = strdup("NULL");
loc = "unknown";
} else { } else {
loc = proc->node->name; appname = opal_basename(app->app);
} }
printf("process_name:%s:rank:%s:pid:%lu:node:%s:state:%s\n", printf("process:%s:rank:%s:pid:%lu:node:%s:state:%s\n",
ORTE_NAME_PRINT(&proc->name), ORTE_VPID_PRINT(proc->name.vpid), appname, ORTE_VPID_PRINT(proc->name.vpid),
(unsigned long)proc->pid, loc, (unsigned long)proc->pid,
(NULL == proc->nodename) ? "unknown" : proc->nodename,
orte_proc_state_to_str(proc->state)); orte_proc_state_to_str(proc->state));
free(appname);
} }
} }