Roy, you can create your type without MPI_UB nor MPI_LB, and then use MPI_Type_create_resized to set lower bound and extent (note this sets extent and not upper bound)
Cheers, Gilles On Saturday, August 29, 2015, Roy Stogner <royst...@ices.utexas.edu> wrote: > > From: George Bosilca <bosi...@icl.utk.edu> >> >> First and foremost the two datatype markers (MPI_LB and MPI_UB) have been >> deprecated from MPI 3.0 for exactly the reason you encountered. Once a >> datatype is annotated with these markers, they are propagated to all >> derived types, leading to an unnatural datatype definition. This behavior >> is enforced by the definition of the typemap specified by the equation on >> Section 4.1 page 105 line 18. Unfortunately, the only way to circumvent >> this issue, is to manually set the UB to all newly created datatypes. >> > > I see I should have directly checked the specification to see what the > expected behavior was, instead of relying on (apparently over-) > simplified summaries from web searches and books. Thanks for the > pointer! > > I'd wondered if this was a fixable bug, but it looks like that > equation dates back to at *least* 1994 and the MPI-1.0 spec; clearly > the only thing to do was deprecate and replace the API rather than > breaking old user code to enforce the "right" behavior instead. > > Thus, to fix your datatype composition you just have to add an explicit >> MPI_LB (set to 0) when calling the MPI_Type_struct on your second struct >> datatype. >> > > I'd managed to hit on this solution by guesswork, but it's quite a > relief to know that its correctness is actually mandated by the MPI > standand not just my dumb luck. > > Thanks again, > --- > Roy Stogner > _______________________________________________ > users mailing list > us...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users > Link to this post: > http://www.open-mpi.org/community/lists/users/2015/08/27506.php >