Btw why do you want to send he size around if it is a constant? george.
On Dec 9, 2010, at 12:30 , David Zhang wrote: > I would imagine block length be sizeof(int) + sizeof(double), with > displacement [0, sizeof(int)+1] ? > > On Thu, Dec 9, 2010 at 7:46 AM, Santosh Ansumali <ansum...@gmail.com> wrote: > On Thu, Dec 9, 2010 at 8:53 PM, George Bosilca <bosi...@eecs.utk.edu> wrote: > > You will have to use the MPI_Type_create_struct > > (http://www.open-mpi.org/doc/v1.5/man3/MPI_Type_create_struct.3.php). > > My doubt is what it means to compute blocklength and displacement for > static variable. For example, if I have a class > > class testVect{ > static const int size = 5; > double value[size] ; > } > > and I want to create MPI derived data to pack value. How block > length and displacement needs to be computed in this case, considering > the fact that size is static? > Thanks for the help! > Best, > Santosh > > > > > > george. > > > > On Dec 8, 2010, at 16:04 , Santosh Ansumali wrote: > > > >> Dear all, > >> I am confused with the use of MPI derived datatype for classes with > >> static member. How to create derived datatype for something like > >> class test{ > >> static const int i=5; > >> double data[5]; > >> } > >> > >> Thanks for your help! > >> Best, > >> Santosh > >> _______________________________________________ > >> users mailing list > >> us...@open-mpi.org > >> http://www.open-mpi.org/mailman/listinfo.cgi/users > > > > > > _______________________________________________ > > users mailing list > > us...@open-mpi.org > > http://www.open-mpi.org/mailman/listinfo.cgi/users > > > > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users > > > > -- > David Zhang > University of California, San Diego > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users