|
Boost Users : |
Subject: Re: [Boost-users] Boost test and openmpi
From: Richard (legalize+jeeves_at_[hidden])
Date: 2014-02-19 14:01:42
[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.
Since you are using the shared library version of Boost.Test, see this
page for an example of how to write your own implementation of main.
<http://user.xmission.com/~legalize/tmp/boost.test/libs/test/doc/html/test/guide/compilation/shared_library.html>
-- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Computer Graphics Museum <http://computergraphicsmuseum.org> The Terminals Wiki <http://terminals.classiccmp.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
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