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