I am running a MPI application on a single host, with a dual quadcore with
hyperthreading on. (16 OS-visible processors), but just in debug mode
(msvc2010) 32bit, with 2 mpi processes only.
mpirun -mca btl_tcp_if_exclude lo -np 1 prog1.exe : -np 1 prog2.exe
. when progr1.exe has 1 thread (mpi never initialized), everything works
. when progr2.exe has 2 threads (1 thread with no call to mpi functions,
and a second thread where mpi is initialized, through a default ctor of
boost::mpi::environment, I think thos means just a call to MPI_Initialize()
), ompi_info gives "Threading support: No"
1. I start prog1, create addition thread boost::thread that handles MPI
2. proceed to a point where both thread1 and threadMPI, not concurrently,
call a function f().
f() initializes a global const std::string* X=null, to a static, this X is
visible from both threads.
In fact, it appears at a certain point during a boost::mpi::broadcast,
within threadMPI, boost::mpi calls MPI_Isend (point_to_point.cpp: 53),
during this Isend, a 3rd thread (not threadMPI) is created and causes a
call to f() which doesn't see X as !=nullptr.
I can see this while debugging with msvc, and stepping into MPI_Isend (i
don't have the sources for it). At that moment, suddenly a new thread is
created, and a call to f() is made.
This all sounds quite nightmarish.
I understand I haven't presented any specific code to receive an accurate
answer, but any help is appreciated.