Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: George Bosilca (bosilca_at_[hidden])
Date: 2007-07-10 11:06:36

MPI_LB and MPI_UB is what you're looking for. Or better, for MPI-2
compliant libraries such as Open MPI and MPICH2, you can use
MPI_Type_create_resized. This will allow you to create the gap at the
beginning and/or the end of a data-type description.


On Jul 10, 2007, at 10:53 AM, jody wrote:

> hi
> I want to create datatypes of the form
> XX000000...
> 00XX0000...
> 0000XX00...
> etc.
> I tried MPI_Type_indexed(1, ais, ait, MPI_SHORT, &dtNewType)
> where ais= {2} and ait = {2} but this only gives me a datatype of
> the form
> 00XX, i.e. no holes at the end.
> I guess MPI_Type_vector won't work, because there seems to be
> no way to create holes at the beginning of the datatype
> I need these datatypes to let each process write its data into the
> file
> in the following way:
> (X is data from proc 0, Y is data from proc 1, Z is data from proc 2)
> My intended approach was to define datatypes of the form XX0000,
> 00XX00, 0000XX
> for the respective processors, and then call MPI_File_set_view
> with displacement 0 and the respective datatypes fo the "filetype"
> parameter,
> and finally let each processor write its stuff to file
> sequentially using MPI_File_write.
> However, my plan failed since i am unable to create datatypes with
> holes in front and at the end.
> What function should i use to create the desired datatypes?
> Thank You
> Jody
> _______________________________________________
> users mailing list
> users_at_[hidden]