#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<vector>
#include<pthread.h>
#include<mpi.h>
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/mpi.hpp>
using namespace std;
using namespace boost::serialization;
using namespace boost::archive;
namespace mpi = boost::mpi; // using mpi library under boost namespace
mpi::environment env;
mpi::communicator world;
#define MASTER 0
// Aim of this program is to print the Rank of each process and size of number of MPI Run
int main(int argc, char *argv[])
{
// Declarations and prototypes
int rankID, numprocessors,provided;
// Any serial code goes in here
// Initialize the MPI Environment over here
//MPI_Init(&argc,&argv);
int returnvalue = MPI_Init_thread(&argc,&argv,MPI_THREAD_MULTIPLE,&provided);
printf("\n VALUE OF PROVIDED IS %d",provided);
printf("\n VALUE OF MPI_THREAD_MULTIPLE IS %d",MPI_THREAD_MULTIPLE);
if(provided < MPI_THREAD_MULTIPLE)
{
printf("\n THREAD LIBRARY DOESN'T HAVE MULTITHREADING SUPPORT:");
//exit(1);
}
// Terminate the MPI Environment
MPI_Finalize();
}