0

I tried to run Boost MPI with mpich2 3.1.4 (compiled from source). But, I believe the problem is that Boost MPI's dependency on OpenMPI is messing up with mpich2 3.1.4.

I get the following prompt upon compiling my code.

$ mpic++ -std=c++11 boost_mpi.cpp -lboost_system -lboost_mpi -lboost_serialization    
/usr/bin/ld: warning: libmpi.so.1, needed by /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libboost_mpi.so, may conflict with libmpi.so.12

This is my code

#include <iostream>
#include <string>
#include <queue>
#include "mpi.h"
#include <boost/algorithm/string.hpp>
#include <unordered_map>
#include "tf.cpp"

#include <boost/mpi.hpp>
#include <boost/serialization/string.hpp>

namespace mpi = boost::mpi;

int main(int argc, char* argv[]){
  mpi::environment env(argc, argv);
  mpi::communicator boost_world;

  if (boost_world.rank() == 0) {
    boost_world.send(1, 0, std::string("Hello"));
    std::string msg;
    boost_world.recv(1, 1, msg);
    std::cout << msg << "!" << std::endl;
  } else {
    std::string msg;
    boost_world.recv(0, 0, msg);
    std::cout << msg << ", ";
    std::cout.flush();
    boost_world.send(0, 1, std::string("world"));
  }

  return 0;
}

I see that help has been given here for setting up alternatives for mpi in Ubuntu. But, I am unable to set them as I have compiled my code manually.

I am using Ubuntu 14.04, on a 64 bit machine.

Thanks in advance.

Community
  • 1
  • 1
omeganebula
  • 180
  • 1
  • 11
  • 1
    What is you mpichversion? What is your mpic++ -show? Do you have more than one MPI library installed? – mcsim Sep 14 '15 at 07:09
  • @mcsim: My mpichversion is 3.1.4. This is my `$mpic++ -show` output : `g++ -I/usr/local/include -L/usr/local/lib -lmpicxx -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -lmpi` . There may be more than one mpi installation yeah, as boost seems to have a dependency on openmpi – omeganebula Sep 14 '15 at 07:12
  • That's probably not the best solution, but I suggest you to delete all system wide MPI installations and install every version you want to some dedicated place. To enable a particular version you want, you can use something like lmod or environmental modules – mcsim Sep 14 '15 at 07:29

0 Answers0