621af3aa07
OS X has weirdness when static linking. If a symbol is not initialized, it is put into the common block section, and Weird Things happen (linking when trying to using that global symbol will fail). If you initialize the variable, it goes into a different section (and linking to it will work). This link (that might go stale someday) has some information about OS X linker scope and treatment of symbol definitions: https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/executing_files.html#//apple_ref/doc/uid/TP40001829-98432-TPXREF120 Fixes #375.
75 строки
2.0 KiB
C
75 строки
2.0 KiB
C
/*
|
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
|
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
|
|
#include "opal_config.h"
|
|
#include "opal/constants.h"
|
|
|
|
#include "opal/mca/mca.h"
|
|
#include "opal/util/output.h"
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "opal/mca/pmix/pmix.h"
|
|
#include "opal/mca/pmix/base/base.h"
|
|
|
|
|
|
/*
|
|
* The following file was created by configure. It contains extern
|
|
* components and the definition of an array of pointers to each
|
|
* module's public mca_base_module_t struct.
|
|
*/
|
|
|
|
#include "opal/mca/pmix/base/static-components.h"
|
|
|
|
/* Note that this initializer is important -- do not remove it! See
|
|
https://github.com/open-mpi/ompi/issues/375 for details. */
|
|
opal_pmix_base_module_t opal_pmix = {
|
|
.init = (opal_pmix_base_module_init_fn_t) NULL
|
|
};
|
|
bool opal_pmix_use_collective = false;
|
|
bool opal_pmix_base_allow_delayed_server = false;
|
|
|
|
static int opal_pmix_base_frame_register(mca_base_register_flag_t flags)
|
|
{
|
|
return OPAL_SUCCESS;
|
|
}
|
|
|
|
static int opal_pmix_base_frame_close(void)
|
|
{
|
|
int rc;
|
|
|
|
rc = mca_base_framework_components_close(&opal_pmix_base_framework, NULL);
|
|
/* reset the opal_pmix function pointers to NULL */
|
|
memset(&opal_pmix, 0, sizeof(opal_pmix));
|
|
return rc;
|
|
}
|
|
|
|
static int opal_pmix_base_frame_open(mca_base_open_flag_t flags)
|
|
{
|
|
int rc;
|
|
|
|
/* Open up all available components */
|
|
rc = mca_base_framework_components_open(&opal_pmix_base_framework, flags);
|
|
/* ensure the function pointers are NULL */
|
|
memset(&opal_pmix, 0, sizeof(opal_pmix));
|
|
return rc;
|
|
}
|
|
|
|
MCA_BASE_FRAMEWORK_DECLARE(opal, pmix, "OPAL PMI Client Framework",
|
|
opal_pmix_base_frame_register,
|
|
opal_pmix_base_frame_open,
|
|
opal_pmix_base_frame_close,
|
|
mca_pmix_base_static_components, 0);
|
|
|
|
OBJ_CLASS_INSTANCE(pmix_info_t,
|
|
opal_list_item_t,
|
|
NULL, NULL);
|
|
|