Commit cce82fcc authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

Merge branch '103-timingtree-getreduced-hangs-if-names-are-not-synchronized-manually' into 'master'

Resolve "TimingTree::getReduced() hangs if names are not synchronized manually"

Closes #103

See merge request walberla/walberla!427
parents 9b53bb97 6a8bb6a0
......@@ -68,16 +68,19 @@ public:
/// Resets the the timing hierarchy
void reset();
//** Reduction ******************************************************************************************************
/*! \name Reduction */
//@{
/// Collects all the timing data from different processes
TimingTree<TP> getReduced( ReduceType rt = REDUCE_TOTAL, int targetRank = 0 ) const;
///
/// \param rt type of reduction used
/// \param targetRank
/// \param callSynchronize call synchronize() before doing the reduction
/// \return
///
/// \attention Setting callSynchronize to false can lead to deadlocks during reduction if different ranks
/// have different timing nodes! Setting it to true causes an additional communication.
TimingTree<TP> getReduced( ReduceType rt = REDUCE_TOTAL, int targetRank = 0, bool callSynchronize = true ) const;
/// Adds entries which only exist on other processes. Has to be collectively called on all processes!
void synchronize();
//@}
//*******************************************************************************************************************
/// Returns the raw tree data structure
const TimingNode<TP>& getRawData() const;
......@@ -189,9 +192,13 @@ void TimingTree<TP>::reset()
}
template< typename TP > // Timing policy
TimingTree<TP> TimingTree<TP>::getReduced( ReduceType rt, int targetRank ) const
TimingTree<TP> TimingTree<TP>::getReduced( ReduceType rt, int targetRank, bool callSynchronize ) const
{
TimingTree<TP> tt(*this);
if (callSynchronize)
{
tt.synchronize();
}
reduceInplace( tt.root_, rt, targetRank );
return tt;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment