Putting everything in namespace eo::mpi

This commit is contained in:
Benjamin Bouvier 2012-06-25 14:11:44 +02:00
commit b291e56e03
12 changed files with 492 additions and 466 deletions

View file

@ -1,4 +1,4 @@
# include <mpi/eompi.h>
# include <mpi/eoMpi.h>
# include <mpi/eoParallelApply.h>
# include <iostream>
@ -6,6 +6,8 @@
# include <vector>
using namespace std;
using namespace eo::mpi;
struct plusOne : public eoUF< int&, void >
{
void operator() ( int & x )
@ -27,7 +29,7 @@ int main(int argc, char** argv)
// eo::log << eo::setlevel( eo::debug );
bool launchOnlyOne = false; // Set this to true if you wanna launch only the first test.
MpiNode::init( argc, argv );
Node::init( argc, argv );
srand( time(0) );
vector<int> v;
@ -43,10 +45,10 @@ int main(int argc, char** argv)
vector< Test > tests;
const int ALL = MpiNode::comm().size();
const int ALL = Node::comm().size();
Test tIntervalStatic;
tIntervalStatic.assign = new StaticAssignmentAlgorithm( 1, eo::REST_OF_THE_WORLD, v.size() );
tIntervalStatic.assign = new StaticAssignmentAlgorithm( 1, REST_OF_THE_WORLD, v.size() );
tIntervalStatic.description = "Correct static assignment with interval.";
tIntervalStatic.requiredNodesNumber = ALL;
tests.push_back( tIntervalStatic );
@ -81,7 +83,7 @@ int main(int argc, char** argv)
tests.push_back( tVectorStatic );
Test tIntervalDynamic;
tIntervalDynamic.assign = new DynamicAssignmentAlgorithm( 1, eo::REST_OF_THE_WORLD );
tIntervalDynamic.assign = new DynamicAssignmentAlgorithm( 1, REST_OF_THE_WORLD );
tIntervalDynamic.description = "Dynamic assignment with interval.";
tIntervalDynamic.requiredNodesNumber = ALL;
tests.push_back( tIntervalDynamic );
@ -114,7 +116,7 @@ int main(int argc, char** argv)
cout << "Test : " << tests[i].description << endl;
}
if( MpiNode::comm().rank() < tests[i].requiredNodesNumber )
if( Node::comm().rank() < tests[i].requiredNodesNumber )
{
job.run();
}
@ -134,7 +136,7 @@ int main(int argc, char** argv)
cout << endl;
}
MpiNode::comm().barrier();
Node::comm().barrier();
delete tests[i].assign;
}