Skip to content
Snippets Groups Projects
Commit af5babce authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[doc/comm]

Check all programs even if MPI was not found. (similar to dune/common/test)
Fix poosc08_test to compile without MPI.

[[Imported from SVN: r1681]]
parent 6926dfe5
No related branches found
No related tags found
No related merge requests found
......@@ -18,3 +18,4 @@ indexset
Makefile.dist.in
Makefile.dist
poosc08_test
poosc08
......@@ -2,10 +2,8 @@
SUBDIRS = figures
# only build these programs if an MPI-implementation was found
if MPI
MPIPROGRAMS = indexset poosc08 poosc08_test
endif
MPIPROGRAMS = indexset poosc08 poosc08_test
# programs just to build when "make check" is used
check_PROGRAMS = $(MPIPROGRAMS)
# list of tests to run (indicestest is special case)
......
......@@ -45,6 +45,7 @@ struct CopyData {
template<class T>
void doCalculations(T& t){}
#if HAVE_MPI
void test()
{
int rank;
......@@ -128,21 +129,22 @@ void test()
doCalculations(t);
//bCommRedist.backward<AddData<Container> >(s,t);
}
#endif // HAVE_MPI
int main(int argc, char** argv)
{
try{
using namespace Dune;
#if HAVE_MPI
//Maybe initialize Mpi
MPIHelper& helper = MPIHelper::instance(argc, argv);
std::cout << "Hello World! This is poosc08. rank=" <<helper.rank()<< std::endl;
if(Dune::MPIHelper::isFake)
std::cout<< "This is a sequential program." << std::endl;
else{
test();
}
test();
return 0;
#else
std::cout<< "Test poosc08_test disabled because MPI is not available." << std::endl;
return 77;
#endif // HAVE_MPI
}
catch (Dune::Exception &e) {
std::cerr << "Dune reported error: " << e << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment