Ensure to instantiate MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE.
Thanks to Anthony Chan for pointing this out. Note that these will only work for the Fortran compiler that Open MPI was configured with -- since these values, are, by definition, single-value, they cannot support all 4 values that Open MPI may generate for the different Fortran name-mangling schemes. A lengthy comment in ompi_mpi_init.c explains this in more detail. Added to the README to explain this situation, as well as the forthcoming .TRUE. Fortran fixes. This commit was SVN r8231.
Этот коммит содержится в:
родитель
5b49cd81d8
Коммит
9812694227
34
README
34
README
@ -127,7 +127,7 @@ base as of this writing (21 Nov 2005):
|
||||
--with-wrapper-fcflags=-Munixlogical ...
|
||||
|
||||
This will be fixed in a future version of Open MPI.
|
||||
|
||||
|
||||
- For any version of the Intel compiler >= 8.0, the default value for
|
||||
.TRUE. is -1. Open MPI does not currently handle this correctly.
|
||||
As such, the "-fpscomp logicals" option must be used with the Intel
|
||||
@ -152,6 +152,38 @@ base as of this writing (21 Nov 2005):
|
||||
|
||||
This will be fixed in a future version of Open MPI.
|
||||
|
||||
- Open MPI will build bindings suitable for all common forms of
|
||||
Fortran 77 compiler symbol mangling on platforms that support it
|
||||
(e.g., Linux). On platforms that do not support weak symbols (e.g.,
|
||||
OS X), Open MPI will build Fortran 77 bindings just for the compiler
|
||||
that Open MPI was configured with.
|
||||
|
||||
Hence, on platforms that support it, if you configure Open MPI with
|
||||
a Fortran 77 compiler that uses one symbol mangling scheme, you can
|
||||
successfully compile and link MPI Fortran 77 applications with a
|
||||
Fortran 77 compiler that uses a different symbol mangling scheme.
|
||||
|
||||
NOTE: For platforms that support the multi-Fortran-compiler bindings
|
||||
(i.e., weak symbols are supported), due to limitations in the MPI
|
||||
standard and in Fortran compilers, it is not possible to hide these
|
||||
differences in all cases. Specifically, the following two cases may
|
||||
not be portable between different Fortran compilers:
|
||||
|
||||
1. The C constants MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE
|
||||
will only compare properly to Fortran applications that were
|
||||
created with Fortran compilers that that use the same
|
||||
name-mangling scheme as the Fortran compiler that Open MPI was
|
||||
configured with.
|
||||
|
||||
2. Fortran compilers may have different values for the logical
|
||||
.TRUE. constant. As such, any MPI function that uses the fortran
|
||||
LOGICAL type may only get .TRUE. values back that correspond to
|
||||
the the .TRUE. value of the Fortran compiler that Open MPI was
|
||||
configured with.
|
||||
|
||||
You can use the ompi_info command to see the Fortran compiler that
|
||||
Open MPI was configured with.
|
||||
|
||||
- The MPI and run-time layers do not free all used memory properly
|
||||
during MPI_FINALIZE.
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
#include "ompi/include/constants.h"
|
||||
#include "ompi/mpi/f77/constants.h"
|
||||
#include "ompi/runtime/mpiruntime.h"
|
||||
#include "ompi/runtime/params.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
@ -87,6 +88,52 @@ opal_thread_t *ompi_mpi_main_thread = NULL;
|
||||
|
||||
bool ompi_mpi_maffinity_setup = false;
|
||||
|
||||
/*
|
||||
* These variables are here, rather than under ompi/mpi/c/foo.c
|
||||
* because it is not sufficient to have a .c file that only contains
|
||||
* variables -- you must have a function that is invoked from
|
||||
* elsewhere in the code to guarantee that all linkers will pull in
|
||||
* the .o file from the library. Hence, although these are MPI
|
||||
* constants, we might as well just define them here (i.e., in a file
|
||||
* that already has a function that is guaranteed to be linked in,
|
||||
* rather than make a new .c file with the constants and a
|
||||
* corresponding dummy function that is invoked from this function).
|
||||
*
|
||||
* NOTE: See the big comment in ompi/mpi/f77/constants.h about why we
|
||||
* have four symbols for each of the common blocks (e.g., the Fortran
|
||||
* equivalent(s) of MPI_STATUS_IGNORE). Here, we can only have *one*
|
||||
* value (not four). So the only thing we can do is make it equal to
|
||||
* the fortran compiler convention that was selected at configure
|
||||
* time. Note that this is also true for the value of .TRUE. from the
|
||||
* Fortran compiler, so even though Open MPI supports all four Fortran
|
||||
* symbol conventions, it can only support one convention for the two
|
||||
* C constants (MPI_FORTRAN_STATUS[ES]_IGNORE) and only support one
|
||||
* compiler for the value of .TRUE. Ugh!!
|
||||
*
|
||||
* Note that the casts here are ok -- we're *only* comparing pointer
|
||||
* values (i.e., they'll never be de-referenced). The global symbols
|
||||
* are actually of type (ompi_fortran_common_t) (for alignment
|
||||
* issues), but MPI says that MPI_F_STATUS[ES]_IGNORE must be of type
|
||||
* (MPI_Fint*). Hence, we have to cast to make compilers not
|
||||
* complain.
|
||||
*/
|
||||
|
||||
#if OMPI_F77_CAPS
|
||||
MPI_Fint *MPI_F_STATUS_IGNORE = (MPI_Fint*) &MPI_FORTRAN_STATUS_IGNORE;
|
||||
MPI_Fint *MPI_F_STATUSES_IGNORE = (MPI_Fint*) &MPI_FORTRAN_STATUSES_IGNORE;
|
||||
#elif OMPI_F77_PLAIN
|
||||
MPI_Fint *MPI_F_STATUS_IGNORE = (MPI_Fint*) &mpi_fortran_status_ignore;
|
||||
MPI_Fint *MPI_F_STATUSES_IGNORE = (MPI_Fint*) &mpi_fortran_statuses_ignore;
|
||||
#elif OMPI_F77_SINGLE_UNDERSCORE
|
||||
MPI_Fint *MPI_F_STATUS_IGNORE = (MPI_Fint*) &mpi_fortran_status_ignore_;
|
||||
MPI_Fint *MPI_F_STATUSES_IGNORE = (MPI_Fint*) &mpi_fortran_statuses_ignore_;
|
||||
#elif OMPI_F77_DOUBLE_UNDERSCORE
|
||||
MPI_Fint *MPI_F_STATUS_IGNORE = (MPI_Fint*) &mpi_fortran_status_ignore__;
|
||||
MPI_Fint *MPI_F_STATUSES_IGNORE = (MPI_Fint*) &mpi_fortran_statuses_ignore__;
|
||||
#else
|
||||
#error Unrecognized Fortran 77 name mangling scheme
|
||||
#endif
|
||||
|
||||
|
||||
int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
{
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user