LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Manoj Vaghela (manoj.vaghela_at_[hidden])
Date: 2008-03-12 05:25:35


Hi All,

       I want to copy derived datatype "newtype1" to "newtype2".
       This is for avoiding copying of each and every element of "newtype1"
to "newtype2"
       I tried the following conventions:

       MPI_Type_size(newtype1, &newtype1_size);
       memcpy(&newtype2, &newtype1, newtype1_size);

       As "newtype1_size" should be equal to "newtype2_size", either of them
can be used.

       When I printed individual values of newtype2, it showed garbage/zero
values.
       Can anyone please throw some light on this? Or any other idea of
copying one derived datatype to another can be explained.

       Thanks...

--
Manoj Vaghela