Introduce separate version for traced force routine.
This commit is contained in:
17
src/main.c
17
src/main.c
@@ -42,7 +42,8 @@
|
||||
|
||||
#define HLINE "----------------------------------------------------------------------------\n"
|
||||
|
||||
extern double computeForce(Parameter*, Atom*, Neighbor*, Stats*, int, int);
|
||||
extern double computeForce(Parameter*, Atom*, Neighbor*);
|
||||
extern double computeForceTracing(Parameter*, Atom*, Neighbor*, Stats*, int, int);
|
||||
|
||||
void init(Parameter *param)
|
||||
{
|
||||
@@ -211,7 +212,11 @@ int main (int argc, char** argv)
|
||||
|
||||
setup(¶m, &atom, &neighbor, &stats);
|
||||
computeThermo(0, ¶m, &atom);
|
||||
computeForce(¶m, &atom, &neighbor, &stats, 1, 0);
|
||||
#if defined(MEM_TRACER) || defined(INDEX_TRACER) || defined(PRINT_STATS)
|
||||
computeForceTracing(¶m, &atom, &neighbor, &stats, 1, 0);
|
||||
#else
|
||||
computeForce(¶m, &atom, &neighbor);
|
||||
#endif
|
||||
|
||||
timer[FORCE] = 0.0;
|
||||
timer[NEIGH] = 0.0;
|
||||
@@ -226,7 +231,11 @@ int main (int argc, char** argv)
|
||||
timer[NEIGH] += reneighbour(¶m, &atom, &neighbor);
|
||||
}
|
||||
|
||||
timer[FORCE] += computeForce(¶m, &atom, &neighbor, &stats, 0, n + 1);
|
||||
#if defined(MEM_TRACER) || defined(INDEX_TRACER) || defined(PRINT_STATS)
|
||||
timer[FORCE] += computeForceTracing(¶m, &atom, &neighbor, &stats, 0, n + 1);
|
||||
#else
|
||||
timer[FORCE] += computeForce(¶m, &atom, &neighbor);
|
||||
#endif
|
||||
finalIntegrate(¶m, &atom);
|
||||
|
||||
if(!((n + 1) % param.nstat) && (n+1) < param.ntimes) {
|
||||
@@ -251,7 +260,9 @@ int main (int argc, char** argv)
|
||||
printf(HLINE);
|
||||
printf("Performance: %.2f million atom updates per second\n",
|
||||
1e-6 * (double) atom.Natoms * param.ntimes / timer[TOTAL]);
|
||||
#ifdef PRINT_STATS
|
||||
displayStatistics(&atom, ¶m, &stats, timer);
|
||||
#endif
|
||||
LIKWID_MARKER_CLOSE;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user