1
1

Remove the obsolete and largely unused orte_system_info structure. The only fields that were used in that struct were nodeid and nodename - these have been transferred to the orte_process_info structure.

Only one place used the user name field - session_dir, when formulating the name of the top-level directory. Accordingly, the code for getting the user's id has been moved to the session_dir code.

This commit was SVN r17926.
Этот коммит содержится в:
Ralph Castain 2008-03-23 23:10:15 +00:00
родитель 9222ea0d0a
Коммит dc7f45dafd
67 изменённых файлов: 213 добавлений и 597 удалений

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

@ -26,7 +26,7 @@
#include "btl_base_error.h"
#include "opal/util/show_help.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/types.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
@ -66,7 +66,7 @@ void mca_btl_base_error_no_nics(const char* transport,
asprintf(&procid, "%s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
opal_show_help("help-mpi-btl-base.txt", "btl:no-nics",
true, procid, transport, orte_system_info.nodename,
true, procid, transport, orte_process_info.nodename,
nic_name);
free(procid);
}

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

@ -27,7 +27,6 @@
#include <stdio.h>
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
@ -39,7 +38,7 @@ extern int mca_btl_base_out(const char*, ...);
#define BTL_OUTPUT(args) \
do { \
mca_btl_base_out("[%s]%s[%s:%d:%s] ", \
orte_system_info.nodename, \
orte_process_info.nodename, \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, __func__); \
mca_btl_base_out args; \
@ -50,7 +49,7 @@ do { \
#define BTL_ERROR(args) \
do { \
mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
orte_system_info.nodename, \
orte_process_info.nodename, \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, __func__); \
mca_btl_base_err args; \
@ -62,7 +61,7 @@ do { \
mca_btl_base_err("%s[%s:%d:%s] from %s ", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, __func__, \
orte_system_info.nodename); \
orte_process_info.nodename); \
if(proc && proc->proc_hostname) { \
mca_btl_base_err("to: %s ", proc->proc_hostname); \
} \
@ -76,7 +75,7 @@ do { \
do { \
if(mca_btl_base_verbose > 0) { \
mca_btl_base_err("[%s]%s[%s:%d:%s] ", \
orte_system_info.nodename, \
orte_process_info.nodename, \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, __func__); \
mca_btl_base_err args; \

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

@ -43,7 +43,7 @@
#include "ompi/mca/mpool/mpool.h"
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
#include "ompi/runtime/params.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include <errno.h>
#include <string.h>
#include <math.h>
@ -109,13 +109,13 @@ static void show_init_error(const char *file, int line,
}
opal_show_help("help-mpi-btl-openib.txt", "init-fail-no-mem",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
file, line, func, dev, str_limit);
if (NULL != str_limit) free(str_limit);
} else {
opal_show_help("help-mpi-btl-openib.txt", "init-fail-create-q",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
file, line, func, strerror(errno), errno, dev);
}
}

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

@ -275,7 +275,7 @@ static int btl_openib_async_hcah(struct mca_btl_openib_async_poll *hcas_poll, in
case IBV_EVENT_SRQ_ERR:
case IBV_EVENT_PORT_ERR:
opal_show_help("help-mpi-btl-openib.txt", "of error event",
true,orte_system_info.nodename, orte_process_info.pid,
true,orte_process_info.nodename, orte_process_info.pid,
event.event_type, openib_event_to_str(event.event_type),
xrc_event ? "true" : "false");
break;
@ -293,7 +293,7 @@ static int btl_openib_async_hcah(struct mca_btl_openib_async_poll *hcas_poll, in
break;
default:
opal_show_help("help-mpi-btl-openib.txt", "of unknown event",
true,orte_system_info.nodename, orte_process_info.pid,
true,orte_process_info.nodename, orte_process_info.pid,
event.event_type, xrc_event ? "true" : "false");
}
ibv_ack_async_event(&event);

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

@ -45,7 +45,7 @@
#include "opal/mca/paffinity/base/base.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/orte_globals.h"
#include "ompi/proc/proc.h"
@ -389,7 +389,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_hca_t *hca,
IB_DEFAULT_GID_PREFIX == subnet_id &&
mca_btl_openib_component.warn_default_gid_prefix) {
opal_show_help("help-mpi-btl-openib.txt", "default subnet prefix",
true, orte_system_info.nodename);
true, orte_process_info.nodename);
}
lmc = (1 << ib_port_attr->lmc);
@ -935,7 +935,7 @@ static int init_one_hca(opal_list_t *btl_list, struct ibv_device* ib_dev)
"XRC on device without XRC support", true,
mca_btl_openib_component.num_xrc_qps,
ibv_get_device_name(ib_dev),
orte_system_info.nodename);
orte_process_info.nodename);
ret = OMPI_SUCCESS;
goto error;
}
@ -957,7 +957,7 @@ static int init_one_hca(opal_list_t *btl_list, struct ibv_device* ib_dev)
if (mca_btl_openib_component.warn_no_hca_params_found) {
opal_show_help("help-mpi-btl-openib.txt",
"no hca params found", true,
orte_system_info.nodename,
orte_process_info.nodename,
hca->ib_dev_attr.vendor_id,
hca->ib_dev_attr.vendor_part_id);
}
@ -1396,7 +1396,7 @@ btl_openib_component_init(int *num_btl_modules,
if (mca_btl_openib_component.want_fork_support > 0) {
opal_show_help("help-mpi-btl-openib.txt",
"ibv_fork_init fail", true,
orte_system_info.nodename);
orte_process_info.nodename);
goto no_btls;
}
}
@ -1459,7 +1459,7 @@ btl_openib_component_init(int *num_btl_modules,
if(ret != OMPI_SUCCESS) {
opal_show_help("help-mpi-btl-openib.txt",
"error in hca init", true, orte_system_info.nodename);
"error in hca init", true, orte_process_info.nodename);
}
free(dev_sorted);
@ -1473,7 +1473,7 @@ btl_openib_component_init(int *num_btl_modules,
mca_btl_openib_component.warn_nonexistent_if) {
char *str = opal_argv_join(mca_btl_openib_component.if_list, ',');
opal_show_help("help-mpi-btl-openib.txt", "nonexistent port",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
((NULL != mca_btl_openib_component.if_include) ?
"in" : "ex"), str);
free(str);
@ -1481,7 +1481,7 @@ btl_openib_component_init(int *num_btl_modules,
if(0 == mca_btl_openib_component.ib_num_btls) {
opal_show_help("help-mpi-btl-openib.txt",
"no active ports found", true, orte_system_info.nodename);
"no active ports found", true, orte_process_info.nodename);
return NULL;
}

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

@ -152,7 +152,7 @@ int btl_openib_register_mca_params(void)
if (0 != ival) {
opal_show_help("help-mpi-btl-openib.txt",
"ibv_fork requested but not supported", true,
orte_system_info.nodename);
orte_process_info.nodename);
return OMPI_ERROR;
}
#endif
@ -177,7 +177,7 @@ int btl_openib_register_mca_params(void)
if (0 != ival) {
opal_show_help("help-mpi-btl-openib.txt",
"ibv_fork requested but not supported", true,
orte_system_info.nodename);
orte_process_info.nodename);
return OMPI_ERROR;
}
#endif
@ -424,7 +424,7 @@ int btl_openib_register_mca_params(void)
64, &ival, REGINT_GE_ZERO));
if(ival <= 1 || (ival & (ival - 1))) {
opal_show_help("help-mpi-btl-openib.txt", "wrong buffer alignment",
true, ival, orte_system_info.nodename, 64);
true, ival, orte_process_info.nodename, 64);
mca_btl_openib_component.buffer_alignment = 64;
} else {
mca_btl_openib_component.buffer_alignment = (uint32_t) ival;
@ -537,7 +537,7 @@ static int mca_btl_openib_mca_setup_qps(void)
if (0 == opal_argv_count(queues)) {
opal_show_help("help-mpi-btl-openib.txt",
"no qps in receive_queues", true,
orte_system_info.nodename, str);
orte_process_info.nodename, str);
return OMPI_ERROR;
}
@ -553,13 +553,13 @@ static int mca_btl_openib_mca_setup_qps(void)
num_xrc_qps++;
#else
opal_show_help("help-mpi-btl-openib.txt", "No XRC support", true,
orte_system_info.nodename, str);
orte_process_info.nodename, str);
goto error;
#endif
} else {
opal_show_help("help-mpi-btl-openib.txt",
"invalid qp type in receive_queues", true,
orte_system_info.nodename, str, queues[qp]);
orte_process_info.nodename, str, queues[qp]);
goto error;
}
qp++;
@ -567,14 +567,14 @@ static int mca_btl_openib_mca_setup_qps(void)
/* Current XRC implementation can't used with other QP types - PP and SRQ */
if (num_xrc_qps > 0 && (num_pp_qps > 0 || num_srq_qps > 0)) {
opal_show_help("help-mpi-btl-openib.txt", "XRC with PP or SRQ", true,
orte_system_info.nodename, str);
orte_process_info.nodename, str);
goto error;
}
/* Current XRC implementation can't used with btls_per_lid > 1 */
if (num_xrc_qps > 0 && mca_btl_openib_component.btls_per_lid > 1) {
opal_show_help("help-mpi-btl-openib.txt", "XRC with BTLs per LID", true,
orte_system_info.nodename, str, num_xrc_qps);
orte_process_info.nodename, str, num_xrc_qps);
goto error;
}
mca_btl_openib_component.num_pp_qps = num_pp_qps;
@ -599,7 +599,7 @@ static int mca_btl_openib_mca_setup_qps(void)
if (count < 3 || count > 6) {
opal_show_help("help-mpi-btl-openib.txt",
"invalid pp qp specification", true,
orte_system_info.nodename, queues[qp]);
orte_process_info.nodename, queues[qp]);
goto error;
}
mca_btl_openib_component.qp_infos[qp].type = MCA_BTL_OPENIB_PP_QP;
@ -627,7 +627,7 @@ static int mca_btl_openib_mca_setup_qps(void)
if(count < 3 || count > 5) {
opal_show_help("help-mpi-btl-openib.txt",
"invalid srq specification", true,
orte_system_info.nodename, queues[qp]);
orte_process_info.nodename, queues[qp]);
goto error;
}
mca_btl_openib_component.qp_infos[qp].type = (params[0][0] =='X') ?
@ -649,7 +649,7 @@ static int mca_btl_openib_mca_setup_qps(void)
if (rd_num <= rd_low) {
opal_show_help("help-mpi-btl-openib.txt", "rd_num must be > rd_low",
true, orte_system_info.nodename, queues[qp]);
true, orte_process_info.nodename, queues[qp]);
goto error;
}
mca_btl_openib_component.qp_infos[qp].rd_num = rd_num;
@ -672,14 +672,14 @@ static int mca_btl_openib_mca_setup_qps(void)
if (max_qp_size < max_size_needed) {
opal_show_help("help-mpi-btl-openib.txt",
"biggest qp size is too small", true,
orte_system_info.nodename, max_qp_size,
orte_process_info.nodename, max_qp_size,
max_size_needed);
ret = OMPI_ERROR;
goto error;
} else if (max_qp_size > max_size_needed) {
opal_show_help("help-mpi-btl-openib.txt",
"biggest qp size is too big", true,
orte_system_info.nodename, max_qp_size,
orte_process_info.nodename, max_qp_size,
max_size_needed);
opal_output(0, "The biggest QP size is bigger than maximum send size. "
"This is not optimal configuration as memory will be waisted.\n");
@ -688,7 +688,7 @@ static int mca_btl_openib_mca_setup_qps(void)
if (mca_btl_openib_component.ib_free_list_max > 0 &&
min_freelist_size > mca_btl_openib_component.ib_free_list_max) {
opal_show_help("help-mpi-btl-openib.txt", "freelist too small", true,
orte_system_info.nodename,
orte_process_info.nodename,
mca_btl_openib_component.ib_free_list_max,
min_freelist_size);
goto error;

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

@ -33,7 +33,6 @@
#include "opal/util/if.h"
#include "orte/util/proc_info.h"
#include "opal/util/printf.h"
#include "orte/util/sys_info.h"
#include "ompi/class/ompi_fifo.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/mca/pml/pml.h"

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

@ -32,7 +32,6 @@
#include "opal/util/if.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "ompi/mca/pml/pml.h"
#include "opal/mca/base/mca_base_param.h"

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

@ -33,7 +33,6 @@
#include "opal/util/if.h"
#include "orte/util/proc_info.h"
#include "opal/util/printf.h"
#include "orte/util/sys_info.h"
#include "ompi/class/ompi_fifo.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/mca/pml/pml.h"
@ -167,7 +166,7 @@ static int sm_btl_first_time_init(mca_btl_sm_t *sm_btl, int n)
/* set file name */
if(asprintf(&sm_ctl_file, "%s"OPAL_PATH_SEP"shared_mem_btl_module.%s",
orte_process_info.job_session_dir,
orte_system_info.nodename) < 0)
orte_process_info.nodename) < 0)
return OMPI_ERR_OUT_OF_RESOURCE;
/* Pass in a data segment alignment of 0 to get no data

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

@ -43,7 +43,6 @@
#include "opal/util/if.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/orte_globals.h"

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

@ -701,7 +701,7 @@ static int mca_btl_udapl_assign_netmask(mca_btl_udapl_module_t* udapl_btl)
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "interface not found",
true, orte_system_info.nodename, btl_addr_string));
true, orte_process_info.nodename, btl_addr_string));
return OMPI_ERROR;
}
@ -715,7 +715,7 @@ static int mca_btl_udapl_assign_netmask(mca_btl_udapl_module_t* udapl_btl)
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "netmask not found",
true, orte_system_info.nodename, btl_addr_string));
true, orte_process_info.nodename, btl_addr_string));
return OMPI_ERROR;
}
@ -729,7 +729,7 @@ static int mca_btl_udapl_assign_netmask(mca_btl_udapl_module_t* udapl_btl)
/* current uDAPL BTL does not support IPv6 */
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "IPv4 only",
true, orte_system_info.nodename));
true, orte_process_info.nodename));
return OMPI_ERROR;
}

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

