--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/10/29 17:55:28 841 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2004/02/06 21:37:59 1035 @@ -7,6 +7,10 @@ #include #endif //is_mpi +#ifdef PROFILE +#include "mdProfile.hpp" +#endif // profile + #include "Integrator.hpp" #include "simError.h" @@ -131,7 +135,7 @@ template void Integrator::checkConstrai } - // save oldAtoms to check for lode balanceing later on. + // save oldAtoms to check for lode balancing later on. oldAtoms = nAtoms; @@ -174,20 +178,18 @@ template void Integrator::integrate(voi // initialize the forces before the first step - std::cerr << "Before initial Force calc\n"; - calcForce(1, 1); + //temp test + tStats->getPotential(); + if (nConstrained){ preMove(); constrainA(); calcForce(1, 1); constrainB(); - std::cerr << "premove done\n"; } - - - + if (info->setTemp){ thermalize(); } @@ -203,7 +205,6 @@ template void Integrator::integrate(voi statOut->writeStat(info->getTime()); - #ifdef IS_MPI strcpy(checkPointMsg, "The integrator is ready to go."); MPIcheckPoint(); @@ -215,8 +216,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,8 +255,10 @@ template void Integrator::integrate(voi currReset += resetTime; } } - - std::cerr << "done with time = " << info->getTime() << "\n"; + +#ifdef PROFILE + endProfile( pro2 ); +#endif //profile #ifdef IS_MPI strcpy(checkPointMsg, "successfully took a time step."); @@ -253,10 +266,6 @@ template void Integrator::integrate(voi #endif // is_mpi } - - // write the last frame - dumpOut->writeDump(info->getTime()); - delete dumpOut; delete statOut; } @@ -264,13 +273,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(); @@ -286,12 +310,19 @@ template void Integrator::integrateStep 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");