A little more data...
ompi_datatype_module.c:442 says
#if 0 /* XXX TODO The following may be deleted, both CXX and F77/F90
complex types are statically set up */
...followed by code to initialize ompi_mpi_cplx (i.e., MPI_COMPLEX).
(another TODO!!)
But ompi_mpi_cplex is setup with:
ompi_predefined_datatype_t ompi_mpi_cplex =
OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN |
OMPI_DATATYPE_FLAG_DATA_COMPLEX );
and OMPI_DATATYPE_INIT_DEFER has a comment above it saying:
/*
* Initilization for these types is deferred until runtime.
*
* Using this macro implies that at this point not all informations
needed
* to fill up the datatype are known. We fill them with zeros and
then later
* when the datatype engine will be initialized we complete with the
* correct information. This macro should be used for all composed
types.
*/
So this first thing is clearly wrong.
Assumedly, ompi_mpi_cplx (and friends) *do* need to be setup
dynamically at runtime, and the code must be fixed to do so.
On Jul 21, 2009, at 8:51 PM, Jeff Squyres (jsquyres) wrote:
On Jul 21, 2009, at 8:44 PM, Jeff Squyres (jsquyres) wrote:
> The extent for MPI_COMPLEX is returning 0.
>
Sorry -- I accidentally hit "send" way before I finished typing. :-\
You can reproduce the problem with a trivial program:
-----
#include <stdio.h>
#include <mpi.h>
int main(int argc, char* argv[])
{
MPI_Aint extent;
MPI_Init(NULL, NULL);
MPI_Type_extent(MPI_COMPLEX, &extent);
printf("Got extent: %d\n", extent);
MPI_Finalize();
return 0;
}
-----
This is an OMPI that was compiled with Fortran support. If I break at
MPI_Type_extent in gdb, here's what *type is:
-----
(gdb) p *type
$1 = {super = {super = {obj_magic_id = 16046253926196952813,
obj_class = 0x2a95aa0520, obj_reference_count = 1,
cls_init_file_name = 0x2a95626ce0 "ompi_datatype_module.c",
cls_init_lineno = 134}, flags = 63011, id = 0, bdt_used = 0,
size = 0,
true_lb = 0, true_ub = 0, lb = 0, ub = 0, align = 0, nbElems = 1,
name = "OPAL_UNAVAILABLE", '\0' <repeats 47 times>, desc =
{length = 1,
used = 1, desc = 0x2a95ac4640}, opt_desc = {length = 1, used
= 1,
desc = 0x2a95ac4640}, btypes = {0 <repeats 46 times>}}, id =
25,
d_f_to_c_index = 18, d_keyhash = 0x0, args = 0x0,
packed_description = 0x0,
name = "MPI_COMPLEX", '\0' <repeats 52 times>}
-----
The OPAL_UNAVAILABLE looks ominous...? When I do the same thing with
MPI_INTEGER, it doesn't say OPAL_UNAVAILABLE:
-----
(gdb) p *type
$2 = {super = {super = {obj_magic_id = 16046253926196952813,
obj_class = 0x2a95aa0520, obj_reference_count = 1,
cls_init_file_name = 0x2a95626ce0 "ompi_datatype_module.c",
cls_init_lineno = 131}, flags = 55094, id = 6, bdt_used = 64,
size = 4,
true_lb = 0, true_ub = 4, lb = 0, ub = 4, align = 4, nbElems = 1,
name = "OPAL_INT4", '\0' <repeats 54 times>, desc = {length = 1,
used = 1, desc = 0x2a95777920}, opt_desc = {length = 1, used
= 1,
desc = 0x2a95777920}, btypes = {0, 0, 0, 0, 0, 0, 1,
0 <repeats 39 times>}}, id = 22, d_f_to_c_index = 7, d_keyhash
= 0x0,
args = 0x0, packed_description = 0x0,
name = "MPI_INTEGER", '\0' <repeats 52 times>}
-----
Note that configure was happy with all the COMPLEX datatypes;
config.out and config.log attached. This was with gcc 3.4 on RHEL4.
--
Jeff Squyres
jsquy...@cisco.com
<complex-borked.tar.bz2><ATT7268046.txt>
--
Jeff Squyres
jsquy...@cisco.com