|
Boost Users : |
Subject: [Boost-users] Boost test and openmpi
From: Martin Vymazal (martin.vymazal_at_[hidden])
Date: 2014-02-14 05:48:21
Hello,
I have the following code:
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE mpi_functionality
#include <boost/test/unit_test.hpp>
#include "mpi.h"
struct MPI_Functionality_Fixture
{
MPI_Functionality_Fixture()
{
m_argc = boost::unit_test::framework::master_test_suite().argc;
m_argv = boost::unit_test::framework::master_test_suite().argv;
}
int m_argc;
char** m_argv;
};
BOOST_FIXTURE_TEST_SUITE( MPI_Functionality_TestSuite,
MPI_Functionality_Fixture )
BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_init )
{
MPI_Init(&m_argc,&m_argv);
}
BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_finalize )
{
MPI_Finalize();
}
BOOST_AUTO_TEST_SUITE_END()
The code compiles fine, but I have the following problem when I try to run it.
When I run as
'mpirun ./my_executable' or 'mpirun -np 3 ./my_executable'
everything goes fine. On the other hand, when I run as
./my_executable
I get the following error:
unknown location(0): fatal error in "mpi_functionality_parenv_finalize":
unrecognized signal
Outside of Boost, it is perfectly possible to write a program which calls
MPI_Init and MPI_Finalize and it does not have to be used with mpirun.
I wonder if this (different) behavior of Boost test is normal. I did not find
any remarks regarding Boost test and mpi in the tutorial.
Best regards,
Martin Vymazal
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net