[MPICH] MPI datatype question

Avery Ching aching at ece.northwestern.edu
Tue Jan 30 14:45:53 CST 2007


Hi all,

I'm working on improving my MPI-IO testing suite and ran into something
I thought was confusing to me.  Hopefully someone knows the answer.

Imagine I use some pseudocode such as:

arr_blk[2]  = {1, 2}
arr_disp[2] = {1, 3}
MPI_Type_create_hindexed(2, arr_blk, arr_disp, MPI_BYTE, first_dtype)

Which should give me:

first_dtype = 
_X_XX (ext = 4)
01234

If I did MPI_Type_contiguous(2, &first_dtype, contig_dtype)

I would get
_X_XXX_XX (ext = 8)
012345678

Then I do this:

arr_blk[2]  = {1, 2}
arr_disp[2] = {1, 10}
MPI_Type_create_hindexed(2, arr_blk, arr_disp, &first_dtype,
second_dtype);

What would second_dtype look like?  My best guess is this, but I'm not
sure if it's correct....

second_dtype = 
__X_XX_____X_XXX_XX (ext = 17)
0123456789012345678 

Note the positions of the spaces. =)

One more question.

arr_blk[2]  = {1, 2}
arr_disp[2] = {1, 3}
MPI_Type_indexed(2, arr_blk, arr_disp, &first_dtype, third_dtype)

Again, I'd like to know what is correct.  My best guess is...

third_dtype = 
_X_XX________X_XXX_XX (ext = 20)
012345678901234567890 

Again, please note the positions of the spaces. =)

Thanks for your help.

Avery




More information about the mpich-discuss mailing list