2004-06-29 08:50:40 +04:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-08-08 23:06:15 +04:00
|
|
|
#define _GNU_SOURCE
|
2004-06-29 08:50:40 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2004-06-29 11:02:57 +04:00
|
|
|
#include <sys/types.h>
|
2004-06-29 08:50:40 +04:00
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "include/constants.h"
|
2004-08-10 20:05:22 +04:00
|
|
|
#include "runtime/runtime.h"
|
2004-07-08 16:43:30 +04:00
|
|
|
#include "mca/ns/ns.h"
|
2004-07-14 01:01:30 +04:00
|
|
|
#include "mca/pcm/pcm.h"
|
2004-06-29 08:50:40 +04:00
|
|
|
#include "util/proc_info.h"
|
2004-07-14 22:08:34 +04:00
|
|
|
#include "util/sys_info.h"
|
|
|
|
#include "util/session_dir.h"
|
2004-06-29 08:50:40 +04:00
|
|
|
|
|
|
|
ompi_proc_info_t ompi_process_info = {
|
|
|
|
/* .init = */ false,
|
|
|
|
/* .pid = */ 0,
|
|
|
|
/* .name = */ NULL,
|
2004-07-08 16:43:30 +04:00
|
|
|
/* .seed = */ false,
|
2004-06-29 08:50:40 +04:00
|
|
|
/* .universe_session_dir = */ NULL,
|
|
|
|
/* .job_session_dir = */ NULL,
|
|
|
|
/* .proc_session_dir = */ NULL,
|
|
|
|
/* .sock_stdin = */ NULL,
|
|
|
|
/* .sock_stdout = */ NULL,
|
|
|
|
/* .sock_stderr = */ NULL};
|
|
|
|
|
|
|
|
|
|
|
|
int ompi_proc_info(void)
|
|
|
|
{
|
2004-07-14 22:08:34 +04:00
|
|
|
|
|
|
|
/* local variable */
|
|
|
|
int return_code=OMPI_SUCCESS;
|
|
|
|
|
2004-06-29 08:50:40 +04:00
|
|
|
if (ompi_process_info.init) { /* already done this - don't do it again */
|
2004-07-14 22:08:34 +04:00
|
|
|
return(OMPI_SUCCESS);
|
2004-06-29 08:50:40 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* get the process id */
|
|
|
|
ompi_process_info.pid = getpid();
|
|
|
|
|
2004-07-14 01:01:30 +04:00
|
|
|
/* set process name */
|
2004-08-10 20:05:22 +04:00
|
|
|
ompi_process_info.name = ompi_rte_get_self();
|
2004-07-14 22:08:34 +04:00
|
|
|
|
2004-07-14 01:01:30 +04:00
|
|
|
/* set process to inited */
|
2004-06-29 08:50:40 +04:00
|
|
|
ompi_process_info.init = true;
|
2004-07-14 22:08:34 +04:00
|
|
|
|
|
|
|
return return_code;
|
2004-06-29 08:50:40 +04:00
|
|
|
}
|