MPI: Show debug messages into log even in release mode.
This commit is contained in:
parent
0dca473aac
commit
d8edf16189
2 changed files with 21 additions and 36 deletions
|
|
@ -648,10 +648,8 @@ namespace eo
|
||||||
|
|
||||||
~FinallyBlock()
|
~FinallyBlock()
|
||||||
{
|
{
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[M" << comm.rank() << "] Frees all the idle." << std::endl;
|
||||||
eo::log << eo::debug;
|
|
||||||
eo::log << "[M" << comm.rank() << "] Frees all the idle." << std::endl;
|
|
||||||
# endif
|
|
||||||
// frees all the idle workers
|
// frees all the idle workers
|
||||||
timerStat.start("master_wait_for_idles");
|
timerStat.start("master_wait_for_idles");
|
||||||
std::vector<int> idles = assignmentAlgo.idles();
|
std::vector<int> idles = assignmentAlgo.idles();
|
||||||
|
|
@ -661,9 +659,8 @@ namespace eo
|
||||||
}
|
}
|
||||||
timerStat.stop("master_wait_for_idles");
|
timerStat.stop("master_wait_for_idles");
|
||||||
|
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[M" << comm.rank() << "] Waits for all responses." << std::endl;
|
||||||
eo::log << "[M" << comm.rank() << "] Waits for all responses." << std::endl;
|
|
||||||
# endif
|
|
||||||
// wait for all responses
|
// wait for all responses
|
||||||
timerStat.start("master_wait_for_all_responses");
|
timerStat.start("master_wait_for_all_responses");
|
||||||
while( assignmentAlgo.availableWorkers() != totalWorkers )
|
while( assignmentAlgo.availableWorkers() != totalWorkers )
|
||||||
|
|
@ -675,9 +672,8 @@ namespace eo
|
||||||
assignmentAlgo.confirm( wrkRank );
|
assignmentAlgo.confirm( wrkRank );
|
||||||
}
|
}
|
||||||
timerStat.stop("master_wait_for_all_responses");
|
timerStat.stop("master_wait_for_all_responses");
|
||||||
# ifndef NDEBUG
|
|
||||||
eo::log << "[M" << comm.rank() << "] Leaving master task." << std::endl;
|
eo::log << eo::debug << "[M" << comm.rank() << "] Leaving master task." << std::endl;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -701,10 +697,8 @@ namespace eo
|
||||||
void master( )
|
void master( )
|
||||||
{
|
{
|
||||||
int totalWorkers = assignmentAlgo.availableWorkers();
|
int totalWorkers = assignmentAlgo.availableWorkers();
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[M" << comm.rank() << "] Have " << totalWorkers << " workers." << std::endl;
|
||||||
eo::log << eo::debug;
|
|
||||||
eo::log << "[M" << comm.rank() << "] Have " << totalWorkers << " workers." << std::endl;
|
|
||||||
# endif
|
|
||||||
try {
|
try {
|
||||||
FinallyBlock finally( totalWorkers, assignmentAlgo, *this );
|
FinallyBlock finally( totalWorkers, assignmentAlgo, *this );
|
||||||
while( ! isFinished() )
|
while( ! isFinished() )
|
||||||
|
|
@ -713,22 +707,20 @@ namespace eo
|
||||||
int assignee = assignmentAlgo.get( );
|
int assignee = assignmentAlgo.get( );
|
||||||
while( assignee <= 0 )
|
while( assignee <= 0 )
|
||||||
{
|
{
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[M" << comm.rank() << "] Waitin' for node..." << std::endl;
|
||||||
eo::log << "[M" << comm.rank() << "] Waitin' for node..." << std::endl;
|
|
||||||
# endif
|
|
||||||
bmpi::status status = comm.probe( bmpi::any_source, eo::mpi::Channel::Messages );
|
bmpi::status status = comm.probe( bmpi::any_source, eo::mpi::Channel::Messages );
|
||||||
int wrkRank = status.source();
|
int wrkRank = status.source();
|
||||||
# ifndef NDEBUG
|
|
||||||
eo::log << "[M" << comm.rank() << "] Node " << wrkRank << " just terminated." << std::endl;
|
eo::log << eo::debug << "[M" << comm.rank() << "] Node " << wrkRank << " just terminated." << std::endl;
|
||||||
# endif
|
|
||||||
handleResponse( wrkRank );
|
handleResponse( wrkRank );
|
||||||
assignmentAlgo.confirm( wrkRank );
|
assignmentAlgo.confirm( wrkRank );
|
||||||
assignee = assignmentAlgo.get( );
|
assignee = assignmentAlgo.get( );
|
||||||
}
|
}
|
||||||
timerStat.stop("master_wait_for_assignee");
|
timerStat.stop("master_wait_for_assignee");
|
||||||
# ifndef NDEBUG
|
|
||||||
eo::log << "[M" << comm.rank() << "] Assignee : " << assignee << std::endl;
|
eo::log << eo::debug << "[M" << comm.rank() << "] Assignee : " << assignee << std::endl;
|
||||||
# endif
|
|
||||||
|
|
||||||
timerStat.start("master_wait_for_send");
|
timerStat.start("master_wait_for_send");
|
||||||
comm.send( assignee, Channel::Commands, Message::Continue );
|
comm.send( assignee, Channel::Commands, Message::Continue );
|
||||||
|
|
@ -752,29 +744,22 @@ namespace eo
|
||||||
void worker( )
|
void worker( )
|
||||||
{
|
{
|
||||||
int order;
|
int order;
|
||||||
# ifndef NDEBUG
|
|
||||||
eo::log << eo::debug;
|
|
||||||
# endif
|
|
||||||
timerStat.start("worker_wait_for_order");
|
timerStat.start("worker_wait_for_order");
|
||||||
comm.recv( masterRank, Channel::Commands, order );
|
comm.recv( masterRank, Channel::Commands, order );
|
||||||
timerStat.stop("worker_wait_for_order");
|
timerStat.stop("worker_wait_for_order");
|
||||||
|
|
||||||
while( true )
|
while( true )
|
||||||
{
|
{
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[W" << comm.rank() << "] Waiting for an order..." << std::endl;
|
||||||
eo::log << "[W" << comm.rank() << "] Waiting for an order..." << std::endl;
|
|
||||||
# endif
|
|
||||||
if ( order == workerStopCondition )
|
if ( order == workerStopCondition )
|
||||||
{
|
{
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[W" << comm.rank() << "] Leaving worker task." << std::endl;
|
||||||
eo::log << "[W" << comm.rank() << "] Leaving worker task." << std::endl;
|
|
||||||
# endif
|
|
||||||
return;
|
return;
|
||||||
} else if( order == Message::Continue )
|
} else if( order == Message::Continue )
|
||||||
{
|
{
|
||||||
# ifndef NDEBUG
|
eo::log << eo::debug << "[W" << comm.rank() << "] Processing task..." << std::endl;
|
||||||
eo::log << "[W" << comm.rank() << "] Processing task..." << std::endl;
|
|
||||||
# endif
|
|
||||||
processTask( );
|
processTask( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ namespace eo
|
||||||
|
|
||||||
_data->comm.send( wrkRank, eo::mpi::Channel::Messages, sentSize );
|
_data->comm.send( wrkRank, eo::mpi::Channel::Messages, sentSize );
|
||||||
|
|
||||||
eo::log << eo::progress << "Evaluating individual " << _data->index << std::endl;
|
eo::log << eo::debug << "Evaluating individual " << _data->index << std::endl;
|
||||||
|
|
||||||
_data->assignedTasks[ wrkRank ].index = _data->index;
|
_data->assignedTasks[ wrkRank ].index = _data->index;
|
||||||
_data->assignedTasks[ wrkRank ].size = sentSize;
|
_data->assignedTasks[ wrkRank ].size = sentSize;
|
||||||
|
|
|
||||||
Reference in a new issue