Teuchos::Time::wallTime() might not return a wall time but a CPU time
Created by: finkandreas
Teuchos:e:Time::wallTime() could not return actually a wall time, but the cpu time. Looking into the implementation, I've seen this piece of code:
#ifdef HAVE_MPI
int mpiInitialized;
MPI_Initialized(&mpiInitialized);
if( mpiInitialized ) {
return(MPI_Wtime());
}
else {
clock_t start;
start = clock();
return( (double)( start ) / CLOCKS_PER_SEC );
}
I realized it, when I did not initialize MPI, so I'll end up with the clock()
call.
On Linux the value returned is the CPU time, NOT a wallclock time, i.e. in an OpenMP programm this will give wrong results.