@ -225,7 +225,7 @@ typedef struct mca_btl_udapl_reg_t mca_btl_udapl_reg_t;
do { \
if (verbose_level <= mca_btl_udapl_component.udapl_verbosity) { \
mca_btl_base_out("[%s]%s[%s:%d:%s] ", \
orte_system_info.nodename, \
orte_process_info.nodename, \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, __func__); \
mca_btl_base_out args; \

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

@ -426,7 +426,7 @@ static int mca_btl_udapl_modify_ia_list(DAT_COUNT *num_info_entries,
char *str = opal_argv_join(mca_btl_udapl_component.if_list, ',');
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "nonexistent entry",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
((NULL != mca_btl_udapl_component.if_include) ?
"in" : "ex"), str));
free(str);

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

@ -253,14 +253,14 @@ static int mca_btl_udapl_proc_address_match(
/* current uDAPL BTL only supports IPv4 */
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "IPv4 only",
true, orte_system_info.nodename));
true, orte_process_info.nodename));
return OMPI_ERROR;
}
if (MCA_BTL_UDAPL_INVALID_PEER_ADDR_IDX == *peer_addr_idx) {
BTL_UDAPL_VERBOSE_HELP(VERBOSE_SHOW_HELP,
("help-mpi-btl-udapl.txt", "no network match",
true, btl_addr_string, orte_system_info.nodename,
true, btl_addr_string, orte_process_info.nodename,
peer_proc->proc_ompi->proc_hostname));
return OMPI_ERR_OUT_OF_RESOURCE;
}

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

