13 #ifndef SPATIALLOCATORTIMES_HPP
14 #define SPATIALLOCATORTIMES_HPP
46 void output(
bool print_head =
false,
bool print_endl =
false )
const;
62 ErrorCode accumulate_times( MPI_Comm comm,
double* max_times,
double* min_times,
double* avg_times = NULL );
89 inline ErrorCode SpatialLocatorTimes::accumulate_times( MPI_Comm comm,
95 int success = MPI_Reduce(
slTimes, min_times,
NUM_STATS, MPI_DOUBLE, MPI_MIN, 0, comm );
96 if( !success ) rval = MB_FAILURE;
98 success = MPI_Reduce(
slTimes, max_times,
NUM_STATS, MPI_DOUBLE, MPI_MAX, 0, comm );
99 if( !success ) rval = MB_FAILURE;
104 MPI_Comm_size( comm, &sz );
105 MPI_Comm_rank( comm, &rank );
106 std::vector< double > all_times;
110 if( !success ) rval = MB_FAILURE;
113 std::fill( avg_times, avg_times +
NUM_STATS, 0.0 );
114 for(
int p = 0; p < sz; p++ )
117 avg_times[s] += all_times[p *
NUM_STATS + s];
121 avg_times[s] /= (
double)sz;
133 std::cout <<
"Intmed_init Intmed_send Intmed_search src_send src_search targ_return targ_store";
134 if( print_endl ) std::cout << std::endl;
143 std::cout <<
slTimes[i] <<
" ";
145 if( print_endl ) std::cout << std::endl;