fix(mpi): fix some namespaces issues with mpi
This commit is contained in:
parent
c442d8a0a2
commit
4bbb4a595e
8 changed files with 30 additions and 16 deletions
|
|
@ -29,6 +29,7 @@ Authors:
|
|||
# include "../eoFunctor.h"
|
||||
# include "../eoExceptions.h"
|
||||
|
||||
# include "mpi/implMpi.h"
|
||||
# include "eoMpiNode.h"
|
||||
# include "eoMpiAssignmentAlgorithm.h"
|
||||
|
||||
|
|
@ -669,7 +670,7 @@ namespace eo
|
|||
timerStat.start("master_wait_for_all_responses");
|
||||
while( assignmentAlgo.availableWorkers() != totalWorkers )
|
||||
{
|
||||
bmpi::status status = comm.probe( bmpi::any_source, eo::mpi::Channel::Messages );
|
||||
eo::mpi::status status = comm.probe( eo::mpi::any_source, eo::mpi::Channel::Messages );
|
||||
int wrkRank = status.source();
|
||||
that.handleResponse( wrkRank );
|
||||
comm.send( wrkRank, Channel::Commands, Message::Finish );
|
||||
|
|
@ -686,7 +687,7 @@ namespace eo
|
|||
AssignmentAlgorithm& assignmentAlgo;
|
||||
Job< JobData > & that;
|
||||
|
||||
bmpi::communicator & comm;
|
||||
eo::mpi::communicator & comm;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -713,7 +714,7 @@ namespace eo
|
|||
{
|
||||
eo::log << eo::debug << "[M" << comm.rank() << "] Waitin' for node..." << std::endl;
|
||||
|
||||
bmpi::status status = comm.probe( bmpi::any_source, eo::mpi::Channel::Messages );
|
||||
eo::mpi::status status = comm.probe( eo::mpi::any_source, eo::mpi::Channel::Messages );
|
||||
int wrkRank = status.source();
|
||||
|
||||
eo::log << eo::debug << "[M" << comm.rank() << "] Node " << wrkRank << " just terminated." << std::endl;
|
||||
|
|
@ -797,7 +798,7 @@ namespace eo
|
|||
AssignmentAlgorithm& assignmentAlgo;
|
||||
int masterRank;
|
||||
const int workerStopCondition;
|
||||
bmpi::communicator& comm;
|
||||
eo::mpi::communicator& comm;
|
||||
|
||||
JobStore<JobData>& store;
|
||||
SendTaskFunction<JobData> & sendTask;
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ namespace eo
|
|||
{
|
||||
void Node::init( int argc, char** argv )
|
||||
{
|
||||
static bmpi::environment env( argc, argv );
|
||||
static eo::mpi::environment env( argc, argv );
|
||||
}
|
||||
|
||||
bmpi::communicator& Node::comm()
|
||||
eo::mpi::communicator& Node::comm()
|
||||
{
|
||||
return _comm;
|
||||
}
|
||||
|
||||
bmpi::communicator Node::_comm;
|
||||
eo::mpi::communicator Node::_comm;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Authors:
|
|||
# define __MPI_NODE_H__
|
||||
|
||||
# include "implMpi.h"
|
||||
namespace bmpi = mpi;
|
||||
// namespace bmpi = mpi;
|
||||
|
||||
namespace eo
|
||||
{
|
||||
|
|
@ -54,10 +54,10 @@ namespace eo
|
|||
/**
|
||||
* @brief Returns the global mpi::communicator
|
||||
*/
|
||||
static bmpi::communicator& comm();
|
||||
static eo::mpi::communicator& comm();
|
||||
|
||||
protected:
|
||||
static bmpi::communicator _comm;
|
||||
static eo::mpi::communicator _comm;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace eo
|
|||
typedef eoUF< eoPop<EOT>&, void> ResetAlgo;
|
||||
|
||||
MultiStartData(
|
||||
bmpi::communicator& _comm,
|
||||
eo::mpi::communicator& _comm,
|
||||
eoAlgo<EOT>& _algo,
|
||||
int _masterRank,
|
||||
ResetAlgo & _resetAlgo )
|
||||
|
|
@ -87,7 +87,7 @@ namespace eo
|
|||
/**
|
||||
* @brief Communicator, used to send and retrieve messages.
|
||||
*/
|
||||
bmpi::communicator& comm;
|
||||
eo::mpi::communicator& comm;
|
||||
|
||||
/**
|
||||
* @brief Algorithm which will be performed by the worker.
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ namespace eo
|
|||
std::vector<EOT> tempArray;
|
||||
|
||||
int masterRank;
|
||||
bmpi::communicator& comm;
|
||||
eo::mpi::communicator& comm;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ Authors:
|
|||
*/
|
||||
#include "implMpi.h"
|
||||
|
||||
namespace eo
|
||||
{
|
||||
namespace mpi
|
||||
{
|
||||
const int any_source = MPI_ANY_SOURCE;
|
||||
|
|
@ -163,4 +165,5 @@ namespace mpi
|
|||
{
|
||||
MPI_Bcast( &value, 1, MPI_INT, root, MPI_COMM_WORLD );
|
||||
}
|
||||
}
|
||||
} // namespace mpi
|
||||
} // namespace eo
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ Authors:
|
|||
* The entities are here shortly described, if you need further details, don't hesitate
|
||||
* to visit the boost URL.
|
||||
*/
|
||||
|
||||
namespace eo
|
||||
{
|
||||
namespace mpi
|
||||
{
|
||||
/**
|
||||
|
|
@ -83,6 +84,14 @@ namespace mpi
|
|||
~environment();
|
||||
};
|
||||
|
||||
struct MPI_Status {
|
||||
int count;
|
||||
int cancelled;
|
||||
int MPI_SOURCE;
|
||||
int MPI_TAG;
|
||||
int MPI_ERROR;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Wrapper class for MPI_Status
|
||||
*
|
||||
|
|
@ -318,5 +327,6 @@ namespace mpi
|
|||
* @}
|
||||
*/
|
||||
} // namespace mpi
|
||||
} // namespace eo
|
||||
|
||||
# endif //__EO_IMPL_MPI_HPP__
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ class Experiment : public eoserial::Persistent
|
|||
|
||||
void run()
|
||||
{
|
||||
mpi::communicator& comm = eo::mpi::Node::comm();
|
||||
communicator& comm = eo::mpi::Node::comm();
|
||||
// reinits every objects
|
||||
eo::rng.reseed( _seed );
|
||||
eo::rng.clearCache(); // trick for repeatable sequences of normal numbers, cf eo::rng
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue