<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><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>