Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] MPI_Send, MPI_Recv problem on Mac and Linux
From: Peter Sels (sels.peter_at_[hidden])
Date: 2012-04-11 15:03:00


Dear openMPI users,

I think this should be an easy question to anyone with more experience
than an openMPI-hello-world-program...

I wrote some openMPI code, where the master sends a length and then a
buffer with that length as 2 subsequent MPI messages.
The slave is receiving these messages and answers back in a similar manner.

Sometimes this goes ok, sometimes not.
Messages of 28 chars or shorter do fine.
Messages of 29 or longer are usually problematic.
This length can be controlled with
#define DUMMY_MSG_LENGTH (40)

On Mac I sometimes get a mentioning of "slave 32767", where there
should only be a leave 1.
Probably a buffer overrun or so, but I cannot see where.

On linux I get: Segmentation fault (11)

Increasing the length gives more problems...

How can I get this code stable?
What am I doing wrong?
Is there a maximum length to MPI messages?
For sending a string, do I use MPI_CHARACTER or MPI_BYTE or ...?

How come I cannot assert that my messages end in '\0' when received?
And how come that when I print them, I also get a segmentation fault?

Can I send two subsequent messages using MPI_Send, or do I have to do
the first as MPI_Isend and then do a MPI_Wait before the next
MPI_Send?...

Why do I not find code online for receiving the length first and then
allocating a buffer of this size and then receiving the next message?

All code, build, run scripts and logs are attached.

It would help me big time, if you could answer my questions or debug the code.

thanks a lot!

Pete





  • application/x-sh attachment: run.sh

  • application/octet-stream attachment: mac.log

  • application/octet-stream attachment: linux.log