• R/O
  • SSH
  • HTTPS

molds: Commit


Commit MetaInfo

Revision1838 (tree)
Time2016-12-15 17:28:59
Authormikiya_fujii

Log Message

elapsed time of each ehrenfest step is output. #30947 #29965

Change Summary

Incremental Difference

--- trunk/src/ehrenfest/Ehrenfest.cpp (revision 1837)
+++ trunk/src/ehrenfest/Ehrenfest.cpp (revision 1838)
@@ -25,6 +25,7 @@
2525 #include<vector>
2626 #include<stdexcept>
2727 #include<complex>
28+#include<omp.h>
2829 #include<boost/shared_ptr.hpp>
2930 #include<boost/format.hpp>
3031 #include"../config.h"
@@ -145,6 +146,7 @@
145146
146147 for(int s=0; s<totalSteps; s++){
147148 this->OutputLog(boost::format("%s%d\n") % this->messageStartStepEhrenfest.c_str() % (s+1) );
149+ double ompStartTime = omp_get_wtime();
148150
149151 // update momenta & coordinates
150152 this->UpdateMomenta (trialMolecule, matrixMeanForce, dt);
@@ -204,7 +206,12 @@
204206 this->molecule->OutputMomenta();
205207 this->OutputLog(boost::format("%s%lf\n") % this->messageTime.c_str()
206208 % (dt*static_cast<double>(s+1)/Parameters::GetInstance()->GetFs2AU()));
209+ double ompEndTime = omp_get_wtime();
210+ this->OutputLog(boost::format("%s%lf%s\n") % this->messageOmpElapsedTimeEhrenStep
211+ % (ompEndTime - ompStartTime)
212+ % this->messageUnitSec.c_str() );
207213 this->OutputLog(boost::format("%s%d\n") % this->messageEndStepEhrenfest.c_str() % (s+1) );
214+
208215 }
209216 }
210217 catch(MolDSException ex){
@@ -296,6 +303,8 @@
296303 this->messageTotalEnergy = "\t\t\tTotal: ";
297304 this->messageErrorEnergy = "\t\t\tError: ";
298305 this->messageTime = "\tTime in [fs]: ";
306+ this->messageOmpElapsedTimeEhrenStep = "\tElapsed time(omp) for this Ehrenfest step = ";
307+ this->messageUnitSec = "[s].";
299308 }
300309
301310 double Ehrenfest::OutputEnergies(const MolDS_base::ElectronicStructure& electronicStructure, double elecNorm){
--- trunk/src/ehrenfest/Ehrenfest.h (revision 1837)
+++ trunk/src/ehrenfest/Ehrenfest.h (revision 1838)
@@ -51,6 +51,8 @@
5151 std::string messageTotalEnergy;
5252 std::string messageErrorEnergy;
5353 std::string messageTime;
54+ std::string messageOmpElapsedTimeEhrenStep;
55+ std::string messageUnitSec;
5456 std::string errorMessageNotEnebleTheoryType;
5557 std::string errorMessageTheoryType;
5658 MolDS_base::Molecule* molecule;
Show on old repository browser