<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div><br>
</div>
<div>I first tried your program after removing the boost declarations, and it worked correctly:</div>
<div><br>
</div>
<div>
<div>#include<cstdio></div>
<div>#include<cstdlib></div>
<div>#include<cstring></div>
<div>#include<iostream></div>
<div>#include<vector></div>
<div>#include<pthread.h></div>
<div>#include<mpi.h></div>
<div><br>
</div>
<div>using namespace std;</div>
<div><br>
</div>
<div>#define MASTER 0</div>
<div><br>
</div>
<div>int main(int argc, char *argv[])</div>
<div>{</div>
<div>    int rankID, numprocessors,provided;</div>
<div>    int returnvalue = MPI_Init_thread(&argc,&argv,MPI_THREAD_MULTIPLE,&provided);</div>
<div><br>
</div>
<div>    printf("\n VALUE OF PROVIDED IS %d",provided);</div>
<div>    printf("\n VALUE OF MPI_THREAD_MULTIPLE IS %d",MPI_THREAD_MULTIPLE);</div>
<div>    if(provided < MPI_THREAD_MULTIPLE)</div>
<div>    {</div>
<div>        printf("\n THREAD LIBRARY DOESN'T HAVE MULTITHREADING SUPPORT:");</div>
<div>    }</div>
<div><br>
</div>
<div>    MPI_Finalize();</div>
<div><br>
</div>
<div>    return 0;</div>
<div>}</div>
</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>  -- Pavan</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Viswanath Krishnamurthy<br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>"<br>
<span style="font-weight:bold">Date: </span>Monday, August 3, 2015 at 8:28 AM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>"<br>
<span style="font-weight:bold">Subject: </span>Re: [mpich-discuss] Nemesis engine query by Viswanath<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>Thanks for the previous post on <span style="font-size:12.8000001907349px">MPI_Init_thread. Here is the sample program which failed</span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div>
<div><span style="font-size:12.8000001907349px">#include<cstdio></span></div>
<div><span style="font-size:12.8000001907349px">#include<cstdlib></span></div>
<div><span style="font-size:12.8000001907349px">#include<cstring></span></div>
<div><span style="font-size:12.8000001907349px">#include<iostream></span></div>
<div><span style="font-size:12.8000001907349px">#include<vector></span></div>
<div><span style="font-size:12.8000001907349px">#include<pthread.h></span></div>
<div><span style="font-size:12.8000001907349px">#include<mpi.h></span></div>
<div><span style="font-size:12.8000001907349px">#include <boost/mpi/environment.hpp></span></div>
<div><span style="font-size:12.8000001907349px">#include <boost/mpi/communicator.hpp></span></div>
<div><span style="font-size:12.8000001907349px">#include <boost/serialization/vector.hpp></span></div>
<div><span style="font-size:12.8000001907349px">#include <boost/mpi.hpp></span></div>
<div><span style="font-size:12.8000001907349px">using namespace std;</span></div>
<div><span style="font-size:12.8000001907349px">using namespace boost::serialization;</span></div>
<div><span style="font-size:12.8000001907349px">using namespace boost::archive;</span></div>
<div><span style="font-size:12.8000001907349px">namespace mpi = boost::mpi; // using mpi library under boost namespace</span></div>
<div><span style="font-size:12.8000001907349px">mpi::environment env;</span></div>
<div><span style="font-size:12.8000001907349px">mpi::communicator world;</span></div>
<div><span style="font-size:12.8000001907349px">#define MASTER 0</span></div>
<div><span style="font-size:12.8000001907349px">// Aim of this program is to print the Rank of each process and size of number of MPI Run</span></div>
<div><span style="font-size:12.8000001907349px">int main(int argc, char *argv[])</span></div>
<div><span style="font-size:12.8000001907349px">{</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>// Declarations and prototypes</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>int rankID, numprocessors,provided;</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>// Any serial code goes in here</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>// Initialize the MPI Environment over here</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>//MPI_Init(&argc,&argv);<span class="Apple-tab-span" style="white-space:pre"></span></span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>int returnvalue = MPI_Init_thread(&argc,&argv,MPI_THREAD_MULTIPLE,&provided);</span></div>
<div><span style="font-size:12.8000001907349px">       <span class="Apple-tab-span" style="white-space:pre"></span>printf("\n VALUE OF PROVIDED IS %d",provided);</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>printf("\n VALUE OF MPI_THREAD_MULTIPLE IS %d",MPI_THREAD_MULTIPLE); </span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>if(provided < MPI_THREAD_MULTIPLE)</span></div>
<div><span style="font-size:12.8000001907349px">        {</span></div>
<div><span style="font-size:12.8000001907349px">                printf("\n THREAD LIBRARY DOESN'T HAVE MULTITHREADING SUPPORT:");</span></div>
<div><span style="font-size:12.8000001907349px">                //exit(1);</span></div>
<div><span style="font-size:12.8000001907349px">        }</span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>// Terminate the MPI Environment</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span>MPI_Finalize();</span></div>
<div><span style="font-size:12.8000001907349px"><span class="Apple-tab-span" style="white-space:pre"></span> </span></div>
<div><span style="font-size:12.8000001907349px">}</span></div>
<div style="font-size:12.8000001907349px"><br>
</div>
</div>
<div>Error got: </div>
<div><br>
</div>
<div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Assertion failed in file /home/viswa/libraries/mpich-3.1.4/src/include/mpiimplthreadpost.h at line 163: depth > 0 && depth < 10</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">internal ABORT - process 1</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">internal ABORT - process 0</div>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px"><br>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">I tried to use boost library in my MPI Code. Is MPI_Init_thread</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">designed to work with Boost libraries?. If not, please suggest an alternative to</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">send vectors(STL types) using MPI.</div>
<div class="gmail_extra" style="font-size:12.8000001907349px"><br>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">MPI version - 3.1.4</div>
<div class="gmail_extra" style="font-size:12.8000001907349px"><br>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">CPU Info:</div>
<div class="gmail_extra" style="font-size:12.8000001907349px"><br>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">
<div class="gmail_extra" style="font-size:12.8000001907349px">Architecture:          x86_64</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">CPU op-mode(s):        32-bit, 64-bit</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Byte Order:            Little Endian</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">CPU(s):                8</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">On-line CPU(s) list:   0-7</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Thread(s) per core:    1</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Core(s) per socket:    4</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Socket(s):             2</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">NUMA node(s):          1</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Vendor ID:             GenuineIntel</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">CPU family:            6</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Model:                 44</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Stepping:              2</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">CPU MHz:               3458.000</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">BogoMIPS:              6916.00</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Hypervisor vendor:     VMware</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">Virtualization type:   full</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">L1d cache:             32K</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">L1i cache:             32K</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">L2 cache:              256K</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">L3 cache:              12288K</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">NUMA node0 CPU(s):     0-7</div>
<div><br>
</div>
</div>
<div class="gmail_extra" style="font-size:12.8000001907349px">
<div class="gmail_extra" style="font-size:12.8000001907349px"><br>
</div>
</div>
</div>
</div>
</div>
</span>
</body>
</html>