--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/10/29 00:19:10 837 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2004/01/13 15:46:49 929 @@ -7,6 +7,10 @@ #include #endif //is_mpi +#ifdef PROFILE +#include "mdProfile.hpp" +#endif // profile + #include "Integrator.hpp" #include "simError.h" @@ -182,7 +186,7 @@ template void Integrator::integrate(voi calcForce(1, 1); constrainB(); } - + if (info->setTemp){ thermalize(); } @@ -198,7 +202,6 @@ template void Integrator::integrate(voi statOut->writeStat(info->getTime()); - #ifdef IS_MPI strcpy(checkPointMsg, "The integrator is ready to go."); MPIcheckPoint(); @@ -210,8 +213,18 @@ template void Integrator::integrate(voi calcStress = 1; } +#ifdef PROFILE + startProfile( pro1 ); +#endif + integrateStep(calcPot, calcStress); +#ifdef PROFILE + endProfile( pro1 ); + + startProfile( pro2 ); +#endif // profile + info->incrTime(dt); if (info->setTemp){ @@ -239,6 +252,10 @@ template void Integrator::integrate(voi currReset += resetTime; } } + +#ifdef PROFILE + endProfile( pro2 ); +#endif //profile #ifdef IS_MPI strcpy(checkPointMsg, "successfully took a time step."); @@ -246,10 +263,6 @@ template void Integrator::integrate(voi #endif // is_mpi } - - // write the last frame - dumpOut->writeDump(info->getTime()); - delete dumpOut; delete statOut; } @@ -257,13 +270,28 @@ template void Integrator::integrateStep template void Integrator::integrateStep(int calcPot, int calcStress){ // Position full step, and velocity half step + +#ifdef PROFILE + startProfile(pro3); +#endif //profile + preMove(); - moveA(); +#ifdef PROFILE + endProfile(pro3); + startProfile(pro4); +#endif // profile + moveA(); +#ifdef PROFILE + endProfile(pro4); + + startProfile(pro5); +#endif//profile + #ifdef IS_MPI strcpy(checkPointMsg, "Succesful moveA\n"); MPIcheckPoint(); @@ -278,13 +306,20 @@ template void Integrator::integrateStep strcpy(checkPointMsg, "Succesful doForces\n"); MPIcheckPoint(); #endif // is_mpi + +#ifdef PROFILE + endProfile( pro5 ); + startProfile( pro6 ); +#endif //profile // finish the velocity half step moveB(); - +#ifdef PROFILE + endProfile(pro6); +#endif // profile #ifdef IS_MPI strcpy(checkPointMsg, "Succesful moveB\n");