a clash of APIs -- MPI requires int's, but the ORTE DPS requires
size_t's. Specifically, we need to orte_dps.unload(), which fills a
size_t. We then need to PML send (i.e., MPI_Send) that value around.
However, there's no such thing as MPI_SIZE_T as a datatype, and that
would hose us in heterogeneous situations, anyway. So the compromise
was to make ompi_sizet2int(), a function what does the [potenial]
downcast. On 32 bit architectures, this is no big deal -- it's a
simple assignment. On 64 bit architectures (or, more specifically,
where sizeof(size_t) > sizeof(int)), it does the dowcast in a
compiler-safe manner, and does a check to see if we truncated. If we
truncated, in a developer build, we'll abort(). If this is not a
developer build, print out a nasty warning.
The rationale here is as followes:
- this is a clash of the API's. There's unfortunately nothing that we
can do about this at the moment.
- hence, we have to do the downcast.
- but we might as well be "safe" about it -- assuming that
orte_dps.unload() never gives us back a value >sizeof(int) (which is
a pretty safe assumption -- if we get that large of a value, we have
other problems, or we're on fundamentally different types of
hardware and I suspect a lot of the rest of the code base will have
problems as well!), we should be able to downcast safely.
- if there is a mistake in code somewhere such that:
- we can't downcast safely (i.e., we legitmately have a size_t value
that is too large for an int)
- we truncate when the value should not have been that large
the conversion function will detect this and print out an error. So
we won't silently introduce any new errors into the code base --
they will be loud and obvious.
- although comm.c is currently the only place where we need this, I
suspect that there will be a small number of other places where
similar situations occur. I intend to bring this right over to the
trunk, so it was simpler to make this functionality be a subroutine
so that we can use it elsewhere if/when necessary.
Final note: src/attribute/attribute.c does something *similar*
(downcasting when sizeof(void*) > sizeof(int), but is different enough
that it would have been painful to make one unified interface. This
does not rule it out for the future, however (especially if we find
more places in the tree that need this kind of functionality).
This commit was SVN r6246.
so that I can next rename all the files under mca/btl using "svn mv" which is
not possible until after the initial "svn mv bmi btl" is checked in.
This commit was SVN r6220.
recently used cache of pinned user buffers when leave_pinned is set to 1. The
size of this cache is currently based on number of entries but will probably
be modified to use total bytes in the near future.
This commit was SVN r6213.
simpler, too, but typing the members of the neutral attribute value
struct, and then we can just dereference them (rather than doing
complicated casting).
This commit was SVN r6196.
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.
* If we are on solaris, don't use the system qsort(), as it appears to be
broken in 64 bit mode on Solaris 8 (there are bugs about this in
SunSolve). Instead, use ompi_qsort(), which is taken from FreeBSD.
A #define in ompi_config_bottom.h makes this invisible to most of the
OMPI source tree.
* Fix memory badness in ompi_progress_register where we were reallocing the
array to be number of elements long instead of number of elements *
sizeof(element). Found while using bcheck to track down our problems in
64 bit on big endian machines.
* The debugging output code in session_dir.c could pass NULL as a value for a %s,
which will turn into "(null)" automagically on glibc, but causes segfaults for
older libcs (like those on Solaris). Check for this case in session_dir.c and
don't pass NULL as a %s value into ompi_output().
* Fix missing header file in convertor.c
This commit was SVN r6186.