1
1

Fully fix the PMI2 warning - turned out to be larger than originally thought due to the way the function was being handled across multiple files. Properly resolve the problem by not compiling the file if PMI2 is not desired, and then appropriately setting the visibility of the function within the module

Refs trac:4400

This commit was SVN r31084.

The following Trac tickets were found above:
  Ticket 4400 --> https://svn.open-mpi.org/trac/ompi/ticket/4400
Этот коммит содержится в:
Ralph Castain 2014-03-17 17:36:37 +00:00
родитель e152449be4
Коммит f259d50ed7
5 изменённых файлов: 24 добавлений и 18 удалений

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

@ -144,4 +144,5 @@ AC_DEFUN([OPAL_CHECK_PMI],[
[$opal_have_pmi2],
[Whether we have PMI2 support])
AM_CONDITIONAL(WANT_PMI_SUPPORT, [test "$opal_enable_pmi" = 1])
AM_CONDITIONAL(WANT_PMI2_SUPPORT, [test "$opal_have_pmi2" = 1])
])

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

@ -2,6 +2,7 @@
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -14,8 +15,11 @@ AM_CPPFLAGS = $(grpcomm_pmi_CPPFLAGS)
sources = \
grpcomm_pmi.h \
grpcomm_pmi_module.c \
grpcomm_pmi_component.c \
pmi2_pmap_parser.c
grpcomm_pmi_component.c
if WANT_PMI2_SUPPORT
sources += pmi2_pmap_parser.c
endif
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la

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

@ -1,6 +1,7 @@
/* -*- C -*-
*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -33,6 +34,11 @@ int orte_grpcomm_pmi_component_query(mca_base_module_t **module, int *priority);
ORTE_MODULE_DECLSPEC extern orte_grpcomm_base_component_t mca_grpcomm_pmi_component;
extern orte_grpcomm_base_module_t orte_grpcomm_pmi_module;
#if WANT_PMI2_SUPPORT
ORTE_MODULE_DECLSPEC int *orte_grpcomm_pmi2_parse_pmap(char *pmap, int my_rank,
int *node, int *nlrs);
#endif
END_C_DECLS
#endif

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

@ -5,6 +5,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All
* rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -138,9 +139,6 @@ static int pmi_allgather(orte_grpcomm_collective_t *coll)
return ORTE_ERR_NOT_SUPPORTED;
}
#if WANT_PMI2_SUPPORT
int *pmi2_parse_pmap(char *pmap, int my_rank, int *node, int *nlrs);
#endif
/*** MODEX SECTION ***/
static int modex(orte_grpcomm_collective_t *coll)
@ -171,7 +169,7 @@ static int modex(orte_grpcomm_collective_t *coll)
return ORTE_ERROR;
}
local_ranks = pmi2_parse_pmap(pmapping, ORTE_PROC_MY_NAME->vpid, &my_node, &local_rank_count);
local_ranks = orte_grpcomm_pmi2_parse_pmap(pmapping, ORTE_PROC_MY_NAME->vpid, &my_node, &local_rank_count);
if (NULL == local_ranks) {
opal_output(0, "%s could not get PMI_process_mapping",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));

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

@ -50,7 +50,6 @@ Note that ranks increase by column. Tuple (0,2,3) looks like:
2 5
*/
#if WANT_PMI2_SUPPORT
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -132,8 +131,8 @@ static int *find_lrs(char *map, int my_node, int *nlrs)
* @return array that contains ranks local to my_rank or NULL
* on failure. Array must be freed by the caller.
*/
static int *pmi2_parse_pmap(char *pmap, int my_rank,
int *node, int *nlrs)
int *orte_grpcomm_pmi2_parse_pmap(char *pmap, int my_rank,
int *node, int *nlrs)
{
char *p;
@ -150,8 +149,6 @@ static int *pmi2_parse_pmap(char *pmap, int my_rank,
return find_lrs(p, *node, nlrs);
}
#endif
#ifdef STANDALONE_TEST
#include <assert.h>
@ -182,7 +179,7 @@ int main(int argc, char **argv)
if (argc == 3) {
me = atoi(argv[1]);
lrs = pmi2_parse_pmap(argv[2], me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(argv[2], me, &node, &n);
if (NULL == lrs) {
printf("can not parse pmap\n");
exit(1);
@ -194,7 +191,7 @@ int main(int argc, char **argv)
pmap = "(vector,(0,2,2))";
me = 1;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 2);
assert(memcmp(lrs, a1, 2) == 0);
@ -203,7 +200,7 @@ int main(int argc, char **argv)
pmap = "(vector,(0,2,2))";
me = 2;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 2);
assert(memcmp(lrs, a2, 2) == 0);
@ -213,7 +210,7 @@ int main(int argc, char **argv)
/* cyclic distro which skips node 0 */
pmap = "(vector,(1,2,1),(1,2,1))";
me = 0;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 2);
assert(memcmp(lrs, a3, n) == 0);
@ -221,7 +218,7 @@ int main(int argc, char **argv)
pmap = "(vector,(1,2,1),(1,2,1))";
me = 3;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 2);
assert(memcmp(lrs, a4, n) == 0);
@ -229,7 +226,7 @@ int main(int argc, char **argv)
pmap = "(vector,(0,4,4),(0,1,2),(1,3,1))";
me = 3;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 6);
assert(memcmp(lrs, a5, n) == 0);
@ -237,7 +234,7 @@ int main(int argc, char **argv)
pmap = "(vector,(0,4,4),(0,1,2),(1,3,1))";
me = 10;
lrs = pmi2_parse_pmap(pmap, me, &node, &n);
lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n);
assert(lrs);
assert(n == 5);
assert(memcmp(lrs, a6, n) == 0);