Discussion:
No MPI_Type_create_hindexed_block?
(too old to reply)
Emilio J. Padron
2009-02-10 10:29:51 UTC
Permalink
Hi all,

I am a bit confused about the non-existence of a couterpart for the
function MPI_Type_create_indexed_block :-?

I often need to send fixed length blocks with arbitrary positions in
memory and I am obligued to allocate a large array to be filled with
a constant blocklength so as to use MPI_Type_create_hindexed.

I really don't understand the point behind the absence of a
MPI_Type_create_hindexed_block in MPI specifications.

Any workaround to the stupid array of fixed blocklengths?

Thank you and sorry for the rant. This issue is really bothering me...

Emilio
Georg Bisseling
2009-02-10 13:40:11 UTC
Permalink
Post by Emilio J. Padron
Hi all,
I am a bit confused about the non-existence of a couterpart for the
function MPI_Type_create_indexed_block :-?
I often need to send fixed length blocks with arbitrary positions in
memory and I am obligued to allocate a large array to be filled with
a constant blocklength so as to use MPI_Type_create_hindexed.
I really don't understand the point behind the absence of a
MPI_Type_create_hindexed_block in MPI specifications.
Any workaround to the stupid array of fixed blocklengths?
Thank you and sorry for the rant. This issue is really bothering me...
Emilio
I had a hard time to come to the conclusion that there is actually
something left to be desired, but I see your point.

Well, even if MPI would provide more flexible data type constructors
there would be some doubt if MPI could actually do a more clever job
in (de)serializing the data for send and receive than the application
or make use of a built in unit that does scatter/gather DMA or something.

I suggest to do the (de)serialization yourself. It even tends to
get more readable than a bunch of MPI type stuff that can only be
decoded with holding the standard next to it, because you have to
understand your own memory layout anyway. Throw in a little UB/LB
and nobody can change the data layout in the future...
And chances are that if you used data types just for a couple of
transmissions that their use actually slowed down the program.
Did you try to send the blocks in individual messages? Or are they
used in collectives?
--
This signature intentionally left almost blank.
http://www.this-page-intentionally-left-blank.org/
Michael Hofmann
2009-02-10 17:13:57 UTC
Permalink
Am 10.02.2009, 11:29 Uhr, schrieb Emilio J. Padron
Post by Emilio J. Padron
Hi all,
I am a bit confused about the non-existence of a couterpart for the
function MPI_Type_create_indexed_block :-?
I often need to send fixed length blocks with arbitrary positions in
memory and I am obligued to allocate a large array to be filled with
a constant blocklength so as to use MPI_Type_create_hindexed.
I really don't understand the point behind the absence of a
MPI_Type_create_hindexed_block in MPI specifications.
Any workaround to the stupid array of fixed blocklengths?
"MPI_Type_create_resized" can be used to change the extent of the basic
datatype (of which the blocks consist) to 1. For datatypes with extent 1
"MPI_Type_create_indexed_block" and "MPI_Type_create_hindexed_block" are
the same (or not?).

"MPI_Type_create_resized" is new to MPI. The old (deprecated) way uses
"MPI_Type_create_struct" and MPI_UB to change the extent (4th example,
http://www.mpi-forum.org/docs/mpi21-report-bw/node81.htm).


Michael

Loading...