none
MS-MPI for VStudio 2015? RRS feed

  • Question

  • Hi,

    Is there a MS-MPI version compatible with Visual Studio 2015?

    If not, is there any expectations to have one?

    Thanks,

    Eric

    Tuesday, November 15, 2016 5:21 AM

All replies

  • Hi Eric,

    I think all the recent versions (v6, v7, v7.1) should be compatible with VS 2015. Let us know if you run into any issues

    Anh

    Tuesday, November 22, 2016 10:29 PM
  • I am testing this code (using boost MPI, under windows 10 <Microsoft MPI v7.1>

    point-to-point example

    #include <boost/mpi.hpp>
    #include <iostream>
    #include <boost/serialization/string.hpp>
    #include <thread>
    #include <boost/exception/all.hpp>
    #include <exception>
    
    using namespace std;
    namespace mpi = boost::mpi;
    
    int main(int argc, char* argv[]) {
    
       for (int i = 0; i < argc; ++i) {
          std::cout << "argc " << i << " value " << argv[i] << std::endl;
       }
    
       mpi::environment env(false);
       std::cout << "processor_name " << env.processor_name() <<
          " thread_level: " << env.thread_level() <<
          " is_main_thread: " << env.is_main_thread() << std::endl;
    
       std::this_thread::sleep_for(std::chrono::seconds(2));
    
       mpi::communicator world;
       std::cout << "I am process " << world.rank() << " of " << world.size()
          << "." << std::endl;
    
       do {
          if (world.rank() == 0) {
             try {
                mpi::request reqs[2];
                std::string msg, out_msg = "Hello";
    
                reqs[0] = world.isend(1, 0, out_msg);
                reqs[1] = world.irecv(1, 1, msg);
                mpi::wait_all(reqs, reqs + 2);
                std::cout << msg << "!" << std::endl;
             }
             catch (boost::exception &ex) {
                std::cerr << "[" << world.rank() << "] boost::exception" << boost::diagnostic_information(ex);
             }
             catch (std::exception &ex) {
                std::cerr << "[" << world.rank() << "] std::exception" << ex.what();
             }
             catch (...) {
                std::cerr << "[" << world.rank() << "] exception";
             }
          }
          else {
             try {
                mpi::request reqs[2];
                std::string msg, out_msg = "world";
                reqs[0] = world.isend(0, 1, out_msg);
                reqs[1] = world.irecv(0, 0, msg);
                mpi::wait_all(reqs, reqs + 2);
                std::cout << msg << ", ";
             }
             catch (boost::exception &ex) {
                std::cerr << "[" << world.rank() << "]" << boost::diagnostic_information(ex);
             }
             catch (std::exception &ex) {
                std::cerr << "[" << world.rank() << "]" << ex.what();
             }
             catch (...) {
                std::cerr << "[" << world.rank() << "]" << "exception";
             }
          }
          std::this_thread::sleep_for(std::chrono::seconds(1));
       } while (true);
    
       return 0;
    }
    

    this is the output using mpiexec  (mpiexec -n 2 app_name.exe)

    argc 0 value boost_mpi_main_MDd_x86_v140.exe
    argc 0 value boost_mpi_main_MDd_x86_v140.exe
    processor_name jagomezw7.indra.es thread_level: single is_main_thread: 1
    processor_name jagomezw7.indra.es thread_level: single is_main_thread: 1
    I am process 0 of 2.
    I am process 1 of 2.
    world!

    works well, for sure


    jose andres gomez tovar

    Wednesday, November 23, 2016 3:16 PM