@ -35,7 +35,6 @@
#include "coll_sm2.h"
#include "ompi/mca/coll/base/base.h"
#include "orte/mca/rml/rml.h"
#include "orte/util/sys_info.h"
/*

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

@ -35,7 +35,6 @@
#include "coll_sm2.h"
#include "ompi/mca/coll/base/base.h"
#include "orte/mca/rml/rml.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
/*
@ -154,7 +153,7 @@ static int allocate_shared_file(size_t size, char **file_name,
unique_comm_id=(int)getpid();
len=asprintf(&f_name,
"%s"OPAL_PATH_SEP"sm_coll_v2%s_%0d_%0d",orte_process_info.job_session_dir,
orte_system_info.nodename,ompi_comm_get_cid(comm),unique_comm_id);
orte_process_info.nodename,ompi_comm_get_cid(comm),unique_comm_id);
if( 0 > len ) {
return OMPI_ERROR;
}
@ -239,7 +238,7 @@ static int allocate_shared_file(size_t size, char **file_name,
*/
len=asprintf(&f_name,
"%s"OPAL_PATH_SEP"sm_coll_v2%s_%0d_%0d",orte_process_info.job_session_dir,
orte_system_info.nodename,ompi_comm_get_cid(comm),unique_comm_id);
orte_process_info.nodename,ompi_comm_get_cid(comm),unique_comm_id);
if( 0 > len ) {
return OMPI_ERROR;
}
@ -732,7 +731,7 @@ mca_coll_sm2_comm_query(struct ompi_communicator_t *comm, int *priority)
/*
len=asprintf(&(sm_module->coll_sm2_file_name),
"%s"OPAL_PATH_SEP"sm_coll_v2%s_%0d\0",orte_process_info.job_session_dir,
orte_system_info.nodename,ompi_comm_get_cid(comm));
orte_process_info.nodename,ompi_comm_get_cid(comm));
if( 0 > len ) {
goto CLEANUP;
}

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

@ -35,7 +35,6 @@
#include "coll_sm2.h"
#include "ompi/mca/coll/base/base.h"
#include "orte/mca/rml/rml.h"
#include "orte/util/sys_info.h"
/* setup an multi-nomial tree - for each node in the tree

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

@ -46,7 +46,6 @@
#include "common_sm_mmap.h"
#include "opal/util/basename.h"
#include "opal/util/output.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/mca/rml/rml_types.h"
#include "orte/mca/rml/base/base.h"

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

@ -28,7 +28,6 @@
#include "opal/util/show_help.h"
#include "orte/util/name_fns.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_globals.h"
#include "ompi/runtime/params.h"
#include "mpool_base_tree.h"
@ -174,13 +173,13 @@ void mca_mpool_base_tree_print(void)
ompi_debug_show_mpi_alloc_mem_leaks < 0) {
opal_show_help("help-mpool-base.txt", "all mem leaks",
true, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orte_system_info.nodename,
orte_process_info.nodename,
orte_process_info.pid, leak_msg);
} else {
int i = num_leaks - ompi_debug_show_mpi_alloc_mem_leaks;
opal_show_help("help-mpool-base.txt", "some mem leaks",
true, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orte_system_info.nodename,
orte_process_info.nodename,
orte_process_info.pid, leak_msg, i,
(i > 1) ? "s were" : " was",
(i > 1) ? "are" : "is");

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

@ -26,7 +26,6 @@
#include "opal/mca/base/mca_base_param.h"
#include "mpool_rdma.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "ompi/runtime/params.h"
#include <unistd.h>
#ifdef HAVE_MALLOC_H

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

@ -32,7 +32,6 @@
#include "mpool_sm.h"
#include "ompi/mca/common/sm/common_sm_mmap.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "ompi/proc/proc.h"
/*
@ -250,7 +249,7 @@ static mca_mpool_base_module_t* mca_mpool_sm_init(
/* create initial shared memory mapping */
len = asprintf( &file_name, "%s"OPAL_PATH_SEP"shared_mem_pool.%s",
orte_process_info.job_session_dir,
orte_system_info.nodename );
orte_process_info.nodename );
if ( 0 > len ) {
return NULL;
}

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

@ -25,7 +25,6 @@
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "orte/util/sys_info.h"
#include "opal/dss/dss.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/proc_info.h"
@ -123,16 +122,16 @@ int ompi_proc_init(void)
rc = ompi_arch_compute_local_id(&ui32);
if (OMPI_SUCCESS != rc) return rc;
ompi_proc_local_proc->proc_nodeid = orte_system_info.nodeid;
ompi_proc_local_proc->proc_nodeid = orte_process_info.nodeid;
ompi_proc_local_proc->proc_arch = ui32;
if (ompi_mpi_keep_peer_hostnames) {
if (ompi_mpi_keep_fqdn_hostnames) {
/* use the entire FQDN name */
ompi_proc_local_proc->proc_hostname = strdup(orte_system_info.nodename);
ompi_proc_local_proc->proc_hostname = strdup(orte_process_info.nodename);
} else {
/* use the unqualified name */
char *tmp, *ptr;
tmp = strdup(orte_system_info.nodename);
tmp = strdup(orte_process_info.nodename);
if (NULL != (ptr = strchr(tmp, '.'))) {
*ptr = '\0';
}
@ -190,7 +189,7 @@ ompi_proc_get_info(void)
char *hostname;
void *data;
size_t datalen;
orte_vpid_t nodeid;
orte_nodeid_t nodeid;
/* Don't reset the information determined about the current
process during the init step. Saves time and problems if
@ -224,7 +223,7 @@ ompi_proc_get_info(void)
if (ret != ORTE_SUCCESS)
goto out;
ret = opal_dss.unpack(buf, &nodeid, &count, ORTE_VPID);
ret = opal_dss.unpack(buf, &nodeid, &count, ORTE_NODEID);
if (ret != ORTE_SUCCESS) {
ORTE_ERROR_LOG(ret);
goto out;
@ -262,7 +261,7 @@ ompi_proc_get_info(void)
#else
opal_show_help("help-mpi-runtime",
"heterogeneous-support-unavailable",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
hostname == NULL ? "<hostname unavailable>" :
hostname);
ret = OMPI_ERR_NOT_SUPPORTED;
@ -457,7 +456,7 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize, opal_buffer_t* buf)
OPAL_THREAD_UNLOCK(&ompi_proc_lock);
return rc;
}
rc = opal_dss.pack(buf, &(proclist[i]->proc_nodeid), 1, ORTE_VPID);
rc = opal_dss.pack(buf, &(proclist[i]->proc_nodeid), 1, ORTE_NODEID);
if(rc != ORTE_SUCCESS) {
ORTE_ERROR_LOG(rc);
OPAL_THREAD_UNLOCK(&ompi_proc_lock);
@ -509,14 +508,14 @@ ompi_proc_unpack(opal_buffer_t* buf,
char *new_hostname;
bool isnew = false;
int rc;
orte_vpid_t new_nodeid;
orte_nodeid_t new_nodeid;
rc = opal_dss.unpack(buf, &new_name, &count, ORTE_NAME);
if (rc != ORTE_SUCCESS) {
ORTE_ERROR_LOG(rc);
return rc;
}
rc = opal_dss.unpack(buf, &new_nodeid, &count, ORTE_VPID);
rc = opal_dss.unpack(buf, &new_nodeid, &count, ORTE_NODEID);
if (rc != ORTE_SUCCESS) {
ORTE_ERROR_LOG(rc);
return rc;
@ -547,7 +546,7 @@ ompi_proc_unpack(opal_buffer_t* buf,
#else
opal_show_help("help-mpi-runtime",
"heterogeneous-support-unavailable",
true, orte_system_info.nodename,
true, orte_process_info.nodename,
new_hostname == NULL ? "<hostname unavailable>" :
new_hostname);
return OMPI_ERR_NOT_SUPPORTED;
@ -604,16 +603,16 @@ int ompi_proc_refresh(void) {
return rc;
}
ompi_proc_local_proc->proc_nodeid = orte_system_info.nodeid;
ompi_proc_local_proc->proc_nodeid = orte_process_info.nodeid;
ompi_proc_local_proc->proc_arch = ui32;
if (ompi_mpi_keep_peer_hostnames) {
if (ompi_mpi_keep_fqdn_hostnames) {
/* use the entire FQDN name */
ompi_proc_local_proc->proc_hostname = strdup(orte_system_info.nodename);
ompi_proc_local_proc->proc_hostname = strdup(orte_process_info.nodename);
} else {
/* use the unqualified name */
char *tmp, *ptr;
tmp = strdup(orte_system_info.nodename);
tmp = strdup(orte_process_info.nodename);
if (NULL != (ptr = strchr(tmp, '.'))) {
*ptr = '\0';
}

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

@ -55,7 +55,7 @@ struct ompi_proc_t {
/** this process' name */
orte_process_name_t proc_name;
/** "nodeid" on which the proc resides - equiv to vpid of local daemon */
orte_vpid_t proc_nodeid;
orte_nodeid_t proc_nodeid;
/** PML specific proc data */
struct mca_pml_base_endpoint_t* proc_pml;
/** BML specific proc data */

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

@ -45,7 +45,6 @@
#include "opal/mca/crs/base/base.h"
#include "opal/runtime/opal_cr.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/mca/snapc/snapc.h"
#include "orte/mca/snapc/base/base.h"

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

@ -38,7 +38,6 @@
#include "orte/runtime/orte_globals.h"
#include "orte/util/name_fns.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/sys_info.h"
#include "ompi/communicator/communicator.h"
#include "ompi/proc/proc.h"
#include "ompi/runtime/mpiruntime.h"
@ -67,7 +66,7 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
gethostname. */
if (orte_initialized) {
host = orte_system_info.nodename;
host = orte_process_info.nodename;
} else {
gethostname(hostname, sizeof(hostname));
host = hostname;

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

@ -41,7 +41,6 @@
#include "opal/runtime/opal.h"
#include "opal/event/event.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
@ -597,7 +596,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
if (ompi_mpi_show_mca_params) {
ompi_show_all_mca_params(ompi_mpi_comm_world.c_my_rank,
nprocs,
orte_system_info.nodename);
orte_process_info.nodename);
}
/* wait for everyone to reach this point */

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

@ -46,7 +46,6 @@
#include "orte/mca/snapc/base/base.h"
#endif
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_cr.h"
@ -132,15 +131,14 @@ int orte_ess_base_app_setup(void)
}
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
"%s setting up session dir with\n\ttmpdir: %s\n\tuser %s\n\thost %s\n\tjobid %s\n\tprocid %s",
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s\n\tjobid %s\n\tprocid %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
orte_system_info.user, orte_system_info.nodename, jobid_str, procid_str));
orte_process_info.nodename, jobid_str, procid_str));
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_system_info.user,
orte_system_info.nodename, NULL,
orte_process_info.nodename, NULL,
jobid_str, procid_str))) {
if (jobid_str != NULL) free(jobid_str);
if (procid_str != NULL) free(procid_str);
@ -250,10 +248,6 @@ int orte_ess_base_app_finalize(void)
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;
}
@ -320,7 +314,6 @@ void orte_ess_base_app_abort(int status, bool report)
CLEANUP:
/* - Clean out the global structures
* (not really necessary, but good practice) */
orte_sys_info_finalize();
orte_proc_info_finalize();
/* Now Exit */

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

