Skip to content
Snippets Groups Projects
Commit b72aad12 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Also measure assembly times using the OpenMP timers.

    
The Dune timers do not return wall time when using thread parallelism.

[[Imported from SVN: r9283]]
parent 64bdf56d
No related branches found
No related tags found
No related merge requests found
#include "omp.h"
#include <dune/common/bitsetvector.hh>
#include <dune/common/timer.hh>
......@@ -237,16 +239,22 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
Dune::Timer gradientTimer;
if (recomputeGradientHessian) {
double oldClock = omp_get_wtime();
assembler_->assembleGradient(x_, rhs);
rhs *= -1; // The right hand side is the _negative_ gradient
std::cout << "gradient assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
std::cout << "gradient assembly took " << (omp_get_wtime() - oldClock) << " sec." << std::endl;
gradientTimer.reset();
oldClock = omp_get_wtime();
assembler_->assembleMatrix(x_,
*hessianMatrix_,
i==0 // assemble occupation pattern only for the first call
);
std::cout << "hessian assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
std::cout << "hessian assembly took " << (omp_get_wtime() - oldClock) << " sec." << std::endl;
recomputeGradientHessian = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment