--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/10/29 17:55:28 841 +++ 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" @@ -174,8 +178,6 @@ template void Integrator::integrate(voi // initialize the forces before the first step - std::cerr << "Before initial Force calc\n"; - calcForce(1, 1); if (nConstrained){ @@ -183,11 +185,8 @@ template void Integrator::integrate(voi constrainA(); calcForce(1, 1); constrainB(); - std::cerr << "premove done\n"; } - - - + if (info->setTemp){ thermalize(); } @@ -203,7 +202,6 @@ template void Integrator::integrate(voi statOut->writeStat(info->getTime()); - #ifdef IS_MPI strcpy(checkPointMsg, "The integrator is ready to go."); MPIcheckPoint(); @@ -215,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){ @@ -244,18 +252,16 @@ template void Integrator::integrate(voi currReset += resetTime; } } + +#ifdef PROFILE + endProfile( pro2 ); +#endif //profile - std::cerr << "done with time = " << info->getTime() << "\n"; - #ifdef IS_MPI strcpy(checkPointMsg, "successfully took a time step."); MPIcheckPoint(); #endif // is_mpi } - - - // write the last frame - dumpOut->writeDump(info->getTime()); delete dumpOut; delete statOut; @@ -264,11 +270,26 @@ 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 @@ -285,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");