@ -48,7 +48,6 @@
#endif
#include "orte/mca/filem/base/base.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_cr.h"
@ -133,15 +132,14 @@ int orte_ess_base_orted_setup(void)
}
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
"%s setting up session dir with\n\ttmpdir: %s\n\tuser %s\n\thost %s\n\tjobid %s\n\tprocid %s",
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s\n\tjobid %s\n\tprocid %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
orte_system_info.user, orte_system_info.nodename, jobid_str, procid_str));
orte_process_info.nodename, jobid_str, procid_str));
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_system_info.user,
orte_system_info.nodename, NULL,
orte_process_info.nodename, NULL,
jobid_str, procid_str))) {
if (jobid_str != NULL) free(jobid_str);
if (procid_str != NULL) free(procid_str);
@ -278,9 +276,5 @@ int orte_ess_base_orted_finalize(void)
/* cleanup any lingering session directories */
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;
}

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

@ -41,7 +41,6 @@
#include "orte/mca/snapc/base/base.h"
#endif
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/session_dir.h"
#include "orte/runtime/orte_cr.h"
#include "orte/runtime/orte_globals.h"
@ -98,8 +97,7 @@ int orte_ess_base_tool_setup(void)
if (ORTE_SUCCESS != (ret = orte_session_dir_get_name(NULL,
&orte_process_info.tmpdir_base,
&orte_process_info.top_session_dir,
orte_system_info.user,
orte_system_info.nodename, NULL,
orte_process_info.nodename, NULL,
NULL, NULL))) {
ORTE_ERROR_LOG(ret);
error = "define session dir names";
@ -146,9 +144,5 @@ int orte_ess_base_tool_finalize(void)
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;
}

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

