--- trunk/src/profiling/mdProfile.cpp 2005/01/12 22:41:40 246 +++ trunk/src/profiling/mdProfile.cpp 2009/11/25 20:02:06 1390 @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. * * The University of Notre Dame grants you ("Licensee") a @@ -6,19 +6,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,6 +28,15 @@ * arising out of the use of or inability to use software, even if the * University of Notre Dame has been advised of the possibility of * such damages. + * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). + * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [4] Vardeman & Gezelter, in progress (2009). */ #include @@ -67,10 +67,10 @@ namespace mdProfileSpace { struct timeval startTime[N_PROFILES]; struct timeval endTime[N_PROFILES]; - double accumTime[N_PROFILES]; + RealType accumTime[N_PROFILES]; #ifdef IS_MPI - double globalTime[N_PROFILES]; + RealType globalTime[N_PROFILES]; #endif //is_mpi @@ -78,8 +78,8 @@ extern "C"{ extern "C"{ - void F90_FUNC(gettimes, GETTIMES)(double* forceTime, - double* commTime); + void FC_FUNC(gettimes, GETTIMES)(RealType* forceTime, + RealType* commTime); } @@ -118,15 +118,15 @@ void endProfile( proNames theProfile ){ void endProfile( proNames theProfile ){ struct timezone tz; - double startVal, endVal; + RealType startVal, endVal; gettimeofday( &endTime[theProfile], &tz ); - startVal = (double)startTime[theProfile].tv_sec - + (double)startTime[theProfile].tv_usec / 1000000.0; + startVal = (RealType)startTime[theProfile].tv_sec + + (RealType)startTime[theProfile].tv_usec / 1000000.0; - endVal = (double)endTime[theProfile].tv_sec - + (double)endTime[theProfile].tv_usec / 1000000.0; + endVal = (RealType)endTime[theProfile].tv_sec + + (RealType)endTime[theProfile].tv_usec / 1000000.0; accumTime[theProfile] += endVal - startVal; } @@ -135,25 +135,25 @@ void writeProfiles( void ){ void writeProfiles( void ){ int i; - double totalTime; - double percentTime[N_PROFILES]; + RealType totalTime; + RealType percentTime[N_PROFILES]; int days, hours, minutes, secs, msecs; - double donkey; + RealType donkey; - double forceTime, commTime; + RealType forceTime, commTime; #ifdef IS_MPI int j; MPI_Status istatus; - double nodeTime, nodeForceTime, nodeCommTime; - double nodeAccum[N_PROFILES]; - double nodePercent[N_PROFILES]; + RealType nodeTime, nodeForceTime, nodeCommTime; + RealType nodeAccum[N_PROFILES]; + RealType nodePercent[N_PROFILES]; - double globalTime, globalForceTime, globalCommTime; - double globalAccum[N_PROFILES]; - double globalPercent[N_PROFILES]; + RealType globalTime, globalForceTime, globalCommTime; + RealType globalAccum[N_PROFILES]; + RealType globalPercent[N_PROFILES]; #endif // is_mpi @@ -191,7 +191,7 @@ void writeProfiles( void ){ secs = (int)donkey; msecs = (int)( (donkey - secs) * 1000 ); - F90_FUNC(gettimes, GETTIMES)(&forceTime, &commTime); + FC_FUNC(gettimes, GETTIMES)(&forceTime, &commTime); fprintf( stdout, "----------------------------------------------------------------------------\n" @@ -211,8 +211,8 @@ void writeProfiles( void ){ if( worldRank == 0 ){ - double *nodeTots = new double[mpiSim->getNProcessors()]; - double *nodePercentTots = new double[mpiSim->getNProcessors()]; + RealType *nodeTots = new RealType[mpiSim->getNProcessors()]; + RealType *nodePercentTots = new RealType[mpiSim->getNProcessors()]; totalTime = 0.0; for(i=0;i