Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Fwd: Problem with sending vectors
From: Albert Babinskas (babinsk3_at_[hidden])
Date: 2008-04-07 10:13:00


I want to send vectors of myclass between nodes. But myclass has
arrays inside of it. So i defined Datatype mpi_arrays to define the
arrays in myclass and then i defined another Datatype for vectors.
When i send vectors between nodes i get this error:

[localhost:31457] *** Process received signal ***
[localhost:31457] Signal: Segmentation fault (11)
[localhost:31457] Signal code: (128)
[localhost:31457] Failing at address: (nil)
[localhost:31457] [ 0] /lib/tls/libpthread.so.0 [0x84ba90]
[localhost:31457] [ 1] a.out(_ZSt13__destroy_auxIP3BoxEvT_S2_12__false_type+0x19) [0x805a4f9]
[localhost:31457] [ 2] a.out(_ZSt8_DestroyIP3BoxEvT_S2_+0x1a) [0x8059650]
[localhost:31457] [ 3] a.out(_ZNSt6vectorI3BoxSaIS0_EED1Ev+0x1a) [0x80588d2]
[localhost:31457] [ 4] a.out(_Z13GenerateBoxesv+0xe01) [0x8056055]
[localhost:31457] [ 5] a.out(main+0x38) [0x8056d08]
[localhost:31457] [ 6] /lib/tls/libc.so.6(__libc_start_main+0xd3) [0x13cde3]
[localhost:31457] [ 7] a.out(__gxx_personality_v0+0x81) [0x8054fa9]
[localhost:31457] *** End of error message ***

I am a confused about what am i doing wrong and how to fix errors.
It shows that i receive the vector, but then it crashes.
The way i define arrays is by using contiguous, and vectors also
using contiguous.

Some code for the error that i get:
Box b;
Vector<Box> vb;
from 1 to 20 set up B and vb.push_back(b);
MPI_Datatype MPI_box;
MPI_Type_contiguous(9, MPI_INT, &MPI_box);
MPI_Type_commit(&MPI_box);
Vector<Box> vb2;
vb2.resize(20);
MPI_Send(&vb[0], 20, MPI_box, 1, tag, MPI_COMM_WORLD);
MPI_Recv(&vb2[0], 20, MPI_box, 1, tag, MPI_COMM_WORLD, &status);

class Box has two int array inside it like
int a[3];
int b[3];

Thank you for talking a look.