[mpich-discuss] Re : Nemesis engine query by Viswanath
Roy, Hirak
Hirak_Roy at mentor.com
Thu Aug 6 07:48:41 CDT 2015
Hi Viswanath,
I have some opportunity to work with both boost and mpi.
Just wanted to mention that boost::mpi::environment calls MPI_Init internally.
Your program does not work since you have declared boost::mpi::environment as a global object and then you have also called MPI_Init.
Either you remove the global objects (env) or you initialize that inside main.
Here is the snippet of the program :
int main(int argc, char *argv[])
{
mpi::environment env(argc, argv, boost::mpi::threading::multiple);
mpi::communicator world;
if (world.rank() ==0) {
cout << "#Master: Thread support :" << env.thread_level() <<endl;
}
}
Thanks,
Hirak
Balaji, Pavan balaji at anl.gov <mailto:discuss%40mpich.org?Subject=Re%3A%20%5Bmpich-discuss%5D%20Nemesis%20engine%20query%20by%20Viswanath&In-Reply-To=%3C8A837C95-3617-4F5C-9ED1-DFA6840913A5%40anl.gov%3E>
Mon Aug 3 10:48:20 CDT 2015
* Previous message: [mpich-discuss] Nemesis engine query by Viswanath<http://lists.mpich.org/pipermail/discuss/2015-August/004112.html>
* Next message: [mpich-discuss] question about valgrind errors I am getting<http://lists.mpich.org/pipermail/discuss/2015-August/004113.html>
* Messages sorted by: [ date ]<http://lists.mpich.org/pipermail/discuss/2015-August/date.html#4114> [ thread ]<http://lists.mpich.org/pipermail/discuss/2015-August/thread.html#4114> [ subject ]<http://lists.mpich.org/pipermail/discuss/2015-August/subject.html#4114> [ author ]<http://lists.mpich.org/pipermail/discuss/2015-August/author.html#4114>
________________________________
I first tried your program after removing the boost declarations, and it worked correctly:
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<vector>
#include<pthread.h>
#include<mpi.h>
using namespace std;
#define MASTER 0
int main(int argc, char *argv[])
{
int rankID, numprocessors,provided;
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:");
}
MPI_Finalize();
return 0;
}
With respect to Boost, yes, MPICH works correctly with Boost. But it is possible that something is not setup correctly in your installation of Boost. Did you make sure you are linking with the correct MPI library?
-- Pavan
From: Viswanath Krishnamurthy
Reply-To: "discuss at mpich.org<https://lists.mpich.org/mailman/listinfo/discuss><mailto:discuss at mpich.org<https://lists.mpich.org/mailman/listinfo/discuss>>"
Date: Monday, August 3, 2015 at 8:28 AM
To: "discuss at mpich.org<https://lists.mpich.org/mailman/listinfo/discuss><mailto:discuss at mpich.org<https://lists.mpich.org/mailman/listinfo/discuss>>"
Subject: Re: [mpich-discuss] Nemesis engine query by Viswanath
Hi,
Thanks for the previous post on MPI_Init_thread. Here is the sample program which failed
#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();
}
Error got:
Assertion failed in file /home/viswa/libraries/mpich-3.1.4/src/include/mpiimplthreadpost.h at line 163: depth > 0 && depth < 10
internal ABORT - process 1
internal ABORT - process 0
I tried to use boost library in my MPI Code. Is MPI_Init_thread
designed to work with Boost libraries?. If not, please suggest an alternative to
send vectors(STL types) using MPI.
MPI version - 3.1.4
CPU Info:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Stepping: 2
CPU MHz: 3458.000
BogoMIPS: 6916.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 12288K
NUMA node0 CPU(s): 0-7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20150803/43b31c11/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20150806/8d1fe2c6/attachment.html>
-------------- next part --------------
_______________________________________________
discuss mailing list discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss
More information about the discuss
mailing list