Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] MPI_Wait: wait for ever by using Issend using larger data-strings
From: dbbmyx-franzxaver_at_[hidden]
Date: 2010-09-06 06:03:20


first of all sorry that I write a new thread. I already wrote a messge about "Problem with the receive buffer size?". But I had some problems with my email-provider and the mailinglist. (I do not often use mailing lists).

Here is the link to my old Message:

I wrote a short programm that show my problem. (The coding ist very ugly. sorry). It send a serialized object(this time a very simple) as a string to the other process.

The problem is that it never gets return of the wait-operation when I using a more data.
If you set the countR to 996 it waits forever. With 995 it works.
Can anyone help me?


(used library: boost_serialization)
#include <mpi.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <queue>

#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>

#include <boost/serialization/deque.hpp>

#define countS 1
#define countR 996

class expObj{
        friend class boost::serialization::access;

   char array[countS][countR];
   template<class Archive>
        void serialize(Archive & ar, const unsigned int version){
                ar & array;

                for (int i = 0; i < countS; i++) {
                        for (int j = 0; j < countR; j++) {
                                array[i][j] = 'q';

int main(int argc, char* argv[])
  MPI_Init(&argc, &argv);

  int rank;
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  if (rank == 0) {
          MPI_Request request_bilder_token_ro_multi;

                std::deque<expObj> senden;
                expObj bild1;
                bild1.array[0][0] = 'a';
                std::ostringstream archive_stream1;
                boost::archive::text_oarchive archive(archive_stream1);

                archive << senden;
                std::string outbound_data_ = archive_stream1.str();
                std::cout << "Send - Size of message: " << outbound_data_.size() << std::endl;

                MPI_Issend(&outbound_data_[0], static_cast<int>(outbound_data_.size()), MPI_CHAR, 1, 0, MPI_COMM_WORLD,&request_bilder_token_ro_multi);

  else if (rank == 1) {
          MPI_Request req;
          MPI_Status stat;
          int flag = 0; //
          int msglen = 1;

                std::deque<expObj> receive;
                expObj obj;

    std::string serString;

    do {
            MPI_Iprobe(0, 0, MPI_COMM_WORLD, &flag, &stat);
        } while (!flag);
            MPI_Get_count(&stat, MPI_CHAR, &msglen);
            std::cout <<"Received size: "<< msglen <<std::endl;
            MPI_Irecv(&serString[0], msglen, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &req);
        }while(flag == 0);*/
            std::cout << "Receive: <" << serString <<">"<< std::endl;

  std::cout << "Rank 1 OK!" << std::endl;
  return 0;