Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost test and openmpi
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2014-02-20 18:27:46


On Feb 19, 2014, at 2:01 PM, Richard <legalize+jeeves_at_[hidden]> wrote:
>
> [Please do not mail me a copy of your followup]
>
> boost-users_at_[hidden] spake the secret code
> <4075154.HSbG0KVyOh_at_arlin17> thusly:
>
>> BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_init )
>> {
>> MPI_Init(&m_argc,&m_argv);
>> }
>>
>> BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_finalize )
>> {
>> MPI_Finalize();
>> }
>
> These aren't separate test cases, they are setup/teardown for an
> individual test case.
>
> <http://www.open-mpi.org/doc/v1.4/man3/MPI_Init.3.php> and
> <http://www.open-mpi.org/doc/v1.4/man3/MPI_Finalize.3.php>
> indicate that these two functions should always be paired.
>
> Furthermore, not even MPI_Init can be called after MPI_Finalize.
> Therefore, you can't call these pairs of functions once per test case
> or once per fixture, you can only call them once per process.
>
> Therefore, you probably want to write your own implementation of
> main() that handles MPI_Init and MPI_Finalize before calling the test
> runner.

A global fixture seems like a more appropriate solution than implementing main().

BOOST_GLOBAL_FIXTURE
http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/utf/user-guide/fixture/global.html


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