1
1

Brice Goglin noticed that mpi_paffinity_alone didn't seem to be doing

anything for non-MPI apps.  Oops!  (But before you freak out, gentle
reader, note that mpi_paffinity_alone for MPI apps still worked fine)
When we made the switchover somewhere in the 1.3 series to have the
orted's do processor binding, then stuff like:

  mpirun --mca mpi_paffinity_alone 1 hostname

should have bound hostname to processor 0.  But it didn't because of a
subtle startup ordering issue: the MCA param registration for
opal_paffinity_alone was in the paffinity base (vs. being in
opal/runtime/opal_params.c), but it didn't actually get registered
until after the global variable opal_paffinity_alone was checked to
see if we wanted old-style affinity bindings.  Oops.

However, for MPI apps, even though the orted didn't do the binding,
ompi_mpi_init() would notice that opal_paffinity_alone was set, yet
the process didn't seem to be bound.  So the MPI process would bind
itself (this was done to support the running-without-orteds
scenarios).  Hence, MPI apps still obeyed mpi_paffinity_alone
semantics.

But note that the error described above caused the new mpirun switch
--report-bindings to not work with mpi_paffinity_alone=1, meaning that
the orted would not report the bindings when mpi_paffinity_alone was
set to 1 (it ''did'' correctly report bindings if you used
--bind-to-core or one of the other binding options).

This commit separates out the paffinity base MCA param registration
into a small function that can be called at the Right place during the
startup sequence.

This commit was SVN r22602.
Этот коммит содержится в:
Jeff Squyres 2010-02-10 22:32:00 +00:00
родитель 583bb42739
Коммит a89dc623b0
3 изменённых файлов: 35 добавлений и 8 удалений

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -31,6 +31,16 @@
BEGIN_C_DECLS
/**
* Register MCA params for the paffinity base.
*
* @retval OPAL_SUCCESS Upon success
*
* This function is invoked by opal_register_params(). It registers
* some paffinity-wide MCA parameters.
*/
OPAL_DECLSPEC int opal_paffinity_base_register_params(void);
/**
* Initialize the paffinity MCA framework
*

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -47,10 +47,9 @@ bool opal_paffinity_alone = false;
char *opal_paffinity_base_slot_list;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
* Register some paffinity-wide MCA params
*/
int opal_paffinity_base_open(void)
int opal_paffinity_base_register_params(void)
{
int value, id;
@ -71,7 +70,7 @@ int opal_paffinity_base_open(void)
false, false,
0, NULL);
/* register the historical mpi_paffinity_alone synonym, but don't
* declare it deprecated so we don't scare the users
* declare it deprecated so we don't scare the users.
*
* Yes, this breaks the abstraction barrier, but as indicated
* on the developer list....live with it. :-)
@ -80,6 +79,15 @@ int opal_paffinity_base_open(void)
mca_base_param_lookup_int(id, &value);
opal_paffinity_alone = OPAL_INT_TO_BOOL(value);
return OPAL_SUCCESS;
}
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int opal_paffinity_base_open(void)
{
opal_paffinity_base_components_opened_valid = false;
mca_base_param_reg_string_name("opal", "paffinity_base_slot_list",

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

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
*
@ -32,9 +32,12 @@
#include "opal/datatype/opal_datatype.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/threads/mutex.h"
#include "opal/mca/paffinity/base/base.h"
int opal_register_params(void)
{
int ret;
/*
* This string is going to be used in opal/util/stacktrace.c
*/
@ -104,5 +107,11 @@ int opal_register_params(void)
}
#endif
/* The ddt engine has a few parameters */
return opal_datatype_register_params();
ret = opal_datatype_register_params();
if (OPAL_SUCCESS != ret) {
return ret;
}
/* Paffinity base also has some parameters */
return opal_paffinity_base_register_params();
}