* rename ompi_if to opal_if
* rename ompi_malloc to opal_malloc * rename ompi_numtostr to opal_numtostr * start of rename of ompi_environ to opal_environ This commit was SVN r6332.
Этот коммит содержится в:
родитель
e8afe9d9ef
Коммит
e55f99d23a
@ -246,28 +246,28 @@ typedef long long bool;
|
|||||||
*/
|
*/
|
||||||
#if OMPI_ENABLE_MEM_DEBUG
|
#if OMPI_ENABLE_MEM_DEBUG
|
||||||
|
|
||||||
/* It is safe to include util/malloc.h here because a) it will only
|
/* It is safe to include opal/util/malloc.h here because a) it will only
|
||||||
happen when we are building OMPI and therefore have a full OMPI
|
happen when we are building OMPI and therefore have a full OMPI
|
||||||
source tree [including headers] available, and b) we guaranteed to
|
source tree [including headers] available, and b) we guaranteed to
|
||||||
*not* to include anything else via util/malloc.h, so we won't
|
*not* to include anything else via opal/util/malloc.h, so we won't
|
||||||
have Cascading Includes Of Death. */
|
have Cascading Includes Of Death. */
|
||||||
# include "util/malloc.h"
|
# include "opal/util/malloc.h"
|
||||||
# if defined(malloc)
|
# if defined(malloc)
|
||||||
# undef malloc
|
# undef malloc
|
||||||
# endif
|
# endif
|
||||||
# define malloc(size) ompi_malloc((size), __FILE__, __LINE__)
|
# define malloc(size) opal_malloc((size), __FILE__, __LINE__)
|
||||||
# if defined(calloc)
|
# if defined(calloc)
|
||||||
# undef calloc
|
# undef calloc
|
||||||
# endif
|
# endif
|
||||||
# define calloc(nmembers, size) ompi_calloc((nmembers), (size), __FILE__, __LINE__)
|
# define calloc(nmembers, size) opal_calloc((nmembers), (size), __FILE__, __LINE__)
|
||||||
# if defined(realloc)
|
# if defined(realloc)
|
||||||
# undef realloc
|
# undef realloc
|
||||||
# endif
|
# endif
|
||||||
# define realloc(ptr, size) ompi_realloc((ptr), (size), __FILE__, __LINE__)
|
# define realloc(ptr, size) opal_realloc((ptr), (size), __FILE__, __LINE__)
|
||||||
# if defined(free)
|
# if defined(free)
|
||||||
# undef free
|
# undef free
|
||||||
# endif
|
# endif
|
||||||
# define free(ptr) ompi_free((ptr), __FILE__, __LINE__)
|
# define free(ptr) opal_free((ptr), __FILE__, __LINE__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we're mem debugging, make the OMPI_DEBUG_ZERO resolve to memset
|
* If we're mem debugging, make the OMPI_DEBUG_ZERO resolve to memset
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "gm_config.h"
|
#include "gm_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/btl/btl.h"
|
#include "mca/btl/btl.h"
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "gm_config.h"
|
#include "gm_config.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/btl/btl.h"
|
#include "mca/btl/btl.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/btl/btl.h"
|
#include "mca/btl/btl.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "datatype/convertor.h"
|
#include "datatype/convertor.h"
|
||||||
#include "include/sys/atomic.h"
|
#include "include/sys/atomic.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/printf.h"
|
#include "util/printf.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "include/sys/cache.h"
|
#include "include/sys/cache.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "datatype/convertor.h"
|
#include "datatype/convertor.h"
|
||||||
#include "include/sys/atomic.h"
|
#include "include/sys/atomic.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/printf.h"
|
#include "util/printf.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "include/sys/cache.h"
|
#include "include/sys/cache.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/btl/btl.h"
|
#include "mca/btl/btl.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/ptl/ptl.h"
|
#include "mca/ptl/ptl.h"
|
||||||
#include "mca/ptl/base/ptl_base_header.h"
|
#include "mca/ptl/base/ptl_base_header.h"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/ptl/ptl.h"
|
#include "mca/ptl/ptl.h"
|
||||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "include/sys/cache.h"
|
#include "include/sys/cache.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/ptl/ptl.h"
|
#include "mca/ptl/ptl.h"
|
||||||
#include "mca/pml/base/pml_base_sendreq.h"
|
#include "mca/pml/base/pml_base_sendreq.h"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "class/ompi_bitmap.h"
|
#include "class/ompi_bitmap.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
#include "mca/ptl/ptl.h"
|
#include "mca/ptl/ptl.h"
|
||||||
#include "mca/ptl/base/ptl_base_header.h"
|
#include "mca/ptl/base/ptl_base_header.h"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/pml/pml.h"
|
#include "mca/pml/pml.h"
|
||||||
@ -300,8 +300,8 @@ static int mca_ptl_tcp_create(int if_index, const char* if_name)
|
|||||||
ptl->ptl_bytes_sent = 0;
|
ptl->ptl_bytes_sent = 0;
|
||||||
ptl->ptl_send_handler = 0;
|
ptl->ptl_send_handler = 0;
|
||||||
#endif
|
#endif
|
||||||
ompi_ifindextoaddr(if_index, (struct sockaddr*)&ptl->ptl_ifaddr, sizeof(ptl->ptl_ifaddr));
|
opal_ifindextoaddr(if_index, (struct sockaddr*)&ptl->ptl_ifaddr, sizeof(ptl->ptl_ifaddr));
|
||||||
ompi_ifindextomask(if_index, (struct sockaddr*)&ptl->ptl_ifmask, sizeof(ptl->ptl_ifmask));
|
opal_ifindextomask(if_index, (struct sockaddr*)&ptl->ptl_ifmask, sizeof(ptl->ptl_ifmask));
|
||||||
|
|
||||||
/* allow user to specify interface bandwidth */
|
/* allow user to specify interface bandwidth */
|
||||||
sprintf(param, "bandwidth_%s", if_name);
|
sprintf(param, "bandwidth_%s", if_name);
|
||||||
@ -327,7 +327,7 @@ static int mca_ptl_tcp_create(int if_index, const char* if_name)
|
|||||||
|
|
||||||
static int mca_ptl_tcp_component_create_instances(void)
|
static int mca_ptl_tcp_component_create_instances(void)
|
||||||
{
|
{
|
||||||
int if_count = ompi_ifcount();
|
int if_count = opal_ifcount();
|
||||||
int if_index;
|
int if_index;
|
||||||
char **include;
|
char **include;
|
||||||
char **exclude;
|
char **exclude;
|
||||||
@ -346,7 +346,7 @@ static int mca_ptl_tcp_component_create_instances(void)
|
|||||||
argv = include = opal_argv_split(mca_ptl_tcp_component.tcp_if_include,',');
|
argv = include = opal_argv_split(mca_ptl_tcp_component.tcp_if_include,',');
|
||||||
while(argv && *argv) {
|
while(argv && *argv) {
|
||||||
char* if_name = *argv;
|
char* if_name = *argv;
|
||||||
int if_index = ompi_ifnametoindex(if_name);
|
int if_index = opal_ifnametoindex(if_name);
|
||||||
if(if_index < 0) {
|
if(if_index < 0) {
|
||||||
opal_output(0,"mca_ptl_tcp_component_init: invalid interface \"%s\"", if_name);
|
opal_output(0,"mca_ptl_tcp_component_init: invalid interface \"%s\"", if_name);
|
||||||
} else {
|
} else {
|
||||||
@ -362,12 +362,12 @@ static int mca_ptl_tcp_component_create_instances(void)
|
|||||||
* a PTL for each interface that was not excluded.
|
* a PTL for each interface that was not excluded.
|
||||||
*/
|
*/
|
||||||
exclude = opal_argv_split(mca_ptl_tcp_component.tcp_if_exclude,',');
|
exclude = opal_argv_split(mca_ptl_tcp_component.tcp_if_exclude,',');
|
||||||
for(if_index = ompi_ifbegin(); if_index >= 0; if_index = ompi_ifnext(if_index)) {
|
for(if_index = opal_ifbegin(); if_index >= 0; if_index = opal_ifnext(if_index)) {
|
||||||
char if_name[32];
|
char if_name[32];
|
||||||
ompi_ifindextoname(if_index, if_name, sizeof(if_name));
|
opal_ifindextoname(if_index, if_name, sizeof(if_name));
|
||||||
|
|
||||||
/* check to see if this interface exists in the exclude list */
|
/* check to see if this interface exists in the exclude list */
|
||||||
if(ompi_ifcount() > 1) {
|
if(opal_ifcount() > 1) {
|
||||||
argv = exclude;
|
argv = exclude;
|
||||||
while(argv && *argv) {
|
while(argv && *argv) {
|
||||||
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
|
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/util/cmd_line.h"
|
#include "opal/util/cmd_line.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
|
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ int mca_base_cmd_line_process_args(opal_cmd_line_t *cmd,
|
|||||||
|
|
||||||
for (i = 0; NULL != mca_param_argv[i]; ++i) {
|
for (i = 0; NULL != mca_param_argv[i]; ++i) {
|
||||||
name = mca_base_param_environ_variable(mca_param_argv[i], NULL, NULL);
|
name = mca_base_param_environ_variable(mca_param_argv[i], NULL, NULL);
|
||||||
ompi_setenv(name, mca_value_argv[i], true, env);
|
opal_setenv(name, mca_value_argv[i], true, env);
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "opal/class/opal_object.h"
|
#include "opal/class/opal_object.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
#include "runtime/opal.h"
|
#include "runtime/opal.h"
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ int opal_finalize(void)
|
|||||||
opal_class_finalize();
|
opal_class_finalize();
|
||||||
|
|
||||||
/* finalize the memory allocator */
|
/* finalize the memory allocator */
|
||||||
ompi_malloc_finalize();
|
opal_malloc_finalize();
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "orte_config.h"
|
#include "orte_config.h"
|
||||||
|
|
||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ int opal_init(void)
|
|||||||
{
|
{
|
||||||
|
|
||||||
/* initialize the memory allocator */
|
/* initialize the memory allocator */
|
||||||
ompi_malloc_init();
|
opal_malloc_init();
|
||||||
|
|
||||||
/* initialize the output system */
|
/* initialize the output system */
|
||||||
opal_output_init();
|
opal_output_init();
|
||||||
|
@ -20,4 +20,4 @@ strncpy.c
|
|||||||
sys_info.c
|
sys_info.c
|
||||||
universe_setup_file_io.c
|
universe_setup_file_io.c
|
||||||
univ_info.c
|
univ_info.c
|
||||||
ompi_environ.c
|
opal_environ.c
|
||||||
|
@ -35,7 +35,7 @@ headers = \
|
|||||||
if.h \
|
if.h \
|
||||||
malloc.h \
|
malloc.h \
|
||||||
numtostr.h \
|
numtostr.h \
|
||||||
ompi_environ.h \
|
opal_environ.h \
|
||||||
os_create_dirpath.h \
|
os_create_dirpath.h \
|
||||||
os_path.h \
|
os_path.h \
|
||||||
output.h \
|
output.h \
|
||||||
@ -60,7 +60,7 @@ libopalutil_la_SOURCES = \
|
|||||||
if.c \
|
if.c \
|
||||||
malloc.c \
|
malloc.c \
|
||||||
numtostr.c \
|
numtostr.c \
|
||||||
ompi_environ.c \
|
opal_environ.c \
|
||||||
os_create_dirpath.c \
|
os_create_dirpath.c \
|
||||||
os_path.c \
|
os_path.c \
|
||||||
output.c \
|
output.c \
|
||||||
|
176
opal/util/if.c
176
opal/util/if.c
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "opal/class/opal_list.h"
|
#include "opal/class/opal_list.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/strncpy.h"
|
#include "util/strncpy.h"
|
||||||
|
|
||||||
@ -67,7 +67,7 @@
|
|||||||
#define INADDR_NONE -1
|
#define INADDR_NONE -1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct ompi_if_t {
|
struct opal_if_t {
|
||||||
opal_list_item_t super;
|
opal_list_item_t super;
|
||||||
char if_name[IF_NAMESIZE];
|
char if_name[IF_NAMESIZE];
|
||||||
int if_index;
|
int if_index;
|
||||||
@ -84,9 +84,9 @@ struct ompi_if_t {
|
|||||||
#endif
|
#endif
|
||||||
uint32_t if_bandwidth;
|
uint32_t if_bandwidth;
|
||||||
};
|
};
|
||||||
typedef struct ompi_if_t ompi_if_t;
|
typedef struct opal_if_t opal_if_t;
|
||||||
|
|
||||||
static opal_list_t ompi_if_list;
|
static opal_list_t opal_if_list;
|
||||||
static bool already_done = false;
|
static bool already_done = false;
|
||||||
|
|
||||||
#define DEFAULT_NUMBER_INTERFACES 10
|
#define DEFAULT_NUMBER_INTERFACES 10
|
||||||
@ -96,7 +96,7 @@ static bool already_done = false;
|
|||||||
* interfaces that are not up or are local loopbacks.
|
* interfaces that are not up or are local loopbacks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int ompi_ifinit(void)
|
static int opal_ifinit(void)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
int sd;
|
int sd;
|
||||||
@ -112,7 +112,7 @@ static int ompi_ifinit(void)
|
|||||||
|
|
||||||
/* create the internet socket to test off */
|
/* create the internet socket to test off */
|
||||||
if((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
if((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||||
opal_output(0, "ompi_ifinit: socket() failed with errno=%d\n", errno);
|
opal_output(0, "opal_ifinit: socket() failed with errno=%d\n", errno);
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ static int ompi_ifinit(void)
|
|||||||
space. so we'll fall down and try to expand our
|
space. so we'll fall down and try to expand our
|
||||||
space */
|
space */
|
||||||
if (errno != EINVAL && lastlen != 0) {
|
if (errno != EINVAL && lastlen != 0) {
|
||||||
opal_output(0, "ompi_ifinit: ioctl(SIOCGIFCONF) failed with errno=%d",
|
opal_output(0, "opal_ifinit: ioctl(SIOCGIFCONF) failed with errno=%d",
|
||||||
errno);
|
errno);
|
||||||
close(sd);
|
close(sd);
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
@ -180,7 +180,7 @@ static int ompi_ifinit(void)
|
|||||||
/*
|
/*
|
||||||
* Setup indexes
|
* Setup indexes
|
||||||
*/
|
*/
|
||||||
OBJ_CONSTRUCT(&ompi_if_list, opal_list_t);
|
OBJ_CONSTRUCT(&opal_if_list, opal_list_t);
|
||||||
ptr = (char*) ifconf.ifc_req;
|
ptr = (char*) ifconf.ifc_req;
|
||||||
rem = ifconf.ifc_len;
|
rem = ifconf.ifc_len;
|
||||||
num = 0;
|
num = 0;
|
||||||
@ -188,8 +188,8 @@ static int ompi_ifinit(void)
|
|||||||
/* loop through all interfaces */
|
/* loop through all interfaces */
|
||||||
while (rem > 0) {
|
while (rem > 0) {
|
||||||
struct ifreq* ifr = (struct ifreq*) ptr;
|
struct ifreq* ifr = (struct ifreq*) ptr;
|
||||||
ompi_if_t intf;
|
opal_if_t intf;
|
||||||
ompi_if_t *intf_ptr;
|
opal_if_t *intf_ptr;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&intf, opal_list_item_t);
|
OBJ_CONSTRUCT(&intf, opal_list_item_t);
|
||||||
@ -215,7 +215,7 @@ static int ompi_ifinit(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(ioctl(sd, SIOCGIFFLAGS, ifr) < 0) {
|
if(ioctl(sd, SIOCGIFFLAGS, ifr) < 0) {
|
||||||
opal_output(0, "ompi_ifinit: ioctl(SIOCGIFFLAGS) failed with errno=%d", errno);
|
opal_output(0, "opal_ifinit: ioctl(SIOCGIFFLAGS) failed with errno=%d", errno);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((ifr->ifr_flags & IFF_UP) == 0)
|
if ((ifr->ifr_flags & IFF_UP) == 0)
|
||||||
@ -230,10 +230,10 @@ static int ompi_ifinit(void)
|
|||||||
intf.if_flags = ifr->ifr_flags;
|
intf.if_flags = ifr->ifr_flags;
|
||||||
|
|
||||||
#ifndef SIOCGIFINDEX
|
#ifndef SIOCGIFINDEX
|
||||||
intf.if_index = opal_list_get_size(&ompi_if_list)+1;
|
intf.if_index = opal_list_get_size(&opal_if_list)+1;
|
||||||
#else
|
#else
|
||||||
if(ioctl(sd, SIOCGIFINDEX, ifr) < 0) {
|
if(ioctl(sd, SIOCGIFINDEX, ifr) < 0) {
|
||||||
opal_output(0,"ompi_ifinit: ioctl(SIOCGIFINDEX) failed with errno=%d", errno);
|
opal_output(0,"opal_ifinit: ioctl(SIOCGIFINDEX) failed with errno=%d", errno);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if defined(ifr_ifindex)
|
#if defined(ifr_ifindex)
|
||||||
@ -246,7 +246,7 @@ static int ompi_ifinit(void)
|
|||||||
#endif /* SIOCGIFINDEX */
|
#endif /* SIOCGIFINDEX */
|
||||||
|
|
||||||
if(ioctl(sd, SIOCGIFADDR, ifr) < 0) {
|
if(ioctl(sd, SIOCGIFADDR, ifr) < 0) {
|
||||||
opal_output(0, "ompi_ifinit: ioctl(SIOCGIFADDR) failed with errno=%d", errno);
|
opal_output(0, "opal_ifinit: ioctl(SIOCGIFADDR) failed with errno=%d", errno);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(ifr->ifr_addr.sa_family != AF_INET)
|
if(ifr->ifr_addr.sa_family != AF_INET)
|
||||||
@ -254,19 +254,19 @@ static int ompi_ifinit(void)
|
|||||||
|
|
||||||
memcpy(&intf.if_addr, &ifr->ifr_addr, sizeof(intf.if_addr));
|
memcpy(&intf.if_addr, &ifr->ifr_addr, sizeof(intf.if_addr));
|
||||||
if(ioctl(sd, SIOCGIFNETMASK, ifr) < 0) {
|
if(ioctl(sd, SIOCGIFNETMASK, ifr) < 0) {
|
||||||
opal_output(0, "ompi_ifinit: ioctl(SIOCGIFNETMASK) failed with errno=%d", errno);
|
opal_output(0, "opal_ifinit: ioctl(SIOCGIFNETMASK) failed with errno=%d", errno);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
memcpy(&intf.if_mask, &ifr->ifr_addr, sizeof(intf.if_mask));
|
memcpy(&intf.if_mask, &ifr->ifr_addr, sizeof(intf.if_mask));
|
||||||
|
|
||||||
intf_ptr = (ompi_if_t*) malloc(sizeof(ompi_if_t));
|
intf_ptr = (opal_if_t*) malloc(sizeof(opal_if_t));
|
||||||
OMPI_DEBUG_ZERO(*intf_ptr);
|
OMPI_DEBUG_ZERO(*intf_ptr);
|
||||||
if(intf_ptr == 0) {
|
if(intf_ptr == 0) {
|
||||||
opal_output(0, "ompi_ifinit: unable to allocated %d bytes\n", sizeof(ompi_if_t));
|
opal_output(0, "opal_ifinit: unable to allocated %d bytes\n", sizeof(opal_if_t));
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
memcpy(intf_ptr, &intf, sizeof(intf));
|
memcpy(intf_ptr, &intf, sizeof(intf));
|
||||||
opal_list_append(&ompi_if_list, (opal_list_item_t*)intf_ptr);
|
opal_list_append(&opal_if_list, (opal_list_item_t*)intf_ptr);
|
||||||
}
|
}
|
||||||
free(ifconf.ifc_req);
|
free(ifconf.ifc_req);
|
||||||
close(sd);
|
close(sd);
|
||||||
@ -276,7 +276,7 @@ static int ompi_ifinit(void)
|
|||||||
/*
|
/*
|
||||||
1. check if the interface info list is already populated. If so, return
|
1. check if the interface info list is already populated. If so, return
|
||||||
2. get the interface information which is required using WSAIoctl
|
2. get the interface information which is required using WSAIoctl
|
||||||
3. construct ompi_if_list and populate it with the list of interfaces we have
|
3. construct opal_if_list and populate it with the list of interfaces we have
|
||||||
CAVEAT: Does not support the following options which are supported in SIOCGIFCONF
|
CAVEAT: Does not support the following options which are supported in SIOCGIFCONF
|
||||||
- kernel table index
|
- kernel table index
|
||||||
- interface name
|
- interface name
|
||||||
@ -291,8 +291,8 @@ static int ompi_ifinit(void)
|
|||||||
int i;
|
int i;
|
||||||
SOCKADDR_IN *sock_address;
|
SOCKADDR_IN *sock_address;
|
||||||
unsigned int interface_counter = 0;
|
unsigned int interface_counter = 0;
|
||||||
ompi_if_t intf;
|
opal_if_t intf;
|
||||||
ompi_if_t *intf_ptr;
|
opal_if_t *intf_ptr;
|
||||||
|
|
||||||
/* return if this has been done before */
|
/* return if this has been done before */
|
||||||
if (already_done) {
|
if (already_done) {
|
||||||
@ -303,7 +303,7 @@ static int ompi_ifinit(void)
|
|||||||
/* create a socket */
|
/* create a socket */
|
||||||
sd = WSASocket (AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0);
|
sd = WSASocket (AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0);
|
||||||
if (sd == SOCKET_ERROR) {
|
if (sd == SOCKET_ERROR) {
|
||||||
opal_output(0, "ompi_ifinit: WSASocket failed with errno=%d\n",WSAGetLastError());
|
opal_output(0, "opal_ifinit: WSASocket failed with errno=%d\n",WSAGetLastError());
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,12 +317,12 @@ static int ompi_ifinit(void)
|
|||||||
&num_bytes_returned,
|
&num_bytes_returned,
|
||||||
0,
|
0,
|
||||||
0)) {
|
0)) {
|
||||||
opal_output(0, "ompi_ifinit: WSAIoctl failed with errno=%d\n",WSAGetLastError());
|
opal_output(0, "opal_ifinit: WSAIoctl failed with errno=%d\n",WSAGetLastError());
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create and populate ompi_if_list */
|
/* create and populate opal_if_list */
|
||||||
OBJ_CONSTRUCT (&ompi_if_list, opal_list_t);
|
OBJ_CONSTRUCT (&opal_if_list, opal_list_t);
|
||||||
|
|
||||||
|
|
||||||
/* loop through all the interfaces and create the list */
|
/* loop through all the interfaces and create the list */
|
||||||
@ -346,7 +346,7 @@ static int ompi_ifinit(void)
|
|||||||
intf.if_flags = if_list[i].iiFlags;
|
intf.if_flags = if_list[i].iiFlags;
|
||||||
|
|
||||||
/* fill in the index in the table */
|
/* fill in the index in the table */
|
||||||
intf.if_index = opal_list_get_size(&ompi_if_list)+1;
|
intf.if_index = opal_list_get_size(&opal_if_list)+1;
|
||||||
|
|
||||||
/* generate the interface name on your own ....
|
/* generate the interface name on your own ....
|
||||||
loopback: lo
|
loopback: lo
|
||||||
@ -359,14 +359,14 @@ static int ompi_ifinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* copy all this into a persistent form and store it in the list */
|
/* copy all this into a persistent form and store it in the list */
|
||||||
intf_ptr = malloc(sizeof(ompi_if_t));
|
intf_ptr = malloc(sizeof(opal_if_t));
|
||||||
if (NULL == intf_ptr) {
|
if (NULL == intf_ptr) {
|
||||||
opal_output (0,"ompi_ifinit: Unable to malloc %d bytes",sizeof(opal_list_t));
|
opal_output (0,"opal_ifinit: Unable to malloc %d bytes",sizeof(opal_list_t));
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (intf_ptr, &intf, sizeof(intf));
|
memcpy (intf_ptr, &intf, sizeof(intf));
|
||||||
opal_list_append(&ompi_if_list, (opal_list_item_t *)intf_ptr);
|
opal_list_append(&opal_if_list, (opal_list_item_t *)intf_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,15 +379,15 @@ static int ompi_ifinit(void)
|
|||||||
* Finalize the list of configured interfaces to free malloc'd memory
|
* Finalize the list of configured interfaces to free malloc'd memory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_iffinalize(void)
|
int opal_iffinalize(void)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
ompi_if_t *intf_ptr;
|
opal_if_t *intf_ptr;
|
||||||
|
|
||||||
while (NULL != (intf_ptr = (ompi_if_t*)opal_list_remove_first(&ompi_if_list))) {
|
while (NULL != (intf_ptr = (opal_if_t*)opal_list_remove_first(&opal_if_list))) {
|
||||||
OBJ_RELEASE(intf_ptr);
|
OBJ_RELEASE(intf_ptr);
|
||||||
}
|
}
|
||||||
OBJ_DESTRUCT(&ompi_if_list);
|
OBJ_DESTRUCT(&opal_if_list);
|
||||||
#endif
|
#endif
|
||||||
already_done = false;
|
already_done = false;
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -399,16 +399,16 @@ int ompi_iffinalize(void)
|
|||||||
* as a dotted decimal formatted string.
|
* as a dotted decimal formatted string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifnametoaddr(const char* if_name, struct sockaddr* addr, int length)
|
int opal_ifnametoaddr(const char* if_name, struct sockaddr* addr, int length)
|
||||||
{
|
{
|
||||||
ompi_if_t* intf;
|
opal_if_t* intf;
|
||||||
int rc = ompi_ifinit();
|
int rc = opal_ifinit();
|
||||||
if(rc != OMPI_SUCCESS)
|
if(rc != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(strcmp(intf->if_name, if_name) == 0) {
|
if(strcmp(intf->if_name, if_name) == 0) {
|
||||||
memcpy(addr, &intf->if_addr, length);
|
memcpy(addr, &intf->if_addr, length);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -423,16 +423,16 @@ int ompi_ifnametoaddr(const char* if_name, struct sockaddr* addr, int length)
|
|||||||
* corresponding kernel index.
|
* corresponding kernel index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifnametoindex(const char* if_name)
|
int opal_ifnametoindex(const char* if_name)
|
||||||
{
|
{
|
||||||
ompi_if_t* intf;
|
opal_if_t* intf;
|
||||||
int rc = ompi_ifinit();
|
int rc = opal_ifinit();
|
||||||
if(rc != OMPI_SUCCESS)
|
if(rc != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(strcmp(intf->if_name, if_name) == 0) {
|
if(strcmp(intf->if_name, if_name) == 0) {
|
||||||
return intf->if_index;
|
return intf->if_index;
|
||||||
}
|
}
|
||||||
@ -446,9 +446,9 @@ int ompi_ifnametoindex(const char* if_name)
|
|||||||
* string or a hostname and lookup corresponding interface.
|
* string or a hostname and lookup corresponding interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
int opal_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
||||||
{
|
{
|
||||||
ompi_if_t* intf;
|
opal_if_t* intf;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
in_addr_t inaddr;
|
in_addr_t inaddr;
|
||||||
#else
|
#else
|
||||||
@ -459,7 +459,7 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
|||||||
|
|
||||||
inaddr = inet_addr(if_addr);
|
inaddr = inet_addr(if_addr);
|
||||||
|
|
||||||
rc = ompi_ifinit();
|
rc = opal_ifinit();
|
||||||
if (OMPI_SUCCESS != rc) {
|
if (OMPI_SUCCESS != rc) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -467,15 +467,15 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
|||||||
if(INADDR_NONE == inaddr) {
|
if(INADDR_NONE == inaddr) {
|
||||||
h = gethostbyname(if_addr);
|
h = gethostbyname(if_addr);
|
||||||
if(0 == h) {
|
if(0 == h) {
|
||||||
opal_output(0,"ompi_ifaddrtoname: unable to resolve %s\n", if_addr);
|
opal_output(0,"opal_ifaddrtoname: unable to resolve %s\n", if_addr);
|
||||||
return OMPI_ERR_NOT_FOUND;
|
return OMPI_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
memcpy(&inaddr, h->h_addr, sizeof(inaddr));
|
memcpy(&inaddr, h->h_addr, sizeof(inaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(intf->if_addr.sin_addr.s_addr == inaddr) {
|
if(intf->if_addr.sin_addr.s_addr == inaddr) {
|
||||||
strncpy(if_name, intf->if_name, length);
|
strncpy(if_name, intf->if_name, length);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -488,11 +488,11 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
|||||||
* Return the number of discovered interface.
|
* Return the number of discovered interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifcount(void)
|
int opal_ifcount(void)
|
||||||
{
|
{
|
||||||
if(ompi_ifinit() != OMPI_SUCCESS)
|
if(opal_ifinit() != OMPI_SUCCESS)
|
||||||
return (-1);
|
return (-1);
|
||||||
return opal_list_get_size(&ompi_if_list);
|
return opal_list_get_size(&opal_if_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -501,12 +501,12 @@ int ompi_ifcount(void)
|
|||||||
* interface in our list.
|
* interface in our list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifbegin(void)
|
int opal_ifbegin(void)
|
||||||
{
|
{
|
||||||
ompi_if_t *intf;
|
opal_if_t *intf;
|
||||||
if(ompi_ifinit() != OMPI_SUCCESS)
|
if(opal_ifinit() != OMPI_SUCCESS)
|
||||||
return (-1);
|
return (-1);
|
||||||
intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
if(NULL != intf)
|
if(NULL != intf)
|
||||||
return intf->if_index;
|
return intf->if_index;
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -519,19 +519,19 @@ int ompi_ifbegin(void)
|
|||||||
* (if it exists).
|
* (if it exists).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifnext(int if_index)
|
int opal_ifnext(int if_index)
|
||||||
{
|
{
|
||||||
ompi_if_t *intf;
|
opal_if_t *intf;
|
||||||
if(ompi_ifinit() != OMPI_SUCCESS)
|
if(opal_ifinit() != OMPI_SUCCESS)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(intf->if_index == if_index) {
|
if(intf->if_index == if_index) {
|
||||||
do {
|
do {
|
||||||
ompi_if_t* if_next = (ompi_if_t*)opal_list_get_next(intf);
|
opal_if_t* if_next = (opal_if_t*)opal_list_get_next(intf);
|
||||||
ompi_if_t* if_end = (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
opal_if_t* if_end = (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
if (if_next == if_end) {
|
if (if_next == if_end) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -549,16 +549,16 @@ int ompi_ifnext(int if_index)
|
|||||||
* primary address assigned to the interface.
|
* primary address assigned to the interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifindextoaddr(int if_index, struct sockaddr* if_addr, int length)
|
int opal_ifindextoaddr(int if_index, struct sockaddr* if_addr, int length)
|
||||||
{
|
{
|
||||||
ompi_if_t* intf;
|
opal_if_t* intf;
|
||||||
int rc = ompi_ifinit();
|
int rc = opal_ifinit();
|
||||||
if(rc != OMPI_SUCCESS)
|
if(rc != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(intf->if_index == if_index) {
|
if(intf->if_index == if_index) {
|
||||||
memcpy(if_addr, &intf->if_addr, length);
|
memcpy(if_addr, &intf->if_addr, length);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -573,16 +573,16 @@ int ompi_ifindextoaddr(int if_index, struct sockaddr* if_addr, int length)
|
|||||||
* network mask assigned to the interface.
|
* network mask assigned to the interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifindextomask(int if_index, struct sockaddr* if_mask, int length)
|
int opal_ifindextomask(int if_index, struct sockaddr* if_mask, int length)
|
||||||
{
|
{
|
||||||
ompi_if_t* intf;
|
opal_if_t* intf;
|
||||||
int rc = ompi_ifinit();
|
int rc = opal_ifinit();
|
||||||
if(rc != OMPI_SUCCESS)
|
if(rc != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(intf->if_index == if_index) {
|
if(intf->if_index == if_index) {
|
||||||
memcpy(if_mask, &intf->if_mask, length);
|
memcpy(if_mask, &intf->if_mask, length);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -598,16 +598,16 @@ int ompi_ifindextomask(int if_index, struct sockaddr* if_mask, int length)
|
|||||||
* the associated name.
|
* the associated name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ompi_ifindextoname(int if_index, char* if_name, int length)
|
int opal_ifindextoname(int if_index, char* if_name, int length)
|
||||||
{
|
{
|
||||||
ompi_if_t *intf;
|
opal_if_t *intf;
|
||||||
int rc = ompi_ifinit();
|
int rc = opal_ifinit();
|
||||||
if(rc != OMPI_SUCCESS)
|
if(rc != OMPI_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(intf = (ompi_if_t*)opal_list_get_first(&ompi_if_list);
|
for(intf = (opal_if_t*)opal_list_get_first(&opal_if_list);
|
||||||
intf != (ompi_if_t*)opal_list_get_end(&ompi_if_list);
|
intf != (opal_if_t*)opal_list_get_end(&opal_if_list);
|
||||||
intf = (ompi_if_t*)opal_list_get_next(intf)) {
|
intf = (opal_if_t*)opal_list_get_next(intf)) {
|
||||||
if(intf->if_index == if_index) {
|
if(intf->if_index == if_index) {
|
||||||
strncpy(if_name, intf->if_name, length);
|
strncpy(if_name, intf->if_name, length);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -618,19 +618,19 @@ int ompi_ifindextoname(int if_index, char* if_name, int length)
|
|||||||
|
|
||||||
#define ADDRLEN 100
|
#define ADDRLEN 100
|
||||||
bool
|
bool
|
||||||
ompi_ifislocal(char *hostname)
|
opal_ifislocal(char *hostname)
|
||||||
{
|
{
|
||||||
char addrname[ADDRLEN - 1];
|
char addrname[ADDRLEN - 1];
|
||||||
int ret;
|
int ret;
|
||||||
struct hostent *h;
|
struct hostent *h;
|
||||||
|
|
||||||
/* ompi_ifaddrtoname will complain (rightly) if hostname is not
|
/* opal_ifaddrtoname will complain (rightly) if hostname is not
|
||||||
resolveable. check to make sure it's resolveable. If not,
|
resolveable. check to make sure it's resolveable. If not,
|
||||||
definitely not local... */
|
definitely not local... */
|
||||||
h = gethostbyname(hostname);
|
h = gethostbyname(hostname);
|
||||||
if (NULL == h) return false;
|
if (NULL == h) return false;
|
||||||
|
|
||||||
ret = ompi_ifaddrtoname(hostname, addrname, ADDRLEN);
|
ret = opal_ifaddrtoname(hostname, addrname, ADDRLEN);
|
||||||
if (OMPI_SUCCESS == ret) return true;
|
if (OMPI_SUCCESS == ret) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _OMPI_IF_UTIL_
|
#ifndef OPAL_IF_UTIL_
|
||||||
#define _OMPI_IF_UTIL_
|
#define OPAL_IF_UTIL_
|
||||||
|
|
||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
* @param if_addr (OUT) Interface address buffer
|
* @param if_addr (OUT) Interface address buffer
|
||||||
* @param size (IN) Interface address buffer size
|
* @param size (IN) Interface address buffer size
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifnametoaddr(const char* if_name,
|
OMPI_DECLSPEC int opal_ifnametoaddr(const char* if_name,
|
||||||
struct sockaddr* if_addr, int size);
|
struct sockaddr* if_addr, int size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +46,7 @@ OMPI_DECLSPEC int ompi_ifnametoaddr(const char* if_name,
|
|||||||
* @param if_name (OUT) Interface name buffer
|
* @param if_name (OUT) Interface name buffer
|
||||||
* @param size (IN) Interface name buffer size
|
* @param size (IN) Interface name buffer size
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifaddrtoname(const char* if_addr,
|
OMPI_DECLSPEC int opal_ifaddrtoname(const char* if_addr,
|
||||||
char* if_name, int size);
|
char* if_name, int size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,17 +55,17 @@ OMPI_DECLSPEC int ompi_ifaddrtoname(const char* if_addr,
|
|||||||
* @param if_name (IN) Interface name
|
* @param if_name (IN) Interface name
|
||||||
* @return Interface index
|
* @return Interface index
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifnametoindex(const char* if_name);
|
OMPI_DECLSPEC int opal_ifnametoindex(const char* if_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of available interfaces.
|
* Returns the number of available interfaces.
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifcount(void);
|
OMPI_DECLSPEC int opal_ifcount(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the first available interface.
|
* Returns the index of the first available interface.
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifbegin(void);
|
OMPI_DECLSPEC int opal_ifbegin(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lookup the current position in the interface list by
|
* Lookup the current position in the interface list by
|
||||||
@ -74,7 +74,7 @@ OMPI_DECLSPEC int ompi_ifbegin(void);
|
|||||||
* @param if_index Returns the next available index from the
|
* @param if_index Returns the next available index from the
|
||||||
* current position.
|
* current position.
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifnext(int if_index);
|
OMPI_DECLSPEC int opal_ifnext(int if_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lookup an interface by index and return its name.
|
* Lookup an interface by index and return its name.
|
||||||
@ -83,7 +83,7 @@ OMPI_DECLSPEC int ompi_ifnext(int if_index);
|
|||||||
* @param if_name (OUT) Interface name buffer
|
* @param if_name (OUT) Interface name buffer
|
||||||
* @param size (IN) Interface name buffer size
|
* @param size (IN) Interface name buffer size
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifindextoname(int if_index, char* if_name, int);
|
OMPI_DECLSPEC int opal_ifindextoname(int if_index, char* if_name, int);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lookup an interface by index and return its primary address .
|
* Lookup an interface by index and return its primary address .
|
||||||
@ -92,7 +92,7 @@ OMPI_DECLSPEC int ompi_ifindextoname(int if_index, char* if_name, int);
|
|||||||
* @param if_name (OUT) Interface address buffer
|
* @param if_name (OUT) Interface address buffer
|
||||||
* @param size (IN) Interface address buffer size
|
* @param size (IN) Interface address buffer size
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifindextoaddr(int if_index, struct sockaddr*, int);
|
OMPI_DECLSPEC int opal_ifindextoaddr(int if_index, struct sockaddr*, int);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lookup an interface by index and return its network mask.
|
* Lookup an interface by index and return its network mask.
|
||||||
@ -101,7 +101,7 @@ OMPI_DECLSPEC int ompi_ifindextoaddr(int if_index, struct sockaddr*, int);
|
|||||||
* @param if_name (OUT) Interface address buffer
|
* @param if_name (OUT) Interface address buffer
|
||||||
* @param size (IN) Interface address buffer size
|
* @param size (IN) Interface address buffer size
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_ifindextomask(int if_index, struct sockaddr*, int);
|
OMPI_DECLSPEC int opal_ifindextomask(int if_index, struct sockaddr*, int);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if given hostname / IP address is a local address
|
* Determine if given hostname / IP address is a local address
|
||||||
@ -109,7 +109,7 @@ OMPI_DECLSPEC int ompi_ifindextomask(int if_index, struct sockaddr*, int);
|
|||||||
* @param hostname (IN) Hostname (or stringified IP address)
|
* @param hostname (IN) Hostname (or stringified IP address)
|
||||||
* @return true if \c hostname is local, false otherwise
|
* @return true if \c hostname is local, false otherwise
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC bool ompi_ifislocal(char *hostname);
|
OMPI_DECLSPEC bool opal_ifislocal(char *hostname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalize the functions to release malloc'd data
|
* Finalize the functions to release malloc'd data
|
||||||
@ -118,7 +118,7 @@ OMPI_DECLSPEC bool ompi_ifislocal(char *hostname);
|
|||||||
* @return OMPI_SUCCESS if no problems encountered
|
* @return OMPI_SUCCESS if no problems encountered
|
||||||
* @return OMPI_ERROR if data could not be released
|
* @return OMPI_ERROR if data could not be released
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_iffinalize(void);
|
OMPI_DECLSPEC int opal_iffinalize(void);
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
|
|
||||||
@ -42,8 +42,8 @@
|
|||||||
/*
|
/*
|
||||||
* Public variables
|
* Public variables
|
||||||
*/
|
*/
|
||||||
int ompi_malloc_debug_level = OMPI_MALLOC_DEBUG_LEVEL;
|
int opal_malloc_debug_level = OPAL_MALLOC_DEBUG_LEVEL;
|
||||||
int ompi_malloc_output = -1;
|
int opal_malloc_output = -1;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -69,20 +69,20 @@ static opal_output_stream_t malloc_stream = {
|
|||||||
/*
|
/*
|
||||||
* Initialize the malloc debug interface
|
* Initialize the malloc debug interface
|
||||||
*/
|
*/
|
||||||
void ompi_malloc_init(void)
|
void opal_malloc_init(void)
|
||||||
{
|
{
|
||||||
ompi_malloc_output = opal_output_open(&malloc_stream);
|
opal_malloc_output = opal_output_open(&malloc_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finalize the malloc debug interface
|
* Finalize the malloc debug interface
|
||||||
*/
|
*/
|
||||||
void ompi_malloc_finalize(void)
|
void opal_malloc_finalize(void)
|
||||||
{
|
{
|
||||||
if (-1 != ompi_malloc_output) {
|
if (-1 != opal_malloc_output) {
|
||||||
opal_output_close(ompi_malloc_output);
|
opal_output_close(opal_malloc_output);
|
||||||
ompi_malloc_output = -1;
|
opal_malloc_output = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,19 +90,19 @@ void ompi_malloc_finalize(void)
|
|||||||
/*
|
/*
|
||||||
* Debug version of malloc
|
* Debug version of malloc
|
||||||
*/
|
*/
|
||||||
void *ompi_malloc(size_t size, const char *file, int line)
|
void *opal_malloc(size_t size, const char *file, int line)
|
||||||
{
|
{
|
||||||
void *addr;
|
void *addr;
|
||||||
if (ompi_malloc_debug_level > 1) {
|
if (opal_malloc_debug_level > 1) {
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
opal_output(ompi_malloc_output, "Request for %ld bytes (%s, %d)",
|
opal_output(opal_malloc_output, "Request for %ld bytes (%s, %d)",
|
||||||
(long) size, file, line);
|
(long) size, file, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addr = malloc(size);
|
addr = malloc(size);
|
||||||
if (ompi_malloc_debug_level > 0) {
|
if (opal_malloc_debug_level > 0) {
|
||||||
if (NULL == addr) {
|
if (NULL == addr) {
|
||||||
opal_output(ompi_malloc_output,
|
opal_output(opal_malloc_output,
|
||||||
"Request for %ld bytes failed (%s, %d)",
|
"Request for %ld bytes failed (%s, %d)",
|
||||||
(long) size, file, line);
|
(long) size, file, line);
|
||||||
}
|
}
|
||||||
@ -115,20 +115,20 @@ void *ompi_malloc(size_t size, const char *file, int line)
|
|||||||
/*
|
/*
|
||||||
* Debug version of calloc
|
* Debug version of calloc
|
||||||
*/
|
*/
|
||||||
void *ompi_calloc(size_t nmembers, size_t size, const char *file, int line)
|
void *opal_calloc(size_t nmembers, size_t size, const char *file, int line)
|
||||||
{
|
{
|
||||||
void *addr;
|
void *addr;
|
||||||
if (ompi_malloc_debug_level > 1) {
|
if (opal_malloc_debug_level > 1) {
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
opal_output(ompi_malloc_output,
|
opal_output(opal_malloc_output,
|
||||||
"Request for %ld zeroed elements of size %ld (%s, %d)",
|
"Request for %ld zeroed elements of size %ld (%s, %d)",
|
||||||
(long) nmembers, (long) size, file, line);
|
(long) nmembers, (long) size, file, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addr = calloc(nmembers, size);
|
addr = calloc(nmembers, size);
|
||||||
if (ompi_malloc_debug_level > 0) {
|
if (opal_malloc_debug_level > 0) {
|
||||||
if (NULL == addr) {
|
if (NULL == addr) {
|
||||||
opal_output(ompi_malloc_output,
|
opal_output(opal_malloc_output,
|
||||||
"Request for %ld zeroed elements of size %ld failed (%s, %d)",
|
"Request for %ld zeroed elements of size %ld failed (%s, %d)",
|
||||||
(long) nmembers, (long) size, file, line);
|
(long) nmembers, (long) size, file, line);
|
||||||
}
|
}
|
||||||
@ -141,26 +141,26 @@ void *ompi_calloc(size_t nmembers, size_t size, const char *file, int line)
|
|||||||
/*
|
/*
|
||||||
* Debug version of realloc
|
* Debug version of realloc
|
||||||
*/
|
*/
|
||||||
void *ompi_realloc(void *ptr, size_t size, const char *file, int line)
|
void *opal_realloc(void *ptr, size_t size, const char *file, int line)
|
||||||
{
|
{
|
||||||
void *addr;
|
void *addr;
|
||||||
|
|
||||||
if (ompi_malloc_debug_level > 1) {
|
if (opal_malloc_debug_level > 1) {
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
if (NULL == ptr) {
|
if (NULL == ptr) {
|
||||||
opal_output(ompi_malloc_output,
|
opal_output(opal_malloc_output,
|
||||||
"Realloc NULL for %ld bytes (%s, %d)",
|
"Realloc NULL for %ld bytes (%s, %d)",
|
||||||
(long) size, file, line);
|
(long) size, file, line);
|
||||||
} else {
|
} else {
|
||||||
opal_output(ompi_malloc_output, "Realloc %p for %ld bytes (%s, %d)",
|
opal_output(opal_malloc_output, "Realloc %p for %ld bytes (%s, %d)",
|
||||||
ptr, (long) size, file, line);
|
ptr, (long) size, file, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addr = realloc(ptr, size);
|
addr = realloc(ptr, size);
|
||||||
if (ompi_malloc_debug_level > 0) {
|
if (opal_malloc_debug_level > 0) {
|
||||||
if (NULL == addr) {
|
if (NULL == addr) {
|
||||||
opal_output(ompi_malloc_output,
|
opal_output(opal_malloc_output,
|
||||||
"Realloc %p for %ld bytes failed (%s, %d)",
|
"Realloc %p for %ld bytes failed (%s, %d)",
|
||||||
ptr, (long) size, file, line);
|
ptr, (long) size, file, line);
|
||||||
}
|
}
|
||||||
@ -173,10 +173,10 @@ void *ompi_realloc(void *ptr, size_t size, const char *file, int line)
|
|||||||
/*
|
/*
|
||||||
* Debug version of free
|
* Debug version of free
|
||||||
*/
|
*/
|
||||||
void ompi_free(void *addr, const char *file, int line)
|
void opal_free(void *addr, const char *file, int line)
|
||||||
{
|
{
|
||||||
if (ompi_malloc_debug_level > 1 && NULL == addr) {
|
if (opal_malloc_debug_level > 1 && NULL == addr) {
|
||||||
opal_output(ompi_malloc_output, "Invalid free (%s, %d)", file, line);
|
opal_output(opal_malloc_output, "Invalid free (%s, %d)", file, line);
|
||||||
} else {
|
} else {
|
||||||
free(addr);
|
free(addr);
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
|
|
||||||
/** @file */
|
/** @file */
|
||||||
|
|
||||||
#ifndef OMPI_MALLOC_H
|
#ifndef OPAL_MALLOC_H
|
||||||
#define OMPI_MALLOC_H
|
#define OPAL_MALLOC_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* THIS FILE CANNOT INCLUDE ANY OTHER OMPI HEADER FILES!!!
|
* THIS FILE CANNOT INCLUDE ANY OTHER OPAL HEADER FILES!!!
|
||||||
*
|
*
|
||||||
* It is included via <ompi_config_bottom.h>. Hence, it should not
|
* It is included via <ompi_config_bottom.h>. Hence, it should not
|
||||||
* include ANY other files, nor should it include "ompi_config.h".
|
* include ANY other files, nor should it include "ompi_config.h".
|
||||||
@ -30,14 +30,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set OMPI_MALLOC_DEBUG_LEVEL to
|
* Set OPAL_MALLOC_DEBUG_LEVEL to
|
||||||
* 0 for no checking
|
* 0 for no checking
|
||||||
* 1 for basic error checking
|
* 1 for basic error checking
|
||||||
* 2 for more error checking
|
* 2 for more error checking
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OMPI_MALLOC_DEBUG_LEVEL
|
#ifndef OPAL_MALLOC_DEBUG_LEVEL
|
||||||
#define OMPI_MALLOC_DEBUG_LEVEL 2
|
#define OPAL_MALLOC_DEBUG_LEVEL 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
@ -51,26 +51,26 @@ extern "C" {
|
|||||||
* other than that (i.e., no internal accounting for tracking
|
* other than that (i.e., no internal accounting for tracking
|
||||||
* malloc/free statements, etc.).
|
* malloc/free statements, etc.).
|
||||||
*
|
*
|
||||||
* It is invoked as part of ompi_init(). Although this function is
|
* It is invoked as part of opal_init(). Although this function is
|
||||||
* not \em necessary for OMPI_MALLOC() and OMPI_FREE(), it is strong
|
* not \em necessary for OPAL_MALLOC() and OPAL_FREE(), it is strong
|
||||||
* recommended because no output messages -- regardless of the
|
* recommended because no output messages -- regardless of the
|
||||||
* malloc debug level set by ompi_malloc_debug() -- will be displayed
|
* malloc debug level set by opal_malloc_debug() -- will be displayed
|
||||||
* unless this function is invoked first.
|
* unless this function is invoked first.
|
||||||
*/
|
*/
|
||||||
void ompi_malloc_init(void);
|
void opal_malloc_init(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shut down malloc debug output.
|
* Shut down malloc debug output.
|
||||||
*
|
*
|
||||||
* This function is invoked as part of ompi_finalize() to shut down the
|
* This function is invoked as part of opal_finalize() to shut down the
|
||||||
* output stream for malloc debug messages.
|
* output stream for malloc debug messages.
|
||||||
*/
|
*/
|
||||||
void ompi_malloc_finalize(void);
|
void opal_malloc_finalize(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
*
|
*
|
||||||
* Back-end error-checking malloc function for OMPI (you should use
|
* Back-end error-checking malloc function for OPAL (you should use
|
||||||
* the normal malloc() instead of this function).
|
* the normal malloc() instead of this function).
|
||||||
*
|
*
|
||||||
* @param size The number of bytes to allocate
|
* @param size The number of bytes to allocate
|
||||||
@ -80,12 +80,12 @@ void ompi_malloc_finalize(void);
|
|||||||
* This function is only used when --enable-mem-debug was specified to
|
* This function is only used when --enable-mem-debug was specified to
|
||||||
* configure (or by default if you're building in a SVN checkout).
|
* configure (or by default if you're building in a SVN checkout).
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC void *ompi_malloc(size_t size, const char *file, int line);
|
OMPI_DECLSPEC void *opal_malloc(size_t size, const char *file, int line);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
*
|
*
|
||||||
* Back-end error-checking calloc function for OMPI (you should use
|
* Back-end error-checking calloc function for OPAL (you should use
|
||||||
* the normal calloc() instead of this function).
|
* the normal calloc() instead of this function).
|
||||||
*
|
*
|
||||||
* @param nmembers Number of elements to malloc
|
* @param nmembers Number of elements to malloc
|
||||||
@ -96,12 +96,12 @@ OMPI_DECLSPEC void *ompi_malloc(size_t size, const char *file, int line);
|
|||||||
* This function is only used when --enable-mem-debug was specified to
|
* This function is only used when --enable-mem-debug was specified to
|
||||||
* configure (or by default if you're building in a SVN checkout).
|
* configure (or by default if you're building in a SVN checkout).
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC void *ompi_calloc(size_t nmembers, size_t size, const char *file, int line);
|
OMPI_DECLSPEC void *opal_calloc(size_t nmembers, size_t size, const char *file, int line);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
*
|
*
|
||||||
* Back-end error-checking realloc function for OMPI (you should use
|
* Back-end error-checking realloc function for OPAL (you should use
|
||||||
* the normal realloc() instead of this function).
|
* the normal realloc() instead of this function).
|
||||||
*
|
*
|
||||||
* @param ptr Pointer to reallocate
|
* @param ptr Pointer to reallocate
|
||||||
@ -112,12 +112,12 @@ OMPI_DECLSPEC void *ompi_calloc(size_t nmembers, size_t size, const char *file,
|
|||||||
* This function is only used when --enable-mem-debug was specified to
|
* This function is only used when --enable-mem-debug was specified to
|
||||||
* configure (or by default if you're building in a SVN checkout).
|
* configure (or by default if you're building in a SVN checkout).
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC void *ompi_realloc(void *ptr, size_t size, const char *file, int line);
|
OMPI_DECLSPEC void *opal_realloc(void *ptr, size_t size, const char *file, int line);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
*
|
*
|
||||||
* Back-end error-checking free function for OMPI (you should use
|
* Back-end error-checking free function for OPAL (you should use
|
||||||
* free() instead of this function).
|
* free() instead of this function).
|
||||||
*
|
*
|
||||||
* @param addr Address on the heap to free()
|
* @param addr Address on the heap to free()
|
||||||
@ -128,12 +128,12 @@ OMPI_DECLSPEC void *ompi_realloc(void *ptr, size_t size, const char *file, int l
|
|||||||
* to configure (or by default if you're building in a SVN
|
* to configure (or by default if you're building in a SVN
|
||||||
* checkout).
|
* checkout).
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC void ompi_free(void *addr, const char *file, int line);
|
OMPI_DECLSPEC void opal_free(void *addr, const char *file, int line);
|
||||||
|
|
||||||
OMPI_DECLSPEC extern int ompi_malloc_debug_level;
|
OMPI_DECLSPEC extern int opal_malloc_debug_level;
|
||||||
OMPI_DECLSPEC extern int ompi_malloc_output;
|
OMPI_DECLSPEC extern int opal_malloc_output;
|
||||||
|
|
||||||
static inline void ompi_malloc_debug(int level);
|
static inline void opal_malloc_debug(int level);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,14 +141,14 @@ static inline void ompi_malloc_debug(int level);
|
|||||||
*
|
*
|
||||||
* @param level The level of debugging (0 = none, 1 = some, 2 = more)
|
* @param level The level of debugging (0 = none, 1 = some, 2 = more)
|
||||||
*
|
*
|
||||||
* This value defaults to the OMPI_MALLOC_DEBUG_LEVEL.
|
* This value defaults to the OPAL_MALLOC_DEBUG_LEVEL.
|
||||||
*/
|
*/
|
||||||
static inline void ompi_malloc_debug(int level)
|
static inline void opal_malloc_debug(int level)
|
||||||
{
|
{
|
||||||
ompi_malloc_debug_level = level;
|
opal_malloc_debug_level = level;
|
||||||
}
|
}
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* OMPI_MALLOC_H */
|
#endif /* OPAL_MALLOC_H */
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "util/numtostr.h"
|
#include "opal/util/numtostr.h"
|
||||||
#include "util/printf.h"
|
#include "util/printf.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
ompi_ltostr(long num)
|
opal_ltostr(long num)
|
||||||
{
|
{
|
||||||
/* waste a little bit of space, but always have a big enough buffer */
|
/* waste a little bit of space, but always have a big enough buffer */
|
||||||
int buflen = sizeof(long) * 8;
|
int buflen = sizeof(long) * 8;
|
||||||
@ -43,7 +43,7 @@ ompi_ltostr(long num)
|
|||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
ompi_dtostr(double num)
|
opal_dtostr(double num)
|
||||||
{
|
{
|
||||||
/* waste a little bit of space, but always have a big enough buffer */
|
/* waste a little bit of space, but always have a big enough buffer */
|
||||||
int buflen = sizeof(long) * 8;
|
int buflen = sizeof(long) * 8;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
* @param num (IN) Input number
|
* @param num (IN) Input number
|
||||||
* @return String containing number (NULL on failure)
|
* @return String containing number (NULL on failure)
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC char* ompi_ltostr(long num);
|
OMPI_DECLSPEC char* opal_ltostr(long num);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,6 +38,6 @@ OMPI_DECLSPEC char* ompi_ltostr(long num);
|
|||||||
* @param num (IN) Input number
|
* @param num (IN) Input number
|
||||||
* @return String containing number (NULL on failure)
|
* @return String containing number (NULL on failure)
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC char* ompi_dtostr(double num);
|
OMPI_DECLSPEC char* opal_dtostr(double num);
|
||||||
|
|
||||||
#endif /* OMPI_NUMTOSTR_UTIL */
|
#endif /* OMPI_NUMTOSTR_UTIL */
|
||||||
|
@ -23,14 +23,14 @@
|
|||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "util/printf.h"
|
#include "util/printf.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Merge two environ-like char arrays, ensuring that there are no
|
* Merge two environ-like char arrays, ensuring that there are no
|
||||||
* duplicate entires
|
* duplicate entires
|
||||||
*/
|
*/
|
||||||
char **ompi_environ_merge(char **minor, char **major)
|
char **opal_environ_merge(char **minor, char **major)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char **ret = NULL;
|
char **ret = NULL;
|
||||||
@ -56,13 +56,13 @@ char **ompi_environ_merge(char **minor, char **major)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now go through minor and call ompi_setenv(), but with overwrite
|
/* Now go through minor and call opal_setenv(), but with overwrite
|
||||||
as false */
|
as false */
|
||||||
|
|
||||||
for (i = 0; NULL != minor[i]; ++i) {
|
for (i = 0; NULL != minor[i]; ++i) {
|
||||||
value = strchr(minor[i], '=');
|
value = strchr(minor[i], '=');
|
||||||
if (NULL == value) {
|
if (NULL == value) {
|
||||||
ompi_setenv(minor[i], NULL, false, &ret);
|
opal_setenv(minor[i], NULL, false, &ret);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* strdup minor[i] in case it's a constat string */
|
/* strdup minor[i] in case it's a constat string */
|
||||||
@ -70,7 +70,7 @@ char **ompi_environ_merge(char **minor, char **major)
|
|||||||
name = strdup(minor[i]);
|
name = strdup(minor[i]);
|
||||||
value = name + (value - minor[i]);
|
value = name + (value - minor[i]);
|
||||||
*value = '\0';
|
*value = '\0';
|
||||||
ompi_setenv(name, value + 1, false, &ret);
|
opal_setenv(name, value + 1, false, &ret);
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ char **ompi_environ_merge(char **minor, char **major)
|
|||||||
* Portable version of setenv(), allowing editing of any environ-like
|
* Portable version of setenv(), allowing editing of any environ-like
|
||||||
* array
|
* array
|
||||||
*/
|
*/
|
||||||
int ompi_setenv(const char *name, const char *value, bool overwrite,
|
int opal_setenv(const char *name, const char *value, bool overwrite,
|
||||||
char ***env)
|
char ***env)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -119,8 +119,8 @@ int ompi_setenv(const char *name, const char *value, bool overwrite,
|
|||||||
if (*env == environ) {
|
if (*env == environ) {
|
||||||
/* THIS IS POTENTIALLY A MEMORY LEAK! But I am doing it
|
/* THIS IS POTENTIALLY A MEMORY LEAK! But I am doing it
|
||||||
because so that we don't violate the law of least
|
because so that we don't violate the law of least
|
||||||
astonishmet for OMPI developers (i.e., those that don't
|
astonishmet for OPAL developers (i.e., those that don't
|
||||||
check the return code of ompi_setenv() and notice that we
|
check the return code of opal_setenv() and notice that we
|
||||||
returned an error if you passed in the real environ) */
|
returned an error if you passed in the real environ) */
|
||||||
putenv(newvalue);
|
putenv(newvalue);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
@ -169,7 +169,7 @@ int ompi_setenv(const char *name, const char *value, bool overwrite,
|
|||||||
* Portable version of unsetenv(), allowing editing of any
|
* Portable version of unsetenv(), allowing editing of any
|
||||||
* environ-like array
|
* environ-like array
|
||||||
*/
|
*/
|
||||||
int ompi_unsetenv(const char *name, char ***env)
|
int opal_unsetenv(const char *name, char ***env)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *compare;
|
char *compare;
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
* Generic helper routines for environment manipulation.
|
* Generic helper routines for environment manipulation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OMPI_ENVIRON_H
|
#ifndef OPAL_ENVIRON_H
|
||||||
#define OMPI_ENVIRON_H
|
#define OPAL_ENVIRON_H
|
||||||
|
|
||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ extern "C" {
|
|||||||
* one of the two is NULL, the other list is simply copied to the
|
* one of the two is NULL, the other list is simply copied to the
|
||||||
* output. If both are NULL, NULL is returned.
|
* output. If both are NULL, NULL is returned.
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC char **ompi_environ_merge(char **minor, char **major);
|
OMPI_DECLSPEC char **opal_environ_merge(char **minor, char **major);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Portable version of setenv(3), allowing editing of any
|
* Portable version of setenv(3), allowing editing of any
|
||||||
@ -74,7 +74,7 @@ extern "C" {
|
|||||||
* (argv-style). Note that unlike some implementations of
|
* (argv-style). Note that unlike some implementations of
|
||||||
* putenv(3), if \em value is insertted in \em env, it is copied.
|
* putenv(3), if \em value is insertted in \em env, it is copied.
|
||||||
* So the caller can modify/free both \em name and \em value after
|
* So the caller can modify/free both \em name and \em value after
|
||||||
* ompi_setenv() returns.
|
* opal_setenv() returns.
|
||||||
*
|
*
|
||||||
* The \em env array will be grown if necessary.
|
* The \em env array will be grown if necessary.
|
||||||
*
|
*
|
||||||
@ -83,10 +83,10 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* \code
|
* \code
|
||||||
* extern char **environ;
|
* extern char **environ;
|
||||||
* ompi_setenv("foo", "bar", true, &environ);
|
* opal_setenv("foo", "bar", true, &environ);
|
||||||
* \endcode
|
* \endcode
|
||||||
*
|
*
|
||||||
* NOTE: If you use the real environ, ompi_setenv() will turn
|
* NOTE: If you use the real environ, opal_setenv() will turn
|
||||||
* around and perform putenv() to put the value in the
|
* around and perform putenv() to put the value in the
|
||||||
* environment. This may very well lead to a memory leak, so its
|
* environment. This may very well lead to a memory leak, so its
|
||||||
* use is strongly discouraged.
|
* use is strongly discouraged.
|
||||||
@ -96,10 +96,10 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* \code
|
* \code
|
||||||
* char **my_env = NULL;
|
* char **my_env = NULL;
|
||||||
* ompi_setenv("foo", "bar", true, &my_env);
|
* opal_setenv("foo", "bar", true, &my_env);
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_setenv(const char *name, const char *value,
|
OMPI_DECLSPEC int opal_setenv(const char *name, const char *value,
|
||||||
bool overwrite, char ***env);
|
bool overwrite, char ***env);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,15 +116,15 @@ extern "C" {
|
|||||||
* If \em name is found in \em env, the string corresponding to
|
* If \em name is found in \em env, the string corresponding to
|
||||||
* that entry is freed and its entry is eliminated from the array.
|
* that entry is freed and its entry is eliminated from the array.
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int ompi_unsetenv(const char *name, char ***env);
|
OMPI_DECLSPEC int opal_unsetenv(const char *name, char ***env);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* So that others don't have to declare it
|
* So that others don't have to declare it
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC extern char **ompi_environ;
|
OMPI_DECLSPEC extern char **opal_environ;
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* OMPI_ARGV_H */
|
#endif /* OPAL_ENVIRON */
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "orte_config.h"
|
#include "orte_config.h"
|
||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
#include "mca/ns/ns.h"
|
#include "mca/ns/ns.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
@ -153,7 +153,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, "bproc", true, env);
|
opal_setenv(param, "bproc", true, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* not a seed */
|
/* not a seed */
|
||||||
@ -161,7 +161,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_unsetenv(param, env);
|
opal_unsetenv(param, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* since we want to pass the name as separate components, make sure
|
/* since we want to pass the name as separate components, make sure
|
||||||
@ -171,7 +171,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_unsetenv(param, env);
|
opal_unsetenv(param, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* setup the name */
|
/* setup the name */
|
||||||
@ -179,7 +179,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, cellid, true, env);
|
opal_setenv(param, cellid, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(cellid);
|
free(cellid);
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, jobid, true, env);
|
opal_setenv(param, jobid, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(jobid);
|
free(jobid);
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, value, true, env);
|
opal_setenv(param, value, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(value);
|
free(value);
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, value, true, env);
|
opal_setenv(param, value, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(value);
|
free(value);
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, value, true, env);
|
opal_setenv(param, value, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(value);
|
free(value);
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ int orte_ns_nds_bproc_put(orte_cellid_t cell, orte_jobid_t job,
|
|||||||
* after the launch */
|
* after the launch */
|
||||||
|
|
||||||
putenv("BPROC_RANK=XXXXXXX");
|
putenv("BPROC_RANK=XXXXXXX");
|
||||||
ompi_setenv("BPROC_RANK", "XXXXXXX", true, env);
|
opal_setenv("BPROC_RANK", "XXXXXXX", true, env);
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "orte_config.h"
|
#include "orte_config.h"
|
||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
#include "mca/ns/ns.h"
|
#include "mca/ns/ns.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
@ -147,7 +147,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, "env", true, env);
|
opal_setenv(param, "env", true, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* not a seed */
|
/* not a seed */
|
||||||
@ -155,7 +155,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_unsetenv(param, env);
|
opal_unsetenv(param, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* since we want to pass the name as separate components, make sure
|
/* since we want to pass the name as separate components, make sure
|
||||||
@ -165,7 +165,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_unsetenv(param, env);
|
opal_unsetenv(param, env);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* setup the name */
|
/* setup the name */
|
||||||
@ -173,7 +173,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, cellid, true, env);
|
opal_setenv(param, cellid, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(cellid);
|
free(cellid);
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, jobid, true, env);
|
opal_setenv(param, jobid, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(jobid);
|
free(jobid);
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, vpid, true, env);
|
opal_setenv(param, vpid, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(vpid);
|
free(vpid);
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, value, true, env);
|
opal_setenv(param, value, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(value);
|
free(value);
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
|
|||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
ompi_setenv(param, value, true, env);
|
opal_setenv(param, value, true, env);
|
||||||
free(param);
|
free(param);
|
||||||
free(value);
|
free(value);
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "include/ompi_socket_errno.h"
|
#include "include/ompi_socket_errno.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "class/ompi_proc_table.h"
|
#include "class/ompi_proc_table.h"
|
||||||
#include "mca/oob/tcp/oob_tcp.h"
|
#include "mca/oob/tcp/oob_tcp.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
@ -492,7 +492,7 @@ mca_oob_t* mca_oob_tcp_component_init(int* priority)
|
|||||||
*priority = 1;
|
*priority = 1;
|
||||||
|
|
||||||
/* are there any interfaces? */
|
/* are there any interfaces? */
|
||||||
if(ompi_ifcount() == 0)
|
if(opal_ifcount() == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* initialize data structures */
|
/* initialize data structures */
|
||||||
@ -1047,22 +1047,22 @@ int mca_oob_tcp_process_name_compare(const orte_process_name_t* n1, const orte_p
|
|||||||
char* mca_oob_tcp_get_addr(void)
|
char* mca_oob_tcp_get_addr(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *contact_info = (char *)malloc((ompi_ifcount()+1) * 32);
|
char *contact_info = (char *)malloc((opal_ifcount()+1) * 32);
|
||||||
char *ptr = contact_info;
|
char *ptr = contact_info;
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
|
|
||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=opal_ifbegin(); i>0; i=opal_ifnext(i)) {
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
char name[32];
|
char name[32];
|
||||||
ompi_ifindextoname(i, name, sizeof(name));
|
opal_ifindextoname(i, name, sizeof(name));
|
||||||
if (mca_oob_tcp_component.tcp_include != NULL &&
|
if (mca_oob_tcp_component.tcp_include != NULL &&
|
||||||
strstr(mca_oob_tcp_component.tcp_include,name) == NULL)
|
strstr(mca_oob_tcp_component.tcp_include,name) == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (mca_oob_tcp_component.tcp_exclude != NULL &&
|
if (mca_oob_tcp_component.tcp_exclude != NULL &&
|
||||||
strstr(mca_oob_tcp_component.tcp_exclude,name) != NULL)
|
strstr(mca_oob_tcp_component.tcp_exclude,name) != NULL)
|
||||||
continue;
|
continue;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&addr, sizeof(addr));
|
opal_ifindextoaddr(i, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
if(ompi_ifcount() > 1 && addr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(opal_ifcount() > 1 && addr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
if(ptr != contact_info) {
|
if(ptr != contact_info) {
|
||||||
ptr += sprintf(ptr, ";");
|
ptr += sprintf(ptr, ";");
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "oob_tcp.h"
|
#include "oob_tcp.h"
|
||||||
#include "oob_tcp_addr.h"
|
#include "oob_tcp_addr.h"
|
||||||
|
|
||||||
@ -66,10 +66,10 @@ int mca_oob_tcp_addr_pack(orte_buffer_t* buffer)
|
|||||||
if(rc != ORTE_SUCCESS)
|
if(rc != ORTE_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=opal_ifbegin(); i>0; i=opal_ifnext(i)) {
|
||||||
struct sockaddr_in inaddr;
|
struct sockaddr_in inaddr;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
opal_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
||||||
if(ompi_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(opal_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -77,10 +77,10 @@ int mca_oob_tcp_addr_pack(orte_buffer_t* buffer)
|
|||||||
if(rc != ORTE_SUCCESS)
|
if(rc != ORTE_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=opal_ifbegin(); i>0; i=opal_ifnext(i)) {
|
||||||
struct sockaddr_in inaddr;
|
struct sockaddr_in inaddr;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
opal_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
||||||
if(ompi_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(opal_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
inaddr.sin_port = mca_oob_tcp_component.tcp_listen_port;
|
inaddr.sin_port = mca_oob_tcp_component.tcp_listen_port;
|
||||||
orte_dps.pack(buffer,&inaddr,sizeof(inaddr),ORTE_BYTE);
|
orte_dps.pack(buffer,&inaddr,sizeof(inaddr),ORTE_BYTE);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
@ -282,7 +282,7 @@ static int orte_pls_bproc_launch_app(orte_jobid_t jobid,
|
|||||||
|
|
||||||
/* set name discovery mode */
|
/* set name discovery mode */
|
||||||
var = mca_base_param_environ_variable("ns","nds",NULL);
|
var = mca_base_param_environ_variable("ns","nds",NULL);
|
||||||
ompi_setenv(var, "bproc", true, &map->app->env);
|
opal_setenv(var, "bproc", true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* ns replica contact info */
|
/* ns replica contact info */
|
||||||
@ -296,24 +296,24 @@ static int orte_pls_bproc_launch_app(orte_jobid_t jobid,
|
|||||||
orte_process_info.ns_replica_uri = orte_rml.get_uri();
|
orte_process_info.ns_replica_uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
var = mca_base_param_environ_variable("ns","replica","uri");
|
var = mca_base_param_environ_variable("ns","replica","uri");
|
||||||
ompi_setenv(var,orte_process_info.ns_replica_uri, true, &map->app->env);
|
opal_setenv(var,orte_process_info.ns_replica_uri, true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* make sure the frontend hostname does not get pushed out to the backend */
|
/* make sure the frontend hostname does not get pushed out to the backend */
|
||||||
var = mca_base_param_environ_variable("orte", "base", "nodename");
|
var = mca_base_param_environ_variable("orte", "base", "nodename");
|
||||||
ompi_unsetenv(var, &map->app->env);
|
opal_unsetenv(var, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
ompi_unsetenv("HOSTNAME", &map->app->env);
|
opal_unsetenv("HOSTNAME", &map->app->env);
|
||||||
|
|
||||||
/* make sure the username used to create the bproc directory is the same on
|
/* make sure the username used to create the bproc directory is the same on
|
||||||
* the backend as the frontend */
|
* the backend as the frontend */
|
||||||
var = mca_base_param_environ_variable("pls","bproc","username");
|
var = mca_base_param_environ_variable("pls","bproc","username");
|
||||||
ompi_setenv(var, orte_system_info.user, true, &map->app->env);
|
opal_setenv(var, orte_system_info.user, true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* tell the bootproxy to use the bproc_orted pls */
|
/* tell the bootproxy to use the bproc_orted pls */
|
||||||
var = mca_base_param_environ_variable("rmgr", "bootproxy", "pls");
|
var = mca_base_param_environ_variable("rmgr", "bootproxy", "pls");
|
||||||
ompi_setenv(var, "bproc_orted", true, &map->app->env);
|
opal_setenv(var, "bproc_orted", true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* gpr replica contact info */
|
/* gpr replica contact info */
|
||||||
@ -327,12 +327,12 @@ static int orte_pls_bproc_launch_app(orte_jobid_t jobid,
|
|||||||
orte_process_info.gpr_replica_uri = orte_rml.get_uri();
|
orte_process_info.gpr_replica_uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
var = mca_base_param_environ_variable("gpr","replica","uri");
|
var = mca_base_param_environ_variable("gpr","replica","uri");
|
||||||
ompi_setenv(var,orte_process_info.gpr_replica_uri, true, &map->app->env);
|
opal_setenv(var,orte_process_info.gpr_replica_uri, true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
asprintf(¶m, "%d", (int) app_context);
|
asprintf(¶m, "%d", (int) app_context);
|
||||||
var = mca_base_param_environ_variable("pls", "bproc", "app_context");
|
var = mca_base_param_environ_variable("pls", "bproc", "app_context");
|
||||||
ompi_setenv(var, param, true, &map->app->env);
|
opal_setenv(var, param, true, &map->app->env);
|
||||||
free(param);
|
free(param);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
@ -382,11 +382,11 @@ static int orte_pls_bproc_launch_app(
|
|||||||
|
|
||||||
/* overwrite seed setting */
|
/* overwrite seed setting */
|
||||||
var = mca_base_param_environ_variable("seed",NULL,NULL);
|
var = mca_base_param_environ_variable("seed",NULL,NULL);
|
||||||
ompi_setenv(var, "0", true, &map->app->env);
|
opal_setenv(var, "0", true, &map->app->env);
|
||||||
|
|
||||||
/* set name discovery mode */
|
/* set name discovery mode */
|
||||||
var = mca_base_param_environ_variable("ns","nds",NULL);
|
var = mca_base_param_environ_variable("ns","nds",NULL);
|
||||||
ompi_setenv(var, "pipe", true, &map->app->env);
|
opal_setenv(var, "pipe", true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* ns replica contact info */
|
/* ns replica contact info */
|
||||||
@ -399,7 +399,7 @@ static int orte_pls_bproc_launch_app(
|
|||||||
orte_process_info.ns_replica_uri = orte_rml.get_uri();
|
orte_process_info.ns_replica_uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
var = mca_base_param_environ_variable("ns","replica","uri");
|
var = mca_base_param_environ_variable("ns","replica","uri");
|
||||||
ompi_setenv(var,orte_process_info.ns_replica_uri, true, &map->app->env);
|
opal_setenv(var,orte_process_info.ns_replica_uri, true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* gpr replica contact info */
|
/* gpr replica contact info */
|
||||||
@ -412,7 +412,7 @@ static int orte_pls_bproc_launch_app(
|
|||||||
orte_process_info.gpr_replica_uri = orte_rml.get_uri();
|
orte_process_info.gpr_replica_uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
var = mca_base_param_environ_variable("gpr","replica","uri");
|
var = mca_base_param_environ_variable("gpr","replica","uri");
|
||||||
ompi_setenv(var,orte_process_info.gpr_replica_uri, true, &map->app->env);
|
opal_setenv(var,orte_process_info.gpr_replica_uri, true, &map->app->env);
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
/* overwrite previously specified values with the above settings */
|
/* overwrite previously specified values with the above settings */
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/univ_info.h"
|
#include "util/univ_info.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "util/session_dir.h"
|
#include "util/session_dir.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
@ -227,12 +227,12 @@ static int orte_pls_fork_proc(
|
|||||||
/* setup base environment: copy the current environ and merge
|
/* setup base environment: copy the current environ and merge
|
||||||
in the app context environ */
|
in the app context environ */
|
||||||
if (NULL != context->env) {
|
if (NULL != context->env) {
|
||||||
environ_copy = ompi_environ_merge(environ, context->env);
|
environ_copy = opal_environ_merge(environ, context->env);
|
||||||
} else {
|
} else {
|
||||||
environ_copy = opal_argv_copy(environ);
|
environ_copy = opal_argv_copy(environ);
|
||||||
}
|
}
|
||||||
param = mca_base_param_environ_variable("rmgr","bootproxy","jobid");
|
param = mca_base_param_environ_variable("rmgr","bootproxy","jobid");
|
||||||
ompi_unsetenv(param, &environ_copy);
|
opal_unsetenv(param, &environ_copy);
|
||||||
|
|
||||||
/* setup universe info */
|
/* setup universe info */
|
||||||
if (NULL != orte_universe_info.name) {
|
if (NULL != orte_universe_info.name) {
|
||||||
@ -240,7 +240,7 @@ static int orte_pls_fork_proc(
|
|||||||
asprintf(&uri, "%s@%s:%s", orte_universe_info.uid,
|
asprintf(&uri, "%s@%s:%s", orte_universe_info.uid,
|
||||||
orte_universe_info.host,
|
orte_universe_info.host,
|
||||||
orte_universe_info.name);
|
orte_universe_info.name);
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ static int orte_pls_fork_proc(
|
|||||||
uri = orte_rml.get_uri();
|
uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
param = mca_base_param_environ_variable("ns","replica","uri");
|
param = mca_base_param_environ_variable("ns","replica","uri");
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
|
|
||||||
@ -263,13 +263,13 @@ static int orte_pls_fork_proc(
|
|||||||
uri = orte_rml.get_uri();
|
uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
param = mca_base_param_environ_variable("gpr","replica","uri");
|
param = mca_base_param_environ_variable("gpr","replica","uri");
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
|
|
||||||
/* use same nodename as the starting daemon (us) */
|
/* use same nodename as the starting daemon (us) */
|
||||||
param = mca_base_param_environ_variable("orte", "base", "nodename");
|
param = mca_base_param_environ_variable("orte", "base", "nodename");
|
||||||
ompi_setenv(param, orte_system_info.nodename, true, &environ_copy);
|
opal_setenv(param, orte_system_info.nodename, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
|
|
||||||
/* push name into environment */
|
/* push name into environment */
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "mca/soh/soh.h"
|
#include "mca/soh/soh.h"
|
||||||
#include "util/univ_info.h"
|
#include "util/univ_info.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "pls_poe.h"
|
#include "pls_poe.h"
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
@ -373,7 +373,7 @@ static int __poe_create_cmd_file(
|
|||||||
/* setup base environment */
|
/* setup base environment */
|
||||||
environ_copy = NULL;
|
environ_copy = NULL;
|
||||||
param = mca_base_param_environ_variable("rmgr","bootproxy","jobid");
|
param = mca_base_param_environ_variable("rmgr","bootproxy","jobid");
|
||||||
ompi_unsetenv(param, &environ_copy);
|
opal_unsetenv(param, &environ_copy);
|
||||||
|
|
||||||
/* setup universe info */
|
/* setup universe info */
|
||||||
if(NULL != orte_universe_info.name) {
|
if(NULL != orte_universe_info.name) {
|
||||||
@ -381,7 +381,7 @@ static int __poe_create_cmd_file(
|
|||||||
asprintf(&uri, "%s@%s:%s", orte_universe_info.uid,
|
asprintf(&uri, "%s@%s:%s", orte_universe_info.uid,
|
||||||
orte_universe_info.host,
|
orte_universe_info.host,
|
||||||
orte_universe_info.name);
|
orte_universe_info.name);
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ static int __poe_create_cmd_file(
|
|||||||
uri = orte_rml.get_uri();
|
uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
param = mca_base_param_environ_variable("ns","replica","uri");
|
param = mca_base_param_environ_variable("ns","replica","uri");
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ static int __poe_create_cmd_file(
|
|||||||
uri = orte_rml.get_uri();
|
uri = orte_rml.get_uri();
|
||||||
}
|
}
|
||||||
param = mca_base_param_environ_variable("gpr","replica","uri");
|
param = mca_base_param_environ_variable("gpr","replica","uri");
|
||||||
ompi_setenv(param, uri, true, &environ_copy);
|
opal_setenv(param, uri, true, &environ_copy);
|
||||||
free(param);
|
free(param);
|
||||||
free(uri);
|
free(uri);
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@
|
|||||||
|
|
||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/univ_info.h"
|
#include "util/univ_info.h"
|
||||||
#include "util/session_dir.h"
|
#include "util/session_dir.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "util/path.h"
|
#include "util/path.h"
|
||||||
#include "opal/event/event.h"
|
#include "opal/event/event.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
#include "mca/ns/ns.h"
|
#include "mca/ns/ns.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "mca/pls/pls.h"
|
#include "mca/pls/pls.h"
|
||||||
#include "mca/rml/rml.h"
|
#include "mca/rml/rml.h"
|
||||||
#include "mca/gpr/gpr.h"
|
#include "mca/gpr/gpr.h"
|
||||||
@ -458,7 +458,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
|||||||
* match, check using ifislocal().
|
* match, check using ifislocal().
|
||||||
*/
|
*/
|
||||||
if (0 == strcmp(node->node_name, orte_system_info.nodename) ||
|
if (0 == strcmp(node->node_name, orte_system_info.nodename) ||
|
||||||
ompi_ifislocal(node->node_name)) {
|
opal_ifislocal(node->node_name)) {
|
||||||
exec_argv = &argv[local_exec_index];
|
exec_argv = &argv[local_exec_index];
|
||||||
exec_path = ompi_path_findv(exec_argv[0], 0, environ, NULL);
|
exec_path = ompi_path_findv(exec_argv[0], 0, environ, NULL);
|
||||||
} else {
|
} else {
|
||||||
@ -518,7 +518,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
|||||||
/* setup environment */
|
/* setup environment */
|
||||||
env = opal_argv_copy(environ);
|
env = opal_argv_copy(environ);
|
||||||
var = mca_base_param_environ_variable("seed",NULL,NULL);
|
var = mca_base_param_environ_variable("seed",NULL,NULL);
|
||||||
ompi_setenv(var, "0", true, &env);
|
opal_setenv(var, "0", true, &env);
|
||||||
|
|
||||||
/* set the progress engine schedule for this node.
|
/* set the progress engine schedule for this node.
|
||||||
* if node_slots is set to zero, then we default to
|
* if node_slots is set to zero, then we default to
|
||||||
@ -527,10 +527,10 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
|||||||
if (node->node_slots > 0 &&
|
if (node->node_slots > 0 &&
|
||||||
node->node_slots_inuse > node->node_slots) {
|
node->node_slots_inuse > node->node_slots) {
|
||||||
var = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle");
|
var = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle");
|
||||||
ompi_setenv(var, "1", true, &env);
|
opal_setenv(var, "1", true, &env);
|
||||||
} else {
|
} else {
|
||||||
var = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle");
|
var = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle");
|
||||||
ompi_setenv(var, "0", true, &env);
|
opal_setenv(var, "0", true, &env);
|
||||||
}
|
}
|
||||||
free(var);
|
free(var);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "include/orte_types.h"
|
#include "include/orte_types.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
@ -221,8 +221,8 @@ int orte_pls_tm_child_launch(orte_jobid_t jobid)
|
|||||||
|
|
||||||
/* Make a global env for the app */
|
/* Make a global env for the app */
|
||||||
|
|
||||||
tmp_env = ompi_environ_merge(app->env, mca_env);
|
tmp_env = opal_environ_merge(app->env, mca_env);
|
||||||
local_env = ompi_environ_merge(environ, tmp_env);
|
local_env = opal_environ_merge(environ, tmp_env);
|
||||||
if (NULL != tmp_env) {
|
if (NULL != tmp_env) {
|
||||||
opal_argv_free(tmp_env);
|
opal_argv_free(tmp_env);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "include/orte_types.h"
|
#include "include/orte_types.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include "mca/rmaps/base/base.h"
|
#include "mca/rmaps/base/base.h"
|
||||||
#include "mca/schema/base/base.h"
|
#include "mca/schema/base/base.h"
|
||||||
#include "mca/soh/base/base.h"
|
#include "mca/soh/base/base.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "util/univ_info.h"
|
#include "util/univ_info.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/session_dir.h"
|
#include "util/session_dir.h"
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include "opal/threads/condition.h"
|
#include "opal/threads/condition.h"
|
||||||
#include "runtime/orte_wait.h"
|
#include "runtime/orte_wait.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/path.h"
|
#include "util/path.h"
|
||||||
#include "util/univ_info.h"
|
#include "util/univ_info.h"
|
||||||
@ -462,21 +462,21 @@ MOVEON:
|
|||||||
/*
|
/*
|
||||||
* now set the relevant MCA parameters to point us at the remote daemon...
|
* now set the relevant MCA parameters to point us at the remote daemon...
|
||||||
*/
|
*/
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_gpr_replica_uri",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_gpr_replica_uri",
|
||||||
orte_setup_hnp_orted_uri, true, &environ))) {
|
orte_setup_hnp_orted_uri, true, &environ))) {
|
||||||
fprintf(stderr, "orte_setup_hnp: could not set gpr_replica_uri in environ\n");
|
fprintf(stderr, "orte_setup_hnp: could not set gpr_replica_uri in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_ns_replica_uri",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_ns_replica_uri",
|
||||||
orte_setup_hnp_orted_uri, true, &environ))) {
|
orte_setup_hnp_orted_uri, true, &environ))) {
|
||||||
fprintf(stderr, "orte_setup_hnp: could not set ns_replica_uri in environ\n");
|
fprintf(stderr, "orte_setup_hnp: could not set ns_replica_uri in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
ompi_unsetenv("OMPI_MCA_seed", &environ);
|
opal_unsetenv("OMPI_MCA_seed", &environ);
|
||||||
|
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_universe_uri",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_universe_uri",
|
||||||
orte_setup_hnp_orted_uri, true, &environ))) {
|
orte_setup_hnp_orted_uri, true, &environ))) {
|
||||||
fprintf(stderr, "orte_setup_hnp: could not set universe_uri in environ\n");
|
fprintf(stderr, "orte_setup_hnp: could not set universe_uri in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
#include "mca/iof/base/base.h"
|
#include "mca/iof/base/base.h"
|
||||||
#include "mca/rmgr/base/base.h"
|
#include "mca/rmgr/base/base.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "util/session_dir.h"
|
#include "util/session_dir.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
@ -79,7 +79,7 @@ int orte_system_finalize(void)
|
|||||||
orte_univ_info_finalize();
|
orte_univ_info_finalize();
|
||||||
|
|
||||||
/* cleanup the if data */
|
/* cleanup the if data */
|
||||||
ompi_iffinalize();
|
opal_iffinalize();
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "opal/threads/condition.h"
|
#include "opal/threads/condition.h"
|
||||||
|
|
||||||
#include "dps/dps.h"
|
#include "dps/dps.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/show_help.h"
|
#include "util/show_help.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
@ -204,12 +204,12 @@ int main(int argc, char *argv[])
|
|||||||
* can find it
|
* can find it
|
||||||
*/
|
*/
|
||||||
if (orted_globals.name) {
|
if (orted_globals.name) {
|
||||||
if (ORTE_SUCCESS != (ret = ompi_setenv("OMPI_MCA_ns_nds",
|
if (ORTE_SUCCESS != (ret = opal_setenv("OMPI_MCA_ns_nds",
|
||||||
"env", true, &environ))) {
|
"env", true, &environ))) {
|
||||||
fprintf(stderr, "orted: could not set my name in environ\n");
|
fprintf(stderr, "orted: could not set my name in environ\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (ORTE_SUCCESS != (ret = ompi_setenv("OMPI_MCA_ns_nds_name",
|
if (ORTE_SUCCESS != (ret = opal_setenv("OMPI_MCA_ns_nds_name",
|
||||||
orted_globals.name, true, &environ))) {
|
orted_globals.name, true, &environ))) {
|
||||||
fprintf(stderr, "orted: could not set my name in environ\n");
|
fprintf(stderr, "orted: could not set my name in environ\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -218,12 +218,12 @@ int main(int argc, char *argv[])
|
|||||||
* been passed in anyway. we set them here because the nds_env component
|
* been passed in anyway. we set them here because the nds_env component
|
||||||
* requires that they be set
|
* requires that they be set
|
||||||
*/
|
*/
|
||||||
if (ORTE_SUCCESS != (ret = ompi_setenv("OMPI_MCA_ns_nds_vpid_start",
|
if (ORTE_SUCCESS != (ret = opal_setenv("OMPI_MCA_ns_nds_vpid_start",
|
||||||
orted_globals.vpid_start, true, &environ))) {
|
orted_globals.vpid_start, true, &environ))) {
|
||||||
fprintf(stderr, "orted: could not set vpid_start in environ\n");
|
fprintf(stderr, "orted: could not set vpid_start in environ\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (ORTE_SUCCESS != (ret = ompi_setenv("OMPI_MCA_ns_nds_num_procs",
|
if (ORTE_SUCCESS != (ret = opal_setenv("OMPI_MCA_ns_nds_num_procs",
|
||||||
orted_globals.num_procs, true, &environ))) {
|
orted_globals.num_procs, true, &environ))) {
|
||||||
fprintf(stderr, "orted: could not set num_procs in environ\n");
|
fprintf(stderr, "orted: could not set num_procs in environ\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#include "util/printf.h"
|
#include "util/printf.h"
|
||||||
#include "opal/util/daemon_init.h"
|
#include "opal/util/daemon_init.h"
|
||||||
#include "util/universe_setup_file_io.h"
|
#include "util/universe_setup_file_io.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
|
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
|
|||||||
opal_set_using_threads(OMPI_HAVE_THREAD_SUPPORT);
|
opal_set_using_threads(OMPI_HAVE_THREAD_SUPPORT);
|
||||||
|
|
||||||
/* For malloc debugging */
|
/* For malloc debugging */
|
||||||
ompi_malloc_init();
|
opal_malloc_init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the MCA framework
|
* Initialize the MCA framework
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "class/orte_pointer_array.h"
|
#include "class/orte_pointer_array.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "util/ompi_environ.h"
|
#include "opal/util/opal_environ.h"
|
||||||
#include "util/path.h"
|
#include "util/path.h"
|
||||||
#include "opal/util/cmd_line.h"
|
#include "opal/util/cmd_line.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
@ -298,7 +298,7 @@ int main(int argc, char *argv[])
|
|||||||
id = mca_base_param_register_int("orte","debug","daemons",NULL,0);
|
id = mca_base_param_register_int("orte","debug","daemons",NULL,0);
|
||||||
mca_base_param_lookup_int(id,&iparam);
|
mca_base_param_lookup_int(id,&iparam);
|
||||||
if (iparam) {
|
if (iparam) {
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug_daemons",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_orte_debug_daemons",
|
||||||
"1", true, &environ))) {
|
"1", true, &environ))) {
|
||||||
fprintf(stderr, "orterun: could not set orte_debug_daemons in environ\n");
|
fprintf(stderr, "orterun: could not set orte_debug_daemons in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
@ -307,7 +307,7 @@ int main(int argc, char *argv[])
|
|||||||
id = mca_base_param_register_int("orte","debug",NULL,NULL,0);
|
id = mca_base_param_register_int("orte","debug",NULL,NULL,0);
|
||||||
mca_base_param_lookup_int(id,&iparam);
|
mca_base_param_lookup_int(id,&iparam);
|
||||||
if (iparam) {
|
if (iparam) {
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_orte_debug",
|
||||||
"1", true, &environ))) {
|
"1", true, &environ))) {
|
||||||
fprintf(stderr, "orterun: could not set orte_debug in environ\n");
|
fprintf(stderr, "orterun: could not set orte_debug in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
@ -316,7 +316,7 @@ int main(int argc, char *argv[])
|
|||||||
id = mca_base_param_register_int("orte","debug","daemons_file",NULL,0);
|
id = mca_base_param_register_int("orte","debug","daemons_file",NULL,0);
|
||||||
mca_base_param_lookup_int(id,&iparam);
|
mca_base_param_lookup_int(id,&iparam);
|
||||||
if (iparam) {
|
if (iparam) {
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug_daemons_file",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_orte_debug_daemons_file",
|
||||||
"1", true, &environ))) {
|
"1", true, &environ))) {
|
||||||
fprintf(stderr, "orterun: could not set orte_debug_daemons_file in environ\n");
|
fprintf(stderr, "orterun: could not set orte_debug_daemons_file in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
@ -325,7 +325,7 @@ int main(int argc, char *argv[])
|
|||||||
id = mca_base_param_register_int("orte","no_daemonize",NULL,NULL,0);
|
id = mca_base_param_register_int("orte","no_daemonize",NULL,NULL,0);
|
||||||
mca_base_param_lookup_int(id,&iparam);
|
mca_base_param_lookup_int(id,&iparam);
|
||||||
if (iparam) {
|
if (iparam) {
|
||||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_no_daemonize",
|
if (ORTE_SUCCESS != (rc = opal_setenv("OMPI_MCA_orte_no_daemonize",
|
||||||
"1", true, &environ))) {
|
"1", true, &environ))) {
|
||||||
fprintf(stderr, "orterun: could not set orte_no_daemonize in environ\n");
|
fprintf(stderr, "orterun: could not set orte_no_daemonize in environ\n");
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "../src/runtime/runtime.h"
|
#include "../src/runtime/runtime.h"
|
||||||
#include "../src/util/proc_info.h"
|
#include "../src/util/proc_info.h"
|
||||||
#include "../src/util/sys_info.h"
|
#include "../src/util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "../src/mca/base/base.h"
|
#include "../src/mca/base/base.h"
|
||||||
#include "../src/dps/dps.h"
|
#include "../src/dps/dps.h"
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/gpr.h"
|
#include "mca/gpr/gpr.h"
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
#include "mca/ns/ns_types.h"
|
#include "mca/ns/ns_types.h"
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "opal/threads/thread.h"
|
#include "opal/threads/thread.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
#include "mca/ns/ns_types.h"
|
#include "mca/ns/ns_types.h"
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
#include "mca/ns/ns.h"
|
#include "mca/ns/ns.h"
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "mca/schema/schema.h"
|
#include "mca/schema/schema.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "mca/mca.h"
|
#include "mca/mca.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/proc_info.h"
|
#include "util/proc_info.h"
|
||||||
#include "util/sys_info.h"
|
#include "util/sys_info.h"
|
||||||
#include "util/malloc.h"
|
#include "opal/util/malloc.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
@ -19,7 +19,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/test/support
|
|||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
ompi_numtostr \
|
ompi_numtostr \
|
||||||
ompi_if \
|
opal_if \
|
||||||
orte_os_path \
|
orte_os_path \
|
||||||
orte_sys_info \
|
orte_sys_info \
|
||||||
orte_os_create_dirpath \
|
orte_os_create_dirpath \
|
||||||
@ -37,11 +37,11 @@ ompi_numtostr_LDADD = \
|
|||||||
$(top_builddir)/test/support/libsupport.a
|
$(top_builddir)/test/support/libsupport.a
|
||||||
ompi_numtostr_DEPENDENCIES = $(ompi_numtostr_LDADD)
|
ompi_numtostr_DEPENDENCIES = $(ompi_numtostr_LDADD)
|
||||||
|
|
||||||
ompi_if_SOURCES = ompi_if.c
|
opal_if_SOURCES = opal_if.c
|
||||||
ompi_if_LDADD = \
|
opal_if_LDADD = \
|
||||||
$(top_builddir)/src/libmpi.la \
|
$(top_builddir)/src/libmpi.la \
|
||||||
$(top_builddir)/test/support/libsupport.a
|
$(top_builddir)/test/support/libsupport.a
|
||||||
ompi_if_DEPENDENCIES = $(ompi_if_LDADD)
|
opal_if_DEPENDENCIES = $(opal_if_LDADD)
|
||||||
|
|
||||||
opal_argv_SOURCES = opal_argv.c
|
opal_argv_SOURCES = opal_argv.c
|
||||||
opal_argv_LDADD = \
|
opal_argv_LDADD = \
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/runtime.h"
|
#include "runtime/runtime.h"
|
||||||
#include "util/if.h"
|
#include "opal/util/if.h"
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ test_ifaddrtoname(char *addr)
|
|||||||
char addrname[100];
|
char addrname[100];
|
||||||
int len = 99;
|
int len = 99;
|
||||||
|
|
||||||
ret = ompi_ifaddrtoname(addr, addrname, len);
|
ret = opal_ifaddrtoname(addr, addrname, len);
|
||||||
|
|
||||||
if (ret == OMPI_SUCCESS) {
|
if (ret == OMPI_SUCCESS) {
|
||||||
return true;
|
return true;
|
||||||
@ -60,7 +60,7 @@ main(int argc, char *argv[])
|
|||||||
char hostname[MAXHOSTNAMELEN];
|
char hostname[MAXHOSTNAMELEN];
|
||||||
|
|
||||||
orte_init();
|
orte_init();
|
||||||
test_init("ompi_if");
|
test_init("opal_if");
|
||||||
|
|
||||||
/* 127.0.0.1 */
|
/* 127.0.0.1 */
|
||||||
if (test_ifaddrtoname("127.0.0.1")) {
|
if (test_ifaddrtoname("127.0.0.1")) {
|
||||||
@ -68,7 +68,7 @@ main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
test_failure("ifaddrtoname test failed for 127.0.0.1");
|
test_failure("ifaddrtoname test failed for 127.0.0.1");
|
||||||
}
|
}
|
||||||
if (ompi_ifislocal("127.0.0.1")) {
|
if (opal_ifislocal("127.0.0.1")) {
|
||||||
test_success();
|
test_success();
|
||||||
} else {
|
} else {
|
||||||
test_failure("ifislocal test failed for 127.0.0.1");
|
test_failure("ifislocal test failed for 127.0.0.1");
|
||||||
@ -80,7 +80,7 @@ main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
test_failure("ifaddrtoname test failed for localhost");
|
test_failure("ifaddrtoname test failed for localhost");
|
||||||
}
|
}
|
||||||
if (ompi_ifislocal("localhost")) {
|
if (opal_ifislocal("localhost")) {
|
||||||
test_success();
|
test_success();
|
||||||
} else {
|
} else {
|
||||||
test_failure("ifislocal test failed for localhost");
|
test_failure("ifislocal test failed for localhost");
|
||||||
@ -92,8 +92,8 @@ main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
test_success();
|
test_success();
|
||||||
}
|
}
|
||||||
if (ompi_ifislocal("0.0.0.0")) {
|
if (opal_ifislocal("0.0.0.0")) {
|
||||||
test_failure("ompi_ifislocal test failed for 0.0.0.0");
|
test_failure("opal_ifislocal test failed for 0.0.0.0");
|
||||||
} else {
|
} else {
|
||||||
test_success();
|
test_success();
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
printf("This should generate a warning:\n");
|
printf("This should generate a warning:\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (ompi_ifislocal("foo.example.com")) {
|
if (opal_ifislocal("foo.example.com")) {
|
||||||
test_failure("ifislocal test failed for foo.example.com");
|
test_failure("ifislocal test failed for foo.example.com");
|
||||||
} else {
|
} else {
|
||||||
test_success();
|
test_success();
|
||||||
@ -121,7 +121,7 @@ main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
test_failure("ifaddrtoname test failed for local host name");
|
test_failure("ifaddrtoname test failed for local host name");
|
||||||
}
|
}
|
||||||
if (ompi_ifislocal(hostname)) {
|
if (opal_ifislocal(hostname)) {
|
||||||
test_success();
|
test_success();
|
||||||
} else {
|
} else {
|
||||||
test_failure("ifislocal test failed for local host name");
|
test_failure("ifislocal test failed for local host name");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "util/numtostr.h"
|
#include "opal/util/numtostr.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -14,11 +14,11 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
test_init("ompi_numtostr_t");
|
test_init("ompi_numtostr_t");
|
||||||
|
|
||||||
tst = ompi_ltostr(10);
|
tst = opal_ltostr(10);
|
||||||
expected = malloc(sizeof(long) * 8);
|
expected = malloc(sizeof(long) * 8);
|
||||||
snprintf(expected, sizeof(long) * 8, "%d", 10);
|
snprintf(expected, sizeof(long) * 8, "%d", 10);
|
||||||
if (strcmp(tst, expected) != 0) {
|
if (strcmp(tst, expected) != 0) {
|
||||||
test_failure("ompi_ltostr test failed");
|
test_failure("opal_ltostr test failed");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
test_success();
|
test_success();
|
||||||
@ -27,11 +27,11 @@ main(int argc, char *argv[])
|
|||||||
free(tst);
|
free(tst);
|
||||||
free(expected);
|
free(expected);
|
||||||
|
|
||||||
tst = ompi_dtostr(5.32);
|
tst = opal_dtostr(5.32);
|
||||||
expected = malloc(sizeof(long) * 8);
|
expected = malloc(sizeof(long) * 8);
|
||||||
snprintf(expected, sizeof(long) * 8, "%f", 5.32);
|
snprintf(expected, sizeof(long) * 8, "%f", 5.32);
|
||||||
if (strcmp(tst, expected) != 0) {
|
if (strcmp(tst, expected) != 0) {
|
||||||
test_failure("ompi_dtostr test failed");
|
test_failure("opal_dtostr test failed");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
test_success();
|
test_success();
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user