Merged MpiJob and Role, using eoLogger instead of cout.
This commit is contained in:
parent
fb871382e0
commit
da9eb9ce7b
3 changed files with 38 additions and 65 deletions
|
|
@ -16,9 +16,10 @@ struct plusOne : public eoUF< int&, void >
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
eo::log << eo::setlevel( eo::debug );
|
||||
cout << "Appel à init... " << endl;
|
||||
MpiNode::init( argc, argv );
|
||||
DynamicAssignmentAlgorithm algo( 1, MpiNode::comm().size()-1 );
|
||||
DynamicAssignmentAlgorithm assign( 1, MpiNode::comm().size()-1 );
|
||||
|
||||
cout << "Création des données... " << endl;
|
||||
vector<int> v;
|
||||
|
|
@ -32,11 +33,10 @@ int main(int argc, char** argv)
|
|||
plusOne plusOneInstance;
|
||||
|
||||
cout << "Création du job..." << endl;
|
||||
ParallelApply<int> job( plusOneInstance, v, algo, 0 );
|
||||
Role node( job );
|
||||
node.run();
|
||||
ParallelApply<int> job( plusOneInstance, v, assign, 0 );
|
||||
job.run();
|
||||
|
||||
if( node.master() )
|
||||
if( job.isMaster() )
|
||||
{
|
||||
for(int i = 0; i < v.size(); ++i)
|
||||
{
|
||||
|
|
|
|||
Reference in a new issue