2004-09-16 04:00:09 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* 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.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
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
|
|
|
|
* explanation of this).
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* MPI_ADD_ERROR_CLASS is invoked. Its copy function is set to
|
|
|
|
* 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"
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2004-09-16 04:00:09 +04:00
|
|
|
#include "attribute/attribute.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2004-09-18 14:04:31 +04:00
|
|
|
#include "errhandler/errclass.h"
|
|
|
|
#include "communicator/communicator.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "util/proc_info.h"
|
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
|
|
|
#include "util/sys_info.h"
|
2004-09-18 14:04:31 +04:00
|
|
|
#include "mca/ns/ns.h"
|
|
|
|
#include "mca/gpr/gpr.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "mca/errmgr/errmgr.h"
|
2005-06-24 20:59:37 +04:00
|
|
|
#include "mca/schema/schema.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
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);
|
|
|
|
#if OMPI_WANT_MPI2_ONE_SIDED
|
2004-09-16 04:00:09 +04:00
|
|
|
/* JMS for when we implement windows */
|
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);
|
2004-09-16 04:00:09 +04:00
|
|
|
#endif
|
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
|
|
|
{
|
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
|
|
|
int rc, ret;
|
2005-06-24 20:59:37 +04:00
|
|
|
orte_gpr_trigger_t trig, *trig1;
|
|
|
|
orte_gpr_value_t value, *values;
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_gpr_subscription_t sub, *sub1;
|
|
|
|
orte_jobid_t job;
|
|
|
|
|
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! */
|
|
|
|
|
|
|
|
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)) ||
|
|
|
|
#if OMPI_WANT_MPI2_ONE_SIDED
|
|
|
|
/* JMS for when we implement windows */
|
|
|
|
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)) ||
|
|
|
|
#endif
|
|
|
|
#if 0
|
|
|
|
/* JMS For when we implement IMPI */
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_IMPI_CLIENT_SIZE, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_IMPI_CLIENT_COLOR, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_IMPI_HOST_SIZE, true)) ||
|
|
|
|
OMPI_SUCCESS != (ret = create_comm(MPI_IMPI_HOST_COLOR, true)) ||
|
|
|
|
#endif
|
|
|
|
0) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set default values for everything except UNIVERSE_SIZE and
|
|
|
|
APPNUM. */
|
|
|
|
|
|
|
|
if (OMPI_SUCCESS != (ret = set_f(MPI_TAG_UB, MPI_TAG_UB_VALUE)) ||
|
|
|
|
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)) ||
|
|
|
|
OMPI_SUCCESS != (ret = set_f(MPI_LASTUSEDCODE,
|
|
|
|
ompi_errclass_lastused)) ||
|
|
|
|
#if 0
|
|
|
|
/* JMS For when we implement IMPI */
|
|
|
|
OMPI_SUCCESS != (ret = set(MPI_IMPI_CLIENT_SIZE,
|
|
|
|
&attr_impi_client_size)) ||
|
|
|
|
OMPI_SUCCESS != (ret = set(MPI_IMPI_CLIENT_COLOR,
|
|
|
|
&attr_impi_client_color)) ||
|
|
|
|
OMPI_SUCCESS != (ret = set(MPI_IMPI_HOST_SIZE,
|
|
|
|
&attr_impi_host_size)) ||
|
|
|
|
OMPI_SUCCESS != (ret = set(MPI_IMPI_HOST_COLOR,
|
|
|
|
&attr_impi_host_color)) ||
|
|
|
|
#endif
|
|
|
|
0) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now that those are all created, setup the trigger to get the
|
|
|
|
UNIVERSE_SIZE and APPNUM values once everyone has passed
|
|
|
|
stg1. */
|
|
|
|
|
2005-06-24 20:59:37 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid(&job, orte_process_info.my_name))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&sub, orte_gpr_subscription_t);
|
2005-06-24 20:59:37 +04:00
|
|
|
/* indicate that this is a standard subscription. This indicates that the
|
|
|
|
* subscription will be common to all processes. Thus, the resulting data
|
|
|
|
* can be consolidated into a process-independent message and broadcast
|
|
|
|
* to all processes
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_schema.get_std_subscription_name(&(sub.name),
|
|
|
|
OMPI_ATTRIBUTE_SUBSCRIPTION, job))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
/* send data when trigger fires, then delete -
|
|
|
|
* no need for further notifications
|
|
|
|
*/
|
|
|
|
sub.action = ORTE_GPR_NOTIFY_DELETE_AFTER_TRIG;
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&value, orte_gpr_value_t);
|
|
|
|
values = &value;
|
|
|
|
sub.values = &values;
|
|
|
|
sub.cnt = 1;
|
|
|
|
|
|
|
|
value.addr_mode = ORTE_GPR_TOKENS_OR | ORTE_GPR_KEYS_OR;
|
|
|
|
value.segment = strdup(ORTE_NODE_SEGMENT);
|
|
|
|
if (NULL == value.segment) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
2005-06-24 20:59:37 +04:00
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
value.tokens = NULL; /* wildcard - look at all containers */
|
|
|
|
value.num_tokens = 0;
|
|
|
|
value.cnt = 1;
|
|
|
|
value.keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
|
|
|
|
if (NULL == value.keyvals) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
2005-06-24 20:59:37 +04:00
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
value.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
|
|
|
|
if (NULL == value.keyvals[0]) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
2005-06-24 20:59:37 +04:00
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
value.keyvals[0]->key = strdup(ORTE_NODE_SLOTS_KEY);
|
|
|
|
if (NULL == value.keyvals[0]->key) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
2005-06-24 20:59:37 +04:00
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
sub.cbfunc = ompi_attr_create_predefined_callback;
|
|
|
|
sub.user_tag = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-06-24 20:59:37 +04:00
|
|
|
/* setup the trigger information */
|
|
|
|
OBJ_CONSTRUCT(&trig, orte_gpr_trigger_t);
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_schema.get_std_trigger_name(&(trig.name),
|
|
|
|
ORTE_STG1_TRIGGER, job))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_DESTRUCT(&sub);
|
2005-06-24 20:59:37 +04:00
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
2005-06-24 20:59:37 +04:00
|
|
|
|
|
|
|
/* this is an ORTE-standard trigger that is defined by the ORTE resource manager
|
|
|
|
* when the job was launched - therefore, we don't need to provide any additional
|
|
|
|
* info
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* do the subscription */
|
|
|
|
sub1 = ⊂
|
|
|
|
trig1 = &trig;
|
2005-06-24 20:59:37 +04:00
|
|
|
rc = orte_gpr.subscribe(1, &sub1, 1, &trig1);
|
|
|
|
if(ORTE_SUCCESS != rc) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "ompi_attr_create_predefined: subscribe failed");
|
2005-06-24 20:59:37 +04:00
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
OBJ_DESTRUCT(&trig);
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&value);
|
|
|
|
sub.values = NULL;
|
|
|
|
OBJ_DESTRUCT(&sub);
|
|
|
|
OBJ_DESTRUCT(&trig);
|
|
|
|
return OMPI_SUCCESS;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ompi_attr_create_predefined_callback(
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_gpr_notify_data_t *data,
|
|
|
|
void *cbdata)
|
2004-09-16 04:00:09 +04:00
|
|
|
{
|
2005-05-01 04:47:35 +04:00
|
|
|
size_t i, j;
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_gpr_keyval_t **keyval;
|
|
|
|
orte_gpr_value_t **value;
|
|
|
|
orte_jobid_t job;
|
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
|
|
|
unsigned int universe_size = 0;
|
2004-09-16 04:00:09 +04:00
|
|
|
|
|
|
|
/* Set some default values */
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (ORTE_SUCCESS != orte_ns.get_jobid(&job, orte_process_info.my_name)) {
|
|
|
|
return;
|
|
|
|
}
|
2004-09-18 14:04:31 +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
|
|
|
/* Per conversation between Jeff, Edgar, and Ralph - this needs to
|
|
|
|
* be fixed to properly determine the appnum. Ignore errors here;
|
|
|
|
* there's no way to propagate the error up, so just try to keep
|
|
|
|
* going.
|
2005-03-14 23:57:21 +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
|
|
|
set_f(MPI_APPNUM, (MPI_Fint) job);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* Query the gpr to find out how many CPUs there will be.
|
2004-09-18 14:04:31 +04:00
|
|
|
This will only return a non-empty list in a persistent
|
|
|
|
universe. If we don't have a persistent universe, then just
|
|
|
|
default to the size of MPI_COMM_WORLD.
|
|
|
|
|
|
|
|
JMS: I think we need more here -- there are cases where you
|
|
|
|
wouldn't have a persistent universe but still may have a
|
|
|
|
comm_size(COMM_WORLD) != UNIVERSE_SIZE. For example, say you
|
|
|
|
reserve 8 CPUs in a batch environment and then run ./master,
|
|
|
|
where the master is supposed to SPAWN the other processes.
|
|
|
|
Perhaps need some integration with the LLM here...? [shrug] */
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* RHC: Needed to change this code so it wouldn't issue a gpr.get
|
2004-11-20 22:12:43 +03:00
|
|
|
* during the compound command phase of mpi_init. Since all you need
|
|
|
|
* is to have the data prior to dtypes etc., and since this function
|
|
|
|
* is called right before we send the compound command, I've changed
|
|
|
|
* it to a subscription and a callback function. This allows you to
|
|
|
|
* get the data AFTER the compound command executes. Nothing else
|
|
|
|
* happens in-between anyway, so this shouldn't cause a problem.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (0 == data->cnt) { /* no data returned */
|
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
|
|
|
universe_size = ompi_comm_size(MPI_COMM_WORLD);
|
2004-09-18 14:04:31 +04:00
|
|
|
} else {
|
2005-03-14 23:57:21 +03:00
|
|
|
value = data->values;
|
|
|
|
for (i=0; i < data->cnt; i++) {
|
|
|
|
if (0 < value[i]->cnt) { /* make sure some data was returned here */
|
|
|
|
keyval = value[i]->keyvals;
|
|
|
|
for (j=0; j < value[i]->cnt; j++) {
|
2005-06-24 22:54:54 +04:00
|
|
|
/* make sure we don't get confused - all slot counts
|
|
|
|
* are in size_t fields
|
|
|
|
*/
|
|
|
|
if (ORTE_SIZE == keyval[j]->type) {
|
2005-03-14 23:57:21 +03:00
|
|
|
/* Process slot count */
|
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
|
|
|
universe_size += keyval[j]->value.size;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-09-18 14:04:31 +04:00
|
|
|
}
|
|
|
|
}
|
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
|
|
|
/* Same as above -- ignore errors here because there's nothing we
|
|
|
|
can do if there's any error anyway */
|
2004-09-18 14:04:31 +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
|
|
|
set_f(MPI_UNIVERSE_SIZE, universe_size);
|
2004-11-20 22:12:43 +03:00
|
|
|
return;
|
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
|
|
|
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;
|
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
|
|
|
copy.attr_communicator_copy_fn =
|
|
|
|
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,
|
|
|
|
&keyval, NULL, OMPI_KEYVAL_PREDEFINED);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if OMPI_WANT_MPI2_ONE_SIDED
|
|
|
|
/* JMS for when we implement windows */
|
|
|
|
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;
|
|
|
|
copy.attr_win_copy_fn = MPI_WIN_NULL_COPY_FN;
|
|
|
|
del.attr_win_delete_fn = MPI_WIN_NULL_DELETE_FN;
|
|
|
|
err = ompi_attr_create_keyval(WIN_ATTR, copy, del,
|
|
|
|
&keyval, NULL, OMPI_KEYVAL_PREDEFINED);
|
|
|
|
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
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static int set_f(int keyval, MPI_Fint value)
|
|
|
|
{
|
|
|
|
return ompi_attr_set_fortran_mpi1(COMM_ATTR, MPI_COMM_WORLD,
|
|
|
|
&MPI_COMM_WORLD->c_keyhash,
|
|
|
|
keyval, value,
|
|
|
|
true, true);
|
|
|
|
}
|