@ -27,7 +27,6 @@
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/grpcomm/base/base.h"
@ -74,7 +73,7 @@ static int rte_init(char flags)
cnos_get_rank(), nprocs);
return ORTE_ERR_FATAL;
}
orte_system_info.nodeid = map[cnos_get_rank()].nid;
orte_process_info.nodeid = map[cnos_get_rank()].nid;
/* MPI_Init needs the grpcomm framework, so we have to init it */
if (ORTE_SUCCESS != (rc = orte_grpcomm_base_open())) {
@ -97,7 +96,6 @@ static int rte_finalize(void)
orte_grpcomm_base_close();
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;

4
orte/mca/ess/env/ess_env_module.c поставляемый
Просмотреть файл

@ -63,7 +63,6 @@
#include "orte/mca/filem/base/base.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/sys_info.h"
#include "orte/util/hnp_contact.h"
#include "orte/util/name_fns.h"
@ -293,8 +292,7 @@ static int rte_ft_event(int state)
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_system_info.user,
orte_system_info.nodename,
orte_process_info.nodename,
NULL, /* Batch ID -- Not used */
jobid_str,
procid_str))) {

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

@ -56,7 +56,6 @@
#include "orte/mca/filem/base/base.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/sys_info.h"
#include "orte/util/hnp_contact.h"
#include "orte/util/name_fns.h"
@ -238,15 +237,14 @@ static int rte_init(char flags)
}
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
"%s setting up session dir with\n\ttmpdir: %s\n\tuser %s\n\thost %s\n\tjobid %s\n\tprocid %s",
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s\n\tjobid %s\n\tprocid %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
orte_system_info.user, orte_system_info.nodename, jobid_str, procid_str));
orte_process_info.nodename, jobid_str, procid_str));
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_system_info.user,
orte_system_info.nodename, NULL,
orte_process_info.nodename, NULL,
jobid_str, procid_str))) {
if (jobid_str != NULL) free(jobid_str);
if (procid_str != NULL) free(procid_str);
@ -296,7 +294,7 @@ static int rte_init(char flags)
/* create and store a node object where we are */
node = OBJ_NEW(orte_node_t);
node->name = strdup(orte_system_info.nodename);
node->name = strdup(orte_process_info.nodename);
node->index = opal_pointer_array_add(orte_node_pool, node);
/* create and store a proc object for us */
@ -441,7 +439,6 @@ static int rte_finalize(void)
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;
@ -476,7 +473,6 @@ static void rte_abort(int status, bool report)
/* - Clean out the global structures
* (not really necessary, but good practice)
*/
orte_sys_info_finalize();
orte_proc_info_finalize();
/* Now abort */

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

@ -38,7 +38,6 @@
#include "orte/runtime/orte_globals.h"
#include "opal/mca/base/mca_base_param.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/sys_info.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"

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

@ -27,7 +27,6 @@
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/ess/ess.h"
@ -113,12 +112,11 @@ static int rte_init(char flags)
"%s setting up session dir with\n\ttmpdir: %s\n\tuser %s\n\thost %s\n\tjobid %s\n\tprocid %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
orte_system_info.user, orte_system_info.nodename, jobid_str, vpid_string));
orte_process_info.nodename, jobid_str, vpid_string));
if (ORTE_SUCCESS != (rc = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_system_info.user,
orte_system_info.nodename, NULL,
orte_process_info.nodename, NULL,
jobid_str, vpid_string))) {
if (jobid_str != NULL) free(jobid_str);
if (vpid_string != NULL) free(vpid_string);
@ -150,7 +148,6 @@ static int rte_finalize(void)
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
/* clean out the global structures */
orte_sys_info_finalize();
orte_proc_info_finalize();
return ORTE_SUCCESS;

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

@ -35,7 +35,6 @@
#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/sys_info.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
@ -176,15 +175,15 @@ static int slurm_set_name(void)
"ess:slurm set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
/* fix up the system info nodename to match exactly what slurm returned */
if (NULL != orte_system_info.nodename) {
free(orte_system_info.nodename);
if (NULL != orte_process_info.nodename) {
free(orte_process_info.nodename);
}
orte_system_info.nodename = get_slurm_nodename(slurm_nodeid);
orte_process_info.nodename = get_slurm_nodename(slurm_nodeid);
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output,
"ess:slurm set nodename to %s",
orte_system_info.nodename));
orte_process_info.nodename));
/* get the non-name common environmental variables */
if (ORTE_SUCCESS != (rc = orte_ess_env_get())) {

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

@ -37,7 +37,6 @@
#include "orte/mca/plm/plm.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_cr.h"
#include "orte/mca/ess/ess.h"
@ -134,7 +133,6 @@ static void rte_abort(int status, bool report)
/* - Clean out the global structures
* (not really necessary, but good practice)
*/
orte_sys_info_finalize();
orte_proc_info_finalize();
/* Now abort */

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

@ -52,7 +52,7 @@
#include "orte/util/context_fns.h"
#include "orte/util/name_fns.h"
#include "orte/util/session_dir.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/orte_wait.h"
@ -598,7 +598,7 @@ static int odls_base_default_setup_fork(orte_app_context_t *context,
/* use same nodename as the starting daemon (us) */
param = mca_base_param_environ_variable("orte", "base", "nodename");
opal_setenv(param, orte_system_info.nodename, true, environ_copy);
opal_setenv(param, orte_process_info.nodename, true, environ_copy);
free(param);
/* push data into environment - don't push any single proc
@ -1791,7 +1791,7 @@ int orte_odls_base_default_kill_local_procs(orte_jobid_t job, bool set_state,
if (0 != (err = kill_local(child->pid, SIGTERM))) {
opal_show_help("help-odls-default.txt",
"odls-default:could-not-send-kill",
true, orte_system_info.nodename, child->pid, err);
true, orte_process_info.nodename, child->pid, err);
/* check the proc state - ensure it is in one of the termination
* states so that we properly wakeup
*/
@ -1817,7 +1817,7 @@ int orte_odls_base_default_kill_local_procs(orte_jobid_t job, bool set_state,
if (!child_died(child->pid, orte_odls_globals.timeout_before_sigkill, &exit_status)) {
opal_show_help("help-odls-default.txt",
"odls-default:could-not-kill",
true, orte_system_info.nodename, child->pid);
true, orte_process_info.nodename, child->pid);
}
}
child->state = ORTE_PROC_STATE_ABORTED_BY_SIG; /* we may have sent it, but that's what happened */

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

@ -34,7 +34,6 @@
#include "opal/util/show_help.h"
#include "opal/util/basename.h"
#include "orte/util/sys_info.h"
#include "orte/util/name_fns.h"
#include "orte/mca/errmgr/errmgr.h"

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

@ -26,7 +26,6 @@
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
@ -43,7 +42,7 @@ int orte_plm_base_set_hnp_name(void)
uint32_t bias;
/* hash the nodename */
OPAL_HASH_STR(orte_system_info.nodename, hash32);
OPAL_HASH_STR(orte_process_info.nodename, hash32);
bias = (uint32_t)orte_process_info.pid;

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

@ -77,7 +77,6 @@
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/session_dir.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_wait.h"
#include "orte/runtime/orte_wakeup.h"
#include "orte/mca/rml/rml.h"

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

@ -69,7 +69,6 @@
#include "opal/util/trace.h"
#include "opal/util/basename.h"
#include "orte/util/sys_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"

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

@ -71,7 +71,6 @@
#include "opal/util/trace.h"
#include "opal/util/basename.h"
#include "orte/util/sys_info.h"
#include "orte/util/session_dir.h"
#include "orte/runtime/orte_wait.h"

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

@ -61,7 +61,7 @@
#include "opal/util/trace.h"
#include "opal/util/basename.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/univ_info.h"
#include "orte/util/session_dir.h"
@ -651,7 +651,7 @@ int orte_plm_submit_launch(orte_job_t *jdata)
* match, check using ifislocal().
*/
if (!mca_plm_submit_component.force_submit &&
(0 == strcmp(nodes[nnode]->name, orte_system_info.nodename) ||
(0 == strcmp(nodes[nnode]->name, orte_process_info.nodename) ||
opal_ifislocal(nodes[nnode]->name))) {
if (mca_plm_submit_component.debug) {
opal_output(0, "plm:submit: %s is a LOCAL node\n",

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

@ -32,7 +32,7 @@
#include "orte/runtime/orte_globals.h"
#include "orte/util/hostfile/hostfile.h"
#include "orte/util/dash_host/dash_host.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/mca/ras/base/ras_private.h"
@ -260,10 +260,10 @@ int orte_ras_base_allocate(orte_job_t *jdata)
OBJ_DESTRUCT(&nodes);
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* use the same name we got in orte_system_info so we avoid confusion in
/* use the same name we got in orte_process_info so we avoid confusion in
* the session directories
*/
node->name = strdup(orte_system_info.nodename);
node->name = strdup(orte_process_info.nodename);
node->state = ORTE_NODE_STATE_UP;
node->slots_inuse = 0;
node->slots_max = 0;

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

@ -31,7 +31,7 @@
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/hostfile/hostfile.h"
#include "orte/util/dash_host/dash_host.h"
#include "orte/mca/errmgr/errmgr.h"
@ -139,7 +139,7 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
* names to be our node name, so we don't need
* to keep checking for that condition
*/
if (0 == strcmp(node->name, orte_system_info.nodename)) {
if (0 == strcmp(node->name, orte_process_info.nodename)) {
opal_list_remove_item(allocated_nodes, item);
OBJ_RELEASE(item); /* "un-retain" it */
break;

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

@ -54,7 +54,6 @@
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_wait.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/mca/plm/plm.h"
#include "orte/mca/odls/odls.h"

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

@ -58,7 +58,6 @@
#include "opal/dss/dss.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"

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

@ -56,7 +56,6 @@
#include "opal/util/daemon_init.h"
#include "opal/dss/dss.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
@ -151,7 +150,7 @@ opal_cmd_line_init_t orte_cmd_line_opts[] = {
"Direct the orted to separate from the current session"},
{ NULL, NULL, NULL, '\0', NULL, "nodename", 1,
&orte_system_info.nodename, OPAL_CMD_LINE_TYPE_STRING,
&orte_process_info.nodename, OPAL_CMD_LINE_TYPE_STRING,
"Node name as specified by host/resource description." },
{ "tmpdir", "base", NULL, '\0', NULL, "tmpdir", 1,
@ -412,7 +411,7 @@ int orte_daemon(int argc, char *argv[])
/* define a log file name in the session directory */
sprintf(log_file, "output-orted-%s-%s.log",
jobidstring, orte_system_info.nodename);
jobidstring, orte_process_info.nodename);
log_path = opal_os_path(false,
orte_process_info.tmpdir_base,
orte_process_info.top_session_dir,
@ -440,7 +439,7 @@ int orte_daemon(int argc, char *argv[])
if (orte_debug_daemons_flag) {
fprintf(stderr, "Daemon %s checking in as pid %ld on host %s\n",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (long)orte_process_info.pid,
orte_system_info.nodename);
orte_process_info.nodename);
}
/* We actually do *not* want the orted to voluntarily yield() the

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

@ -50,7 +50,6 @@
#include "orte/runtime/orte_cr.h"
#include "orte/runtime/runtime.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"
@ -340,9 +339,9 @@ static int orte_cr_coord_post_restart(void) {
orte_process_info.sock_stderr = NULL;
}
if( NULL != orte_system_info.nodename ) {
free(orte_system_info.nodename);
orte_system_info.nodename = NULL;
if( NULL != orte_process_info.nodename ) {
free(orte_process_info.nodename);
orte_process_info.nodename = NULL;
}
if( NULL != orte_process_info.my_hnp_uri ) {
@ -358,11 +357,6 @@ static int orte_cr_coord_post_restart(void) {
/*
* Refresh System information
*/
orte_system_info.init = false;
if( ORTE_SUCCESS != (ret = orte_sys_info()) ) {
exit_status = ret;
}
if( ORTE_SUCCESS != (ret = orte_proc_info()) ) {
exit_status = ret;
}

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

@ -57,6 +57,9 @@ int orte_finalize(void)
/* close the ess itself */
orte_ess_base_close();
/* cleanup the process info */
orte_proc_info_finalize();
/* finalize the opal utilities */
opal_finalize();

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

@ -40,7 +40,6 @@
#include "orte/mca/ess/ess.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/runtime.h"
#include "orte/runtime/orte_wait.h"
@ -87,13 +86,7 @@ int orte_init(char flags)
goto error;
}
/* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (ret = orte_sys_info())) {
error = "orte_sys_info";
goto error;
}
/* Ensure the process info structure is instantiated and initialized */
/* Ensure the process info structure is instantiated and initialized */
if (ORTE_SUCCESS != (ret = orte_proc_info())) {
error = "orte_proc_info";
goto error;

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

@ -9,7 +9,6 @@
#include <unistd.h>
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/runtime.h"
@ -29,7 +28,7 @@ int main(int argc, char* argv[])
pid = getpid();
printf("orte_nodename: Node %s %ld Name %s Pid %ld Local Rank: %ld Num_local_procs %ld\n",
hostname, (long)orte_system_info.nodeid, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (long)pid,
hostname, (long)orte_process_info.nodeid, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (long)pid,
(long)orte_process_info.local_rank, (long)orte_process_info.num_local_procs);
orte_finalize();

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

@ -49,6 +49,9 @@
#include <dirent.h>
#endif /* HAVE_DIRENT_H */
#include <signal.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif /* HAVE_PWD_H */
#include "opal/util/cmd_line.h"
#include "opal/util/argv.h"
@ -59,7 +62,6 @@
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "opal/util/os_path.h"
#include "orte/util/session_dir.h"
@ -257,7 +259,10 @@ void kill_procs(void) {
int procpid;
FILE *psfile;
char *inputline, *tmpline;
char *this_user;
int uid;
struct passwd *pwdent;
/*
* This is the command that is used to get the information about
* all the processes that are running. The output looks like the
@ -288,6 +293,21 @@ void kill_procs(void) {
*/
ortedpid = getppid();
/* get the name of the user */
uid = getuid();
#ifdef HAVE_GETPWUID
pwdent = getpwuid(uid);
#else
pwdent = NULL;
#endif
if (NULL != pwdent) {
this_user = strdup(pwdent->pw_name);
} else {
if (0 > asprintf(&this_user, "%d", uid)) {
return;
}
}
/*
* There is a race condition here. The problem is that we are looking
* for any processes named orted. However, one may erroneously find more
@ -309,6 +329,7 @@ void kill_procs(void) {
* USER.
*/
if (NULL == (inputline = orte_getline(psfile))) {
free(this_user);
return;
}
free(inputline); /* dump the header line */
@ -323,7 +344,7 @@ void kill_procs(void) {
user++; /* increment to point to the beginning of the user name */
/* if we are not the user, dump this input */
if (0 != strcmp(user, orte_system_info.user)) {
if (0 != strcmp(user, this_user)) {
/* not us */
free(inputline);
continue;
@ -407,6 +428,7 @@ void kill_procs(void) {
free(inputline);
free(tmpline);
}
free(this_user);
return;
}
#endif /* !defined(__WINDOWS__) */

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

@ -68,7 +68,6 @@
#include "opal/dss/dss.h"
#include "orte/runtime/runtime.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "opal/util/os_path.h"
#include "orte/util/session_dir.h"

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

@ -69,7 +69,6 @@
#include "opal/dss/dss.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/util/pre_condition_transports.h"
#include "orte/util/session_dir.h"
#include "orte/util/name_fns.h"

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

@ -30,7 +30,6 @@ headers += \
util/pre_condition_transports.h \
util/proc_info.h \
util/session_dir.h \
util/sys_info.h \
util/hnp_contact.h \
util/hostfile/hostfile.h \
util/hostfile/hostfile_lex.h \
@ -44,7 +43,6 @@ libopen_rte_la_SOURCES += \
util/pre_condition_transports.c \
util/proc_info.c \
util/session_dir.c \
util/sys_info.c \
util/hnp_contact.c \
util/hostfile/hostfile_lex.l \
util/hostfile/hostfile.c \

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

@ -29,7 +29,6 @@
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/plm/plm_types.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "orte/runtime/orte_globals.h"
#include "dash_host.h"
@ -78,7 +77,7 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes,
item = opal_list_get_next(item)) {
node = (orte_node_t*) item;
if (0 == strcmp(node->name, mapped_nodes[i]) ||
(0 == strcmp(node->name, orte_system_info.nodename) &&
(0 == strcmp(node->name, orte_process_info.nodename) &&
(0 == strcmp(mapped_nodes[i], "localhost") || opal_ifislocal(mapped_nodes[i])))) {
++node->slots;
break;
@ -98,7 +97,7 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes,
/* it is local, so use the local nodename to avoid
* later confusion
*/
node->name = strdup(orte_system_info.nodename);
node->name = strdup(orte_process_info.nodename);
} else {
/* not local - use the given name */
node->name = strdup(mapped_nodes[i]);
@ -192,7 +191,7 @@ int orte_util_filter_dash_host_nodes(opal_list_t *nodes,
* is a local interface as found by opal_ifislocal
*/
if (0 == strcmp(node->name, mapped_nodes[i]) ||
(0 == strcmp(node->name, orte_system_info.nodename) &&
(0 == strcmp(node->name, orte_process_info.nodename) &&
(0 == strcmp(mapped_nodes[i], "localhost") || opal_ifislocal(mapped_nodes[i])))) {
found = true; /* found it - leave it alone */
j++;

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

@ -39,7 +39,7 @@
#include "opal/util/path.h"
#include "opal/mca/installdirs/installdirs.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/name_fns.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/ras/ras_types.h"
@ -181,7 +181,7 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc
if (strcmp(node_name, "localhost") == 0 || opal_ifislocal(node_name)) {
/* Nodename has been allocated, that is for sure */
free (node_name);
node_name = strdup(orte_system_info.nodename);
node_name = strdup(orte_process_info.nodename);
}
/* Do we need to make a new node object? First check to see
@ -202,7 +202,7 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc
if (strcmp(node_name, "localhost") == 0 || opal_ifislocal(node_name)) {
/* Nodename has been allocated, that is for sure */
free (node_name);
node_name = strdup(orte_system_info.nodename);
node_name = strdup(orte_process_info.nodename);
}
/* Do we need to make a new node object? First check to see
@ -498,7 +498,7 @@ int orte_util_filter_hostfile_nodes(opal_list_t *nodes,
* we have to check for localhost and local interfaces
*/
if (0 == strcmp(node_from_file->name, node_from_list->name) ||
(0 == strcmp(node_from_list->name, orte_system_info.nodename) &&
(0 == strcmp(node_from_list->name, orte_process_info.nodename) &&
(0 == strcmp(node_from_file->name, "localhost") ||
opal_ifislocal(node_from_file->name)))) {
node_found = true;

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

@ -20,6 +20,7 @@
#include "orte/constants.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@ -49,6 +50,8 @@ ORTE_DECLSPEC orte_proc_info_t orte_process_info = {
/* .num_procs = */ 1,
/* .local_rank = */ ORTE_VPID_INVALID,
/* .num_local_procs = */ 0,
/* .nodeid = */ ORTE_NODEID_INVALID,
/* .nodename = */ NULL,
/* .pid = */ 0,
/* .singleton = */ false,
/* .daemon = */ false,
@ -63,6 +66,7 @@ ORTE_DECLSPEC orte_proc_info_t orte_process_info = {
/* .sock_stderr = */ NULL
};
#define ORTE_MAX_HOSTNAME_SIZE 512
int orte_proc_info(void)
{
@ -70,7 +74,7 @@ int orte_proc_info(void)
int tmp;
char *uri, *ptr;
size_t len, i;
char hostname[ORTE_MAX_HOSTNAME_SIZE];
mca_base_param_reg_string_name("orte", "hnp_uri",
"HNP contact info",
true, false, NULL, &uri);
@ -126,6 +130,19 @@ int orte_proc_info(void)
/* get the process id */
orte_process_info.pid = getpid();
/* get the nodeid */
mca_base_param_reg_int_name("orte", "nodeid",
"ORTE ID for this node",
false, false, ORTE_NODEID_INVALID, &tmp);
orte_process_info.nodeid = (orte_nodeid_t)tmp;
/* get the nodename */
gethostname(hostname, ORTE_MAX_HOSTNAME_SIZE);
/* overwrite with value if in environment */
mca_base_param_reg_string_name("orte", "base_nodename",
"Name of this node, as provided in environment",
false, false, hostname, &(orte_process_info.nodename));
return ORTE_SUCCESS;
}
@ -150,8 +167,14 @@ int orte_proc_info_finalize(void)
if (NULL != orte_process_info.proc_session_dir) {
free(orte_process_info.proc_session_dir);
orte_process_info.proc_session_dir = NULL;
}
if (NULL != orte_process_info.nodename) {
free(orte_process_info.nodename);
orte_process_info.nodename = NULL;
}
if (NULL != orte_process_info.sock_stdin) {
free(orte_process_info.sock_stdin);
orte_process_info.sock_stdin = NULL;

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

@ -57,6 +57,8 @@ struct orte_proc_info_t {
orte_vpid_t num_procs; /**< number of processes in this job */
orte_vpid_t local_rank; /**< local rank on this node */
orte_std_cntr_t num_local_procs; /**< total number of procs on this node */
orte_nodeid_t nodeid; /**< numerical id for this node */
char *nodename; /**< string name for this node */
pid_t pid; /**< Local process ID for this process */
bool singleton; /**< I am a singleton */
bool daemon; /**< Indicate whether or not I am a daemon */

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

@ -41,13 +41,15 @@
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif /* HAVE_DIRENT_H */
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif /* HAVE_PWD_H */
#include "opal/util/output.h"
#include "opal/util/os_path.h"
#include "opal/util/os_dirpath.h"
#include "opal/util/basename.h"
#include "orte/util/sys_info.h"
#include "orte/util/proc_info.h"
#include "orte/util/name_fns.h"
@ -112,7 +114,7 @@ int
orte_session_dir_get_name(char **fulldirpath,
char **return_prefix, /* This will come back as the valid tmp dir */
char **return_frontend,
char *usr, char *hostid,
char *hostid,
char *batchid,
char *job, char *proc) {
char *hostname = NULL,
@ -123,27 +125,41 @@ orte_session_dir_get_name(char **fulldirpath,
*frontend = NULL;
bool prefix_provided = false;
int exit_status = ORTE_SUCCESS;
#ifndef __WINDOWS__
int uid;
struct passwd *pwdent;
#else
#define INFO_BUF_SIZE 256
TCHAR info_buf[INFO_BUF_SIZE];
DWORD info_buf_length = INFO_BUF_SIZE;
#endif
/* Ensure that system info is set */
orte_sys_info();
orte_proc_info();
/*
* set the 'user' value
*/
if( NULL != usr) { /* User specified version */
user = strdup(usr);
}
else { /* check if it is set elsewhere */
if( NULL != orte_system_info.user)
user = strdup(orte_system_info.user);
else {
/* Couldn't find it, so fail */
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
exit_status = ORTE_ERR_BAD_PARAM;
goto cleanup;
/* get the name of the user */
#ifndef __WINDOWS__
uid = getuid();
#ifdef HAVE_GETPWUID
pwdent = getpwuid(uid);
#else
pwdent = NULL;
#endif
if (NULL != pwdent) {
user = strdup(pwdent->pw_name);
} else {
if (0 > asprintf(&user, "%d", uid)) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
#else
if (!GetUserName(info_buf, &info_buf_length)) {
user = strdup("unknown");
} else {
user = strdup(info_buf);
}
#endif
/*
* set the 'hostname'
*/
@ -151,8 +167,8 @@ orte_session_dir_get_name(char **fulldirpath,
hostname = strdup(hostid);
}
else { /* check if it is set elsewhere */
if( NULL != orte_system_info.nodename)
hostname = strdup(orte_system_info.nodename);
if( NULL != orte_process_info.nodename)
hostname = strdup(orte_process_info.nodename);
else {
/* Couldn't find it, so fail */
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
@ -292,7 +308,7 @@ orte_session_dir_get_name(char **fulldirpath,
* Construct the session directory and create it if necessary
*/
int orte_session_dir(bool create,
char *prefix, char *usr, char *hostid,
char *prefix, char *hostid,
char *batchid, char *job, char *proc)
{
char *fulldirpath = NULL,
@ -324,7 +340,7 @@ int orte_session_dir(bool create,
if( ORTE_SUCCESS != ( rtn = orte_session_dir_get_name(&fulldirpath,
&prefix,
&frontend,
usr, hostid,
hostid,
batchid, job,
proc) ) ) {
return_code = rtn;

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

@ -104,15 +104,11 @@ BEGIN_C_DECLS
* placed. A value of "NULL" indicates that the user
* specified no location - hence, the function explores
* a range of "standard" locations.
* @param user Name of the user to whom the universe belongs. This will
* be used to build the name of the
* "openmpi-sessions-[user]@[host]:[batch]" branch of
* the directory tree.
* @param hostid Name of the host on which the session directory is
* being built. Used to build the name of the
* "openmpi-sessions-[user]@[host]:[batch]" branch of
* the directory tree. NULL indicates that the nodename
* found in orte_system_info is to be used.
* found in orte_process_info is to be used.
* @param batchid Batch job name, used in batch scheduling
* systems. NULL indicates that the default of "0" is
* to be used.
@ -129,7 +125,7 @@ BEGIN_C_DECLS
* @retval OMPI_ERROR The directory cannot be found (if create is
* "false") or created (if create is "true").
*/
ORTE_DECLSPEC int orte_session_dir(bool create, char *prefix, char *user, char *hostid,
ORTE_DECLSPEC int orte_session_dir(bool create, char *prefix, char *hostid,
char *batchid, char *job, char *vpid);
/*
@ -139,7 +135,7 @@ ORTE_DECLSPEC int orte_session_dir(bool create, char *prefix, char *user, char *
ORTE_DECLSPEC int orte_session_dir_get_name(char **fulldirpath,
char **prfx,
char **frontend,
char *usr, char *hostid,
char *hostid,
char *batchid,
char *job, char *proc);

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

@ -1,180 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include "orte/types.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <stdlib.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif /* HAVE_PWD_H */
#include <sys/stat.h>
#include "opal/util/output.h"
#include "opal/util/printf.h"
#include "opal/mca/base/mca_base_param.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/sys_info.h"
orte_sys_info_t orte_system_info = {
/* .init = */ false,
/* .sysname = */ NULL,
/* .nodename = */ NULL,
/* .nodeid = */ ORTE_VPID_INVALID,
/* .release = */ NULL,
/* .version = */ NULL,
/* .machine = */ NULL,
/* .user = */ NULL,
/* .suffix = */ NULL};
int orte_sys_info(void)
{
struct utsname sys_info;
int nval;
#ifndef __WINDOWS__
int uid;
struct passwd *pwdent;
#else
#define INFO_BUF_SIZE 256
TCHAR info_buf[INFO_BUF_SIZE];
DWORD info_buf_length = INFO_BUF_SIZE;
#endif
if (orte_system_info.init) {
return ORTE_SUCCESS;
}
if (0 > uname(&sys_info)) { /* have an error - set utsname values to indicate */
if (NULL != orte_system_info.sysname) {
free(orte_system_info.sysname);
orte_system_info.sysname = NULL;
}
if (NULL != orte_system_info.nodename) {
free(orte_system_info.nodename);
orte_system_info.nodename = NULL;
}
if (NULL != orte_system_info.release) {
free(orte_system_info.release);
orte_system_info.release = NULL;
}
if (NULL != orte_system_info.version) {
free(orte_system_info.version);
orte_system_info.version = NULL;
}
if (NULL != orte_system_info.machine) {
free(orte_system_info.machine);
orte_system_info.machine = NULL;
}
return ORTE_ERROR;
} else {
orte_system_info.sysname = strdup(sys_info.sysname);
if (NULL == orte_system_info.nodename) {
/* make sure we weren't given a nodename by environment */
int id = mca_base_param_register_string("orte", "base", "nodename",
NULL, sys_info.nodename);
mca_base_param_lookup_string(id, &(orte_system_info.nodename));
}
orte_system_info.release = strdup(sys_info.release);
orte_system_info.version = strdup(sys_info.version);
orte_system_info.machine = strdup(sys_info.machine);
}
/* get the name of the user */
#ifndef __WINDOWS__
uid = getuid();
#ifdef HAVE_GETPWUID
pwdent = getpwuid(uid);
#else
pwdent = NULL;
#endif
if (NULL != pwdent) {
orte_system_info.user = strdup(pwdent->pw_name);
} else {
if (0 > asprintf(&(orte_system_info.user), "%d", uid)) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
#else
if (!GetUserName(info_buf, &info_buf_length)) {
orte_system_info.user = strdup("unknown");
} else {
orte_system_info.user = strdup(info_buf);
}
#endif
/* get the nodeid */
mca_base_param_reg_int_name("orte", "nodeid",
"ORTE ID for this node",
false, false, ORTE_VPID_INVALID, &nval);
orte_system_info.nodeid = (orte_vpid_t)nval;
/* set the init flag */
orte_system_info.init = true; /* only indicates that we have been through here once - still have to test for NULL values */
return(ORTE_SUCCESS);
}
int orte_sys_info_finalize(void)
{
if (NULL != orte_system_info.sysname) {
free(orte_system_info.sysname);
orte_system_info.sysname = NULL;
}
if (NULL != orte_system_info.nodename) {
free(orte_system_info.nodename);
orte_system_info.nodename = NULL;
}
if (NULL != orte_system_info.release) {
free(orte_system_info.release);
orte_system_info.release = NULL;
}
if (NULL != orte_system_info.version) {
free(orte_system_info.version);
orte_system_info.version = NULL;
}
if (NULL != orte_system_info.machine) {
free(orte_system_info.machine);
orte_system_info.machine = NULL;
}
if (NULL != orte_system_info.user) {
free(orte_system_info.user);
orte_system_info.user = NULL;
}
if (NULL != orte_system_info.suffix) {
free(orte_system_info.suffix);
orte_system_info.suffix = NULL;
}
orte_system_info.init = false;
return ORTE_SUCCESS;
}

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

@ -1,102 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* Populates global structure with system-specific information.
*
* Notes: add limits.h, compute size of integer and other types via sizeof(type)*CHAR_BIT
*
*/
#ifndef _ORTE_SYS_INFO_H_
#define _ORTE_SYS_INFO_H_
#include "orte_config.h"
#include "orte/types.h"
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
BEGIN_C_DECLS
/**
* System information structure
*
* The orte_sys_info() function fills the sysname, nodename, release, version, machine,
* and user fields
*
*/
struct orte_sys_info_t {
bool init; /**< Certifies that values have been filled.
* Certifies that the orte_sys_info() function has been
* called at least once so fields have valid values
*/
char *sysname; /**< Name of OS in use on this node. */
char *nodename; /**< Fully qualified host name on the network. */
orte_vpid_t nodeid;
char *release; /**< Release level of the operating system. */
char *version; /**< Version of the operating system release. */
char *machine; /**< Type of hardware composing this node. */
char *user; /**< User id on this system. */
char *suffix; /**< Automatic suffix added to file names.
* Some computing environments automatically "tag" files
* created by applications with a computer-generated suffix
* to ensure uniqueness of the file name. This field records
* that value for future use.
*/
};
typedef struct orte_sys_info_t orte_sys_info_t;
ORTE_DECLSPEC extern orte_sys_info_t orte_system_info;
/**
* \internal
*
* Discover and record a wide range of information about the system
* upon which this code is executing. orte_sys_info populates a global
* variable with information about the system upon which the process
* is executing.
*
* Called from \c orte_init.
*
* @retval ORTE_SUCCESS If values are successfully determined.
* @retval ORTE_ERROR If the system does not provide the requested information.
*/
ORTE_DECLSPEC int orte_sys_info(void);
/*
* \internal
*
* Free any memory held in the system_info structure
*
* Called from \c orte_finalize
*
* @retval ORTE_SUCCESS If all values successfully released
* @retval ORTE_ERROR If any problems occur
*/
ORTE_DECLSPEC int orte_sys_info_finalize(void);
END_C_DECLS
#endif

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

@ -24,7 +24,6 @@ check_PROGRAMS = \
opal_if \
opal_os_path \
opal_timer \
orte_sys_info \
opal_os_create_dirpath \
orte_session_dir \
opal_argv \

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

@ -33,7 +33,6 @@
#include "orte/orte_constants.h"
#include "orte/mca/ns/ns_types.h"
#include "orte/util/proc_info.h"
#include "orte/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/os_dirpath.h"
#include "orte/util/session_dir.h"
@ -56,7 +55,6 @@ static FILE *test_out=NULL;
int main(int argc, char* argv[])
{
orte_sys_info(); /* initialize system */
orte_proc_info(); /* initialize proc info structure */
orte_process_info.my_name = (orte_process_name_t*)malloc(sizeof(orte_process_name_t));
orte_process_info.my_name->cellid = 0;
@ -141,7 +139,6 @@ int main(int argc, char* argv[])
fclose(test_out);
/* clean up */
orte_sys_info_finalize();
orte_proc_info_finalize();
test_finalize();
@ -160,14 +157,14 @@ static bool test1(void)
clear_proc_info();
prefix = opal_os_path(false, "tmp", NULL);
if (ORTE_ERROR == orte_session_dir(true, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, prefix, NULL, NULL, "test-universe", NULL, NULL)) {
fprintf(test_out, "test1 - couldn't create specified path\n");
free(prefix);
return(false);
}
/* see if it can access an existing path */
if (ORTE_ERROR == orte_session_dir(false, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(false, prefix, NULL, NULL, "test-universe", NULL, NULL)) {
fprintf(test_out, "test1 - couldn't access existing path\n");
free(prefix);
return(false);
@ -189,7 +186,7 @@ static bool test2(void)
setenv("OMPI_PREFIX_ENV", "/tmp/trythis", 1);
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("OMPI_PREFIX_ENV");
return(false);
}
@ -210,7 +207,7 @@ static bool test3(void)
setenv("TMPDIR", "/tmp/trythis", 1);
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("TMPDIR");
return(false);
}
@ -231,7 +228,7 @@ static bool test4(void)
setenv("TMP", "/tmp/trythis", 1);
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("TMP");
return(false);
}
@ -252,7 +249,7 @@ static bool test5(void)
setenv("HOME", "/tmp/trythis", 1);
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("HOME");
return(false);
}
@ -274,7 +271,7 @@ static bool test6(void)
* Program should turn to default of /tmp (where "/" is whatever
* top-level directory is appropriate for given system)
*/
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, NULL, NULL, "test-universe", NULL, NULL)) {
return(false);
}
@ -292,7 +289,7 @@ static bool test7(void)
clear_proc_info();
/* create test proc session directory tree */
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe", "test-job", "test-proc")) {
if (ORTE_ERROR == orte_session_dir(true, NULL, "localhost", NULL, "test-universe", "test-job", "test-proc")) {
return(false);
}
@ -337,7 +334,7 @@ static bool test8(void)
clear_proc_info();
/* create test proc session directory tree */
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe2", "test-job2", "test-proc2")) {
if (ORTE_ERROR == orte_session_dir(true, NULL, "localhost", NULL, "test-universe2", "test-job2", "test-proc2")) {
return(false);
}

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

@ -1,83 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include "orte/util/sys_info.h"
#include "support.h"
static bool test1(void); /* verify it returns info */
static bool test2(void); /* test second time through */
int main(int argc, char* argv[])
{
test_init("orte_sys_info_t");
if (test1()) {
test_success();
}
else {
test_failure("orte_sys_info_t test1 failed");
}
if (test2()) {
test_success();
}
else {
test_failure("orte_sys_info_t test2 failed");
}
test_finalize();
return 0;
}
static bool test1(void)
{
/* Test trivial functionality. Program should return with init=true and all ptrs non-NULL */
orte_sys_info();
if (orte_system_info.init == false)
return(false);
if (orte_system_info.sysname == NULL ||
orte_system_info.nodename == NULL ||
orte_system_info.release == NULL ||
orte_system_info.version == NULL ||
orte_system_info.machine == NULL ||
orte_system_info.user == NULL)
return(false);
return true;
}
static bool test2(void)
{
/* test it a second time. system should return without crashing and with init=true */
orte_sys_info();
return(orte_system_info.init);
}