2004-09-16 04:00:09 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-09-01 05:07:30 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2006-12-05 22:07:02 +03:00
|
|
|
* Copyright (c) 2006 University of Houston. All rights reserved.
|
Fixes trac:817
The C++ bindings were not tracking keyvals properly -- they were
freeing some internal meta data when Free_keyval() was called, not
when the keyval was actually destroyed (keyvals are refcounted in the
C layer, just like all other MPI objects, because they can live for
long after their corresponding Free call is invoked). This commit
fixes this problem and several other things:
* Add infrastructure on the ompi_attribute_keyval_t for an "extra"
destructor pointer that will be invoked during the "real"
constructor (i.e., when OBJ_RELEASE puts the refcount to 0). This
allows calling back into the C++ layer to release meta data
associated with the keyval.
* Adjust all cases where keyvals are created to pass in relevant
destructors (NULL or the C++ destructor).
* Do essentially the same for MPI::Comm, MPI::Win, and MPI:Datatype:
* Move several functions out of the .cc file into the _inln.h file
since they no longer require locks
* Make the 4 Create_keyval() functions call a common back-end
keyval creation function that does the Right Thing depending on
whether C or C++ function pointers were used for the keyval
functions. The back-end function does not call the corresponding
C MPI_*_create_keyval function, but rather does the work itself
so that it can associate a "destructor" callback for the C++
bindings for when the keyval is actually destroyed.
* Change a few type names to be more indicative of what they are
(mostly dealing with keyvals [not "keys"]).
* Add the 3 missing bindings for MPI::Comm::Create_keyval().
* Remove MPI::Comm::comm_map (and associated types) because it's no
longer necessary in the intercepts -- it was a by-product of being
a portable C++ bindings layer. Now we can just query the C layer
directly to figure out what type a communicator is. This solves
some logistics / callback issues, too.
* Rename several types, variables, and fix many comments in the
back-end C attribute implementation to make the names really
reflect what they are (keyvals vs. attributes). The previous names
heavily overloaded the name "key" and were ''extremely''
confusing.
This commit was SVN r13565.
The following Trac tickets were found above:
Ticket 817 --> https://svn.open-mpi.org/trac/ompi/ticket/817
2007-02-09 02:50:04 +03:00
|
|
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2005-09-01 05:07:30 +04:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2005-09-01 05:07:30 +04:00
|
|
|
*
|
2004-09-16 04:00:09 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Setup the predefined attributes in MPI.
|
|
|
|
*
|
|
|
|
* A number of pre-defined attributes are created here, most of which
|
|
|
|
* are exactly what one would expect, but there are a few exceptions
|
|
|
|
* -- so they're documented here.
|
|
|
|
*
|
|
|
|
* Predefined attributes are integer-valued or address-valued (per
|
|
|
|
* MPI-2; see section 4.12.7, keeping in mind that Example 4.13 is
|
|
|
|
* totally wrong -- see src/attribute/attribute.h for a lengthy
|
2005-09-01 05:07:30 +04:00
|
|
|
* explanation of this).
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
*
|
|
|
|
* The only address-valued attribute is MPI_WIN_BASE. We treat it as
|
|
|
|
* if it were set from C. All other attributes are integer-valued.
|
|
|
|
* We treat them as if they were set from Fortran MPI-1 (i.e.,
|
|
|
|
* MPI_ATTR_PUT) or Fortran MPI-2 (i.e., MPI_xxx_ATTR_SET). Most
|
|
|
|
* attributes are MPI-1 integer-valued, meaning that they are the size
|
|
|
|
* of MPI_Fint (INTEGER). But MPI_WIN_SIZE and MPI_WIN_DISP_UNIT are
|
|
|
|
* MPI-2 integer-valued, meaning that they are the size of MPI_Aint
|
|
|
|
* (INTEGER(KIND=MPI_ADDRESS_KIND)).
|
|
|
|
*
|
|
|
|
* MPI_TAG_UB is set to a fixed upper limit.
|
|
|
|
*
|
|
|
|
* MPI_HOST is set to MPI_PROC_NULL (per MPI-1, see 7.1.1, p192).
|
|
|
|
*
|
2005-07-01 01:29:22 +04:00
|
|
|
* MPI_IO is set to MPI_ANY_SOURCE. We may need to revist this.
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
*
|
|
|
|
* MPI_WTIME_IS_GLOBAL is set to 0 (a conservative answer).
|
|
|
|
*
|
|
|
|
* MPI_APPNUM is set as the result of a GPR subscription.
|
|
|
|
*
|
|
|
|
* MPI_LASTUSEDCODE is set to an initial value and is reset every time
|
2006-12-05 22:07:02 +03:00
|
|
|
* MPI_ADD_ERROR_CLASS or MPI_ADD_ERROR_CODE is invoked.
|
|
|
|
* Its copy function is set to
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
* MPI_COMM_NULL_COPY_FN, meaning that *only* MPI_COMM_WORLD will have
|
|
|
|
* this attribute value. As such, we only have to update
|
|
|
|
* MPI_COMM_WORLD when this value changes (i.e., since this is an
|
|
|
|
* integer-valued attribute, we have to update this attribute on every
|
|
|
|
* communicator -- using NULL_COPY_FN ensures that only MPI_COMM_WORLD
|
|
|
|
* has this attribute value set).
|
|
|
|
*
|
|
|
|
* MPI_UNIVERSE_SIZE is set as the result of a GPR subscription.
|
|
|
|
*
|
|
|
|
* MPI_WIN_BASE is an address-valued attribute, and is set directly
|
|
|
|
* from MPI_WIN_CREATE. MPI_WIN_SIZE and MPI_WIN_DISP_UNIT are both
|
|
|
|
* integer-valued attributes, *BUT* at least the MPI_WIN_SIZE is an
|
|
|
|
* MPI_Aint, so in terms of consistency, both should be the same --
|
|
|
|
* hence, we treat them as MPI-2 Fortran integer-valued attributes.
|
|
|
|
* All three of these atrributes have NULL_COPY_FN copy functions; it
|
|
|
|
* doesn't make sense to copy them to new windows (because they're
|
|
|
|
* values specific and unique to each window) -- especially when
|
|
|
|
* WIN_CREATE will explicitly set them on new windows anyway.
|
|
|
|
*
|
|
|
|
* These are not supported yet, but are included here for consistency:
|
|
|
|
*
|
|
|
|
* MPI_IMPI_CLIENT_SIZE, MPI_IMPI_CLIENT_COLOR, MPI_IMPI_HOST_SIZE,
|
|
|
|
* and MPI_IMPI_HOST_COLOR are integer-valued attributes.
|
|
|
|
*/
|
|
|
|
|
2004-09-16 04:00:09 +04:00
|
|
|
#include "ompi_config.h"
|
|
|
|
|
Repair the MPI-2 dynamic operations. This includes:
1. repair of the linear and direct routed modules
2. repair of the ompi/pubsub/orte module to correctly init routes to the ompi-server, and correctly handle failure to correctly parse the provided ompi-server URI
3. modification of orterun to accept both "file" and "FILE" for designating where the ompi-server URI is to be found - purely a convenience feature
4. resolution of a message ordering problem during the connect/accept handshake that allowed the "send-first" proc to attempt to send to the "recv-first" proc before the HNP had actually updated its routes.
Let this be a further reminder to all - message ordering is NOT guaranteed in the OOB
5. Repair the ompi/dpm/orte module to correctly init routes during connect/accept.
Reminder to all: messages sent to procs in another job family (i.e., started by a different mpirun) are ALWAYS routed through the respective HNPs. As per the comments in orte/routed, this is REQUIRED to maintain connect/accept (where only the root proc on each side is capable of init'ing the routes), allow communication between mpirun's using different routing modules, and to minimize connections on tools such as ompi-server. It is all taken care of "under the covers" by the OOB to ensure that a route back to the sender is maintained, even when the different mpirun's are using different routed modules.
6. corrections in the orte/odls to ensure proper identification of daemons participating in a dynamic launch
7. corrections in build/nidmap to support update of an existing nidmap during dynamic launch
8. corrected implementation of the update_arch function in the ESS, along with consolidation of a number of ESS operations into base functions for easier maintenance. The ability to support info from multiple jobs was added, although we don't currently do so - this will come later to support further fault recovery strategies
9. minor updates to several functions to remove unnecessary and/or no longer used variables and envar's, add some debugging output, etc.
10. addition of a new macro ORTE_PROC_IS_DAEMON that resolves to true if the provided proc is a daemon
There is still more cleanup to be done for efficiency, but this at least works.
Tested on single-node Mac, multi-node SLURM via odin. Tests included connect/accept, publish/lookup/unpublish, comm_spawn, comm_spawn_multiple, and singleton comm_spawn.
Fixes ticket #1256
This commit was SVN r18804.
2008-07-03 21:53:37 +04:00
|
|
|
#if HAVE_STDLIB_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
2004-09-16 04:00:09 +04:00
|
|
|
#include "mpi.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/attribute/attribute.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-12-05 22:07:02 +03:00
|
|
|
#include "ompi/errhandler/errcode.h"
|
2005-08-09 18:56:04 +04:00
|
|
|
#include "ompi/communicator/communicator.h"
|
|
|
|
#include "ompi/mca/pml/pml.h"
|
2007-07-02 05:33:35 +04:00
|
|
|
#include "orte/util/proc_info.h"
|
2004-09-16 04:00:09 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Private functions
|
|
|
|
*/
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int create_comm(int target_keyval, bool want_inherit);
|
2006-02-27 18:15:48 +03:00
|
|
|
static int free_comm(int keyval);
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int create_win(int target_keyval);
|
2006-02-27 18:15:48 +03:00
|
|
|
static int free_win(int keyval);
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int set_f(int keyval, MPI_Fint value);
|
2004-09-16 04:00:09 +04:00
|
|
|
|
|
|
|
|
|
|
|
int ompi_attr_create_predefined(void)
|
2004-11-20 22:12:43 +03:00
|
|
|
{
|
2007-07-02 05:33:35 +04:00
|
|
|
int ret;
|
Repair the MPI-2 dynamic operations. This includes:
1. repair of the linear and direct routed modules
2. repair of the ompi/pubsub/orte module to correctly init routes to the ompi-server, and correctly handle failure to correctly parse the provided ompi-server URI
3. modification of orterun to accept both "file" and "FILE" for designating where the ompi-server URI is to be found - purely a convenience feature
4. resolution of a message ordering problem during the connect/accept handshake that allowed the "send-first" proc to attempt to send to the "recv-first" proc before the HNP had actually updated its routes.
Let this be a further reminder to all - message ordering is NOT guaranteed in the OOB
5. Repair the ompi/dpm/orte module to correctly init routes during connect/accept.
Reminder to all: messages sent to procs in another job family (i.e., started by a different mpirun) are ALWAYS routed through the respective HNPs. As per the comments in orte/routed, this is REQUIRED to maintain connect/accept (where only the root proc on each side is capable of init'ing the routes), allow communication between mpirun's using different routing modules, and to minimize connections on tools such as ompi-server. It is all taken care of "under the covers" by the OOB to ensure that a route back to the sender is maintained, even when the different mpirun's are using different routed modules.
6. corrections in the orte/odls to ensure proper identification of daemons participating in a dynamic launch
7. corrections in build/nidmap to support update of an existing nidmap during dynamic launch
8. corrected implementation of the update_arch function in the ESS, along with consolidation of a number of ESS operations into base functions for easier maintenance. The ability to support info from multiple jobs was added, although we don't currently do so - this will come later to support further fault recovery strategies
9. minor updates to several functions to remove unnecessary and/or no longer used variables and envar's, add some debugging output, etc.
10. addition of a new macro ORTE_PROC_IS_DAEMON that resolves to true if the provided proc is a daemon
There is still more cleanup to be done for efficiency, but this at least works.
Tested on single-node Mac, multi-node SLURM via odin. Tests included connect/accept, publish/lookup/unpublish, comm_spawn, comm_spawn_multiple, and singleton comm_spawn.
Fixes ticket #1256
This commit was SVN r18804.
2008-07-03 21:53:37 +04:00
|
|
|
char *univ_size;
|
|
|
|
int usize;
|
2005-09-01 05:07:30 +04:00
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
/* Create all the keyvals */
|
|
|
|
|
|
|
|
/* DO NOT CHANGE THE ORDER OF CREATING THESE KEYVALS! This order
|
|
|
|
strictly adheres to the order in mpi.h. If you change the
|
|
|
|
order here, you must change the order in mpi.h as well! */
|
2005-09-01 05:07:30 +04:00
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = create_comm(MPI_TAG_UB, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_HOST, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_IO, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_WTIME_IS_GLOBAL, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_APPNUM, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_LASTUSEDCODE, false)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_UNIVERSE_SIZE, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_win(MPI_WIN_BASE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_win(MPI_WIN_SIZE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_win(MPI_WIN_DISP_UNIT)) ||
|
|
|
|
#if 0
|
|
|
|
/* JMS For when we implement IMPI */
|
2006-02-27 18:15:48 +03:00
|
|
|
OMPI_SUCCESS != (ret = create_comm(IMPI_CLIENT_SIZE, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(IMPI_CLIENT_COLOR, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(IMPI_HOST_SIZE, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(IMPI_HOST_COLOR, true)) ||
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
#endif
|
|
|
|
0) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2007-07-02 05:33:35 +04:00
|
|
|
/* Set default values for everything except MPI_UNIVERSE_SIZE */
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
|
2005-08-14 07:14:20 +04:00
|
|
|
if (OMPI_SUCCESS != (ret = set_f(MPI_TAG_UB, mca_pml.pml_max_tag)) ||
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
OMPI_SUCCESS != (ret = set_f(MPI_HOST, MPI_PROC_NULL)) ||
|
2005-07-01 01:29:22 +04:00
|
|
|
OMPI_SUCCESS != (ret = set_f(MPI_IO, MPI_ANY_SOURCE)) ||
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
OMPI_SUCCESS != (ret = set_f(MPI_WTIME_IS_GLOBAL, 0)) ||
|
2005-09-01 05:07:30 +04:00
|
|
|
OMPI_SUCCESS != (ret = set_f(MPI_LASTUSEDCODE,
|
2006-12-05 22:07:02 +03:00
|
|
|
ompi_mpi_errcode_lastused)) ||
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
#if 0
|
|
|
|
/* JMS For when we implement IMPI */
|
2006-02-27 18:15:48 +03:00
|
|
|
OMPI_SUCCESS != (ret = set(IMPI_CLIENT_SIZE,
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
&attr_impi_client_size)) ||
|
2006-02-27 18:15:48 +03:00
|
|
|
OMPI_SUCCESS != (ret = set(IMPI_CLIENT_COLOR,
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
&attr_impi_client_color)) ||
|
2006-02-27 18:15:48 +03:00
|
|
|
OMPI_SUCCESS != (ret = set(IMPI_HOST_SIZE,
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
&attr_impi_host_size)) ||
|
2006-02-27 18:15:48 +03:00
|
|
|
OMPI_SUCCESS != (ret = set(IMPI_HOST_COLOR,
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
&attr_impi_host_color)) ||
|
|
|
|
#endif
|
|
|
|
0) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2007-07-02 05:33:35 +04:00
|
|
|
/* If the universe size is set, then use it. Otherwise default
|
|
|
|
* to the size of MPI_COMM_WORLD */
|
Repair the MPI-2 dynamic operations. This includes:
1. repair of the linear and direct routed modules
2. repair of the ompi/pubsub/orte module to correctly init routes to the ompi-server, and correctly handle failure to correctly parse the provided ompi-server URI
3. modification of orterun to accept both "file" and "FILE" for designating where the ompi-server URI is to be found - purely a convenience feature
4. resolution of a message ordering problem during the connect/accept handshake that allowed the "send-first" proc to attempt to send to the "recv-first" proc before the HNP had actually updated its routes.
Let this be a further reminder to all - message ordering is NOT guaranteed in the OOB
5. Repair the ompi/dpm/orte module to correctly init routes during connect/accept.
Reminder to all: messages sent to procs in another job family (i.e., started by a different mpirun) are ALWAYS routed through the respective HNPs. As per the comments in orte/routed, this is REQUIRED to maintain connect/accept (where only the root proc on each side is capable of init'ing the routes), allow communication between mpirun's using different routing modules, and to minimize connections on tools such as ompi-server. It is all taken care of "under the covers" by the OOB to ensure that a route back to the sender is maintained, even when the different mpirun's are using different routed modules.
6. corrections in the orte/odls to ensure proper identification of daemons participating in a dynamic launch
7. corrections in build/nidmap to support update of an existing nidmap during dynamic launch
8. corrected implementation of the update_arch function in the ESS, along with consolidation of a number of ESS operations into base functions for easier maintenance. The ability to support info from multiple jobs was added, although we don't currently do so - this will come later to support further fault recovery strategies
9. minor updates to several functions to remove unnecessary and/or no longer used variables and envar's, add some debugging output, etc.
10. addition of a new macro ORTE_PROC_IS_DAEMON that resolves to true if the provided proc is a daemon
There is still more cleanup to be done for efficiency, but this at least works.
Tested on single-node Mac, multi-node SLURM via odin. Tests included connect/accept, publish/lookup/unpublish, comm_spawn, comm_spawn_multiple, and singleton comm_spawn.
Fixes ticket #1256
This commit was SVN r18804.
2008-07-03 21:53:37 +04:00
|
|
|
univ_size = getenv("OMPI_UNIVERSE_SIZE");
|
|
|
|
if (NULL == univ_size || (usize = strtol(univ_size, NULL, 0)) <= 0) {
|
2007-07-02 05:33:35 +04:00
|
|
|
ret = set_f(MPI_UNIVERSE_SIZE, ompi_comm_size(MPI_COMM_WORLD));
|
Repair the MPI-2 dynamic operations. This includes:
1. repair of the linear and direct routed modules
2. repair of the ompi/pubsub/orte module to correctly init routes to the ompi-server, and correctly handle failure to correctly parse the provided ompi-server URI
3. modification of orterun to accept both "file" and "FILE" for designating where the ompi-server URI is to be found - purely a convenience feature
4. resolution of a message ordering problem during the connect/accept handshake that allowed the "send-first" proc to attempt to send to the "recv-first" proc before the HNP had actually updated its routes.
Let this be a further reminder to all - message ordering is NOT guaranteed in the OOB
5. Repair the ompi/dpm/orte module to correctly init routes during connect/accept.
Reminder to all: messages sent to procs in another job family (i.e., started by a different mpirun) are ALWAYS routed through the respective HNPs. As per the comments in orte/routed, this is REQUIRED to maintain connect/accept (where only the root proc on each side is capable of init'ing the routes), allow communication between mpirun's using different routing modules, and to minimize connections on tools such as ompi-server. It is all taken care of "under the covers" by the OOB to ensure that a route back to the sender is maintained, even when the different mpirun's are using different routed modules.
6. corrections in the orte/odls to ensure proper identification of daemons participating in a dynamic launch
7. corrections in build/nidmap to support update of an existing nidmap during dynamic launch
8. corrected implementation of the update_arch function in the ESS, along with consolidation of a number of ESS operations into base functions for easier maintenance. The ability to support info from multiple jobs was added, although we don't currently do so - this will come later to support further fault recovery strategies
9. minor updates to several functions to remove unnecessary and/or no longer used variables and envar's, add some debugging output, etc.
10. addition of a new macro ORTE_PROC_IS_DAEMON that resolves to true if the provided proc is a daemon
There is still more cleanup to be done for efficiency, but this at least works.
Tested on single-node Mac, multi-node SLURM via odin. Tests included connect/accept, publish/lookup/unpublish, comm_spawn, comm_spawn_multiple, and singleton comm_spawn.
Fixes ticket #1256
This commit was SVN r18804.
2008-07-03 21:53:37 +04:00
|
|
|
} else {
|
|
|
|
ret = set_f(MPI_UNIVERSE_SIZE, usize);
|
2006-11-01 00:29:07 +03:00
|
|
|
}
|
2007-10-06 22:54:43 +04:00
|
|
|
if (OMPI_SUCCESS != ret) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check the app_num - if it was set, then define it - otherwise, don't */
|
|
|
|
if (orte_process_info.app_num >= 0) {
|
|
|
|
ret = set_f(MPI_APPNUM, orte_process_info.app_num);
|
|
|
|
}
|
2006-11-01 00:29:07 +03:00
|
|
|
|
2007-07-02 05:33:35 +04:00
|
|
|
return ret;
|
2006-02-27 18:15:48 +03:00
|
|
|
}
|
2005-09-01 05:07:30 +04:00
|
|
|
|
2006-02-27 18:15:48 +03:00
|
|
|
|
|
|
|
int ompi_attr_free_predefined(void)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = free_comm(MPI_TAG_UB)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_HOST)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_IO)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_WTIME_IS_GLOBAL)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_APPNUM)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_LASTUSEDCODE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(MPI_UNIVERSE_SIZE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_win(MPI_WIN_BASE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_win(MPI_WIN_SIZE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_win(MPI_WIN_DISP_UNIT)) ||
|
|
|
|
#if 0
|
|
|
|
/* JMS For when we implement IMPI */
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(IMPI_CLIENT_SIZE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(IMPI_CLIENT_COLOR)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(IMPI_HOST_SIZE)) ||
|
|
|
|
OMPI_SUCCESS != (ret = free_comm(IMPI_HOST_COLOR)) ||
|
|
|
|
#endif
|
|
|
|
0) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int create_comm(int target_keyval, bool want_inherit)
|
2004-09-16 04:00:09 +04:00
|
|
|
{
|
|
|
|
int err;
|
|
|
|
int keyval;
|
|
|
|
ompi_attribute_fn_ptr_union_t copy;
|
|
|
|
ompi_attribute_fn_ptr_union_t del;
|
|
|
|
|
|
|
|
keyval = -1;
|
2006-03-23 07:47:14 +03:00
|
|
|
copy.attr_communicator_copy_fn = (MPI_Comm_internal_copy_attr_function*)
|
|
|
|
(want_inherit ? MPI_COMM_DUP_FN : MPI_COMM_NULL_COPY_FN);
|
2004-09-16 04:00:09 +04:00
|
|
|
del.attr_communicator_delete_fn = MPI_COMM_NULL_DELETE_FN;
|
|
|
|
err = ompi_attr_create_keyval(COMM_ATTR, copy, del,
|
Fixes trac:817
The C++ bindings were not tracking keyvals properly -- they were
freeing some internal meta data when Free_keyval() was called, not
when the keyval was actually destroyed (keyvals are refcounted in the
C layer, just like all other MPI objects, because they can live for
long after their corresponding Free call is invoked). This commit
fixes this problem and several other things:
* Add infrastructure on the ompi_attribute_keyval_t for an "extra"
destructor pointer that will be invoked during the "real"
constructor (i.e., when OBJ_RELEASE puts the refcount to 0). This
allows calling back into the C++ layer to release meta data
associated with the keyval.
* Adjust all cases where keyvals are created to pass in relevant
destructors (NULL or the C++ destructor).
* Do essentially the same for MPI::Comm, MPI::Win, and MPI:Datatype:
* Move several functions out of the .cc file into the _inln.h file
since they no longer require locks
* Make the 4 Create_keyval() functions call a common back-end
keyval creation function that does the Right Thing depending on
whether C or C++ function pointers were used for the keyval
functions. The back-end function does not call the corresponding
C MPI_*_create_keyval function, but rather does the work itself
so that it can associate a "destructor" callback for the C++
bindings for when the keyval is actually destroyed.
* Change a few type names to be more indicative of what they are
(mostly dealing with keyvals [not "keys"]).
* Add the 3 missing bindings for MPI::Comm::Create_keyval().
* Remove MPI::Comm::comm_map (and associated types) because it's no
longer necessary in the intercepts -- it was a by-product of being
a portable C++ bindings layer. Now we can just query the C layer
directly to figure out what type a communicator is. This solves
some logistics / callback issues, too.
* Rename several types, variables, and fix many comments in the
back-end C attribute implementation to make the names really
reflect what they are (keyvals vs. attributes). The previous names
heavily overloaded the name "key" and were ''extremely''
confusing.
This commit was SVN r13565.
The following Trac tickets were found above:
Ticket 817 --> https://svn.open-mpi.org/trac/ompi/ticket/817
2007-02-09 02:50:04 +03:00
|
|
|
&keyval, NULL, OMPI_KEYVAL_PREDEFINED, NULL);
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
if (MPI_SUCCESS != err) {
|
2004-09-16 04:00:09 +04:00
|
|
|
return err;
|
|
|
|
}
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
if (target_keyval != keyval) {
|
|
|
|
return OMPI_ERR_BAD_PARAM;
|
2004-09-16 04:00:09 +04:00
|
|
|
}
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-02-27 18:15:48 +03:00
|
|
|
static int free_comm(int keyval)
|
|
|
|
{
|
|
|
|
int key = keyval;
|
|
|
|
return ompi_attr_free_keyval (COMM_ATTR, &key, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int create_win(int target_keyval)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
int keyval;
|
|
|
|
ompi_attribute_fn_ptr_union_t copy;
|
|
|
|
ompi_attribute_fn_ptr_union_t del;
|
2004-09-16 04:00:09 +04:00
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
keyval = -1;
|
2006-03-23 07:47:14 +03:00
|
|
|
copy.attr_win_copy_fn = (MPI_Win_internal_copy_attr_function*)MPI_WIN_NULL_COPY_FN;
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
del.attr_win_delete_fn = MPI_WIN_NULL_DELETE_FN;
|
|
|
|
err = ompi_attr_create_keyval(WIN_ATTR, copy, del,
|
Fixes trac:817
The C++ bindings were not tracking keyvals properly -- they were
freeing some internal meta data when Free_keyval() was called, not
when the keyval was actually destroyed (keyvals are refcounted in the
C layer, just like all other MPI objects, because they can live for
long after their corresponding Free call is invoked). This commit
fixes this problem and several other things:
* Add infrastructure on the ompi_attribute_keyval_t for an "extra"
destructor pointer that will be invoked during the "real"
constructor (i.e., when OBJ_RELEASE puts the refcount to 0). This
allows calling back into the C++ layer to release meta data
associated with the keyval.
* Adjust all cases where keyvals are created to pass in relevant
destructors (NULL or the C++ destructor).
* Do essentially the same for MPI::Comm, MPI::Win, and MPI:Datatype:
* Move several functions out of the .cc file into the _inln.h file
since they no longer require locks
* Make the 4 Create_keyval() functions call a common back-end
keyval creation function that does the Right Thing depending on
whether C or C++ function pointers were used for the keyval
functions. The back-end function does not call the corresponding
C MPI_*_create_keyval function, but rather does the work itself
so that it can associate a "destructor" callback for the C++
bindings for when the keyval is actually destroyed.
* Change a few type names to be more indicative of what they are
(mostly dealing with keyvals [not "keys"]).
* Add the 3 missing bindings for MPI::Comm::Create_keyval().
* Remove MPI::Comm::comm_map (and associated types) because it's no
longer necessary in the intercepts -- it was a by-product of being
a portable C++ bindings layer. Now we can just query the C layer
directly to figure out what type a communicator is. This solves
some logistics / callback issues, too.
* Rename several types, variables, and fix many comments in the
back-end C attribute implementation to make the names really
reflect what they are (keyvals vs. attributes). The previous names
heavily overloaded the name "key" and were ''extremely''
confusing.
This commit was SVN r13565.
The following Trac tickets were found above:
Ticket 817 --> https://svn.open-mpi.org/trac/ompi/ticket/817
2007-02-09 02:50:04 +03:00
|
|
|
&keyval, NULL, OMPI_KEYVAL_PREDEFINED, NULL);
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
if (MPI_SUCCESS != err) {
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
if (target_keyval != keyval) {
|
|
|
|
return OMPI_ERR_BAD_PARAM;
|
|
|
|
}
|
2004-09-16 04:00:09 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
|
|
|
|
|
2006-02-27 18:15:48 +03:00
|
|
|
static int free_win(int keyval)
|
|
|
|
{
|
|
|
|
int key = keyval;
|
|
|
|
return ompi_attr_free_keyval (WIN_ATTR, &key, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
static int set_f(int keyval, MPI_Fint value)
|
|
|
|
{
|
|
|
|
return ompi_attr_set_fortran_mpi1(COMM_ATTR, MPI_COMM_WORLD,
|
2005-09-01 05:07:30 +04:00
|
|
|
&MPI_COMM_WORLD->c_keyhash,
|
|
|
|
keyval, value,
|
Submitted by: Jeff "I love MPI attributes" Squyres
Reviewed by: Brian "MPI attributes ROCK" Barrett
Bunches of changes to the attribute engine:
- After many hours of discussion about MPI attributes, we came to the
conclusion that MPI-2 Example 4.13 (the C->Fortran example) is just
wrong. If you accept that, the rest of the text makes much more
sense.
- There are 9 inter-language cases: all combinations of (read, write)
with C, Fortran MPI-1, and Fortran MPI-2 for each value. Each of
the 9 cases have specific code for what is supposed to happen (and
is labeled in the code with comments). There is a *lengthy* comment
at the top of src/attribute/attribute.c that describes all of this.
- All predefined attributes are now treated as if they were put from
MPI-1 Fortran calls, with the exception of the window predefined
attributes (which are irrelevant on the beta, because there is no
one-sided support; preliminary fixes included in this patch, but
will be fully addressed on the trunk)
- MPI API calls (particularly the Fortran wrappers) are now
fundamentally simpler -- they do *not* call the back-end MPI C API
calls; instead, they call directly back into the attribute engine.
- The MPI_LASTUSEDCODE attribute only exists on MPI_COMM_WORLD and is
updated appropriately when user error classes are added.
--> Note: Edgar made a suggestion that for communicator attributes,
we ignore the communicator argument when retrieving attributes
and simply return the value. This will likely only happen on
the trunk, and will alleviate (from the user's perspective) the
restriction that LASTUSEDCODE is only on MPI_COMM_WORLD.
- The predefined attributes are now "better". We create keyvals
separately than assigning values, and correctly distinguish between
comm, type, and win attributes. Initial values are now set as if
they were called from MPI-1 fortran.
- Added a comment to the top of src/attribute/attribute_predefined.c
explaining what each of the predefined attributes were and what OMPI
sets them to be.
This commit was SVN r6193.
2005-06-27 23:17:11 +04:00
|
|
|
true, true);
|
|
|
|
}
|