diff --git a/gromacs/includes/util.h b/gromacs/includes/util.h index 5adabe2..3da0bfc 100644 --- a/gromacs/includes/util.h +++ b/gromacs/includes/util.h @@ -24,22 +24,31 @@ #define __UTIL_H_ #ifndef MIN -#define MIN(x,y) ((x)<(y)?(x):(y)) +# define MIN(x,y) ((x)<(y)?(x):(y)) #endif + #ifndef MAX -#define MAX(x,y) ((x)>(y)?(x):(y)) +# define MAX(x,y) ((x)>(y)?(x):(y)) #endif + #ifndef ABS -#define ABS(a) ((a) >= 0 ? (a) : -(a)) +# define ABS(a) ((a) >= 0 ? (a) : -(a)) #endif + #ifdef DEBUG -#define DEBUG_MESSAGE printf +# define DEBUG_MESSAGE printf #else -#define DEBUG_MESSAGE +# define DEBUG_MESSAGE #endif #ifndef MAXLINE -#define MAXLINE 4096 +# define MAXLINE 4096 +#endif + +#if PRECISION == 1 +# define PRECISION_STRING "single" +#else +# define PRECISION_STRING "double" #endif #define FF_LJ 0 diff --git a/gromacs/main.c b/gromacs/main.c index 47d587f..82df629 100644 --- a/gromacs/main.c +++ b/gromacs/main.c @@ -253,12 +253,13 @@ int main(int argc, char** argv) { param.cutneigh = param.cutforce + param.skin; setup(¶m, &eam, &atom, &neighbor, &stats); printParameter(¶m); + printf(HLINE); printf("step\ttemp\t\tpressure\n"); computeThermo(0, ¶m, &atom); -#if defined(MEM_TRACER) || defined(INDEX_TRACER) + #if defined(MEM_TRACER) || defined(INDEX_TRACER) traceAddresses(¶m, &atom, &neighbor, n + 1); -#endif + #endif if(param.force_field == FF_EAM) { timer[FORCE] = computeForceEam(&eam, ¶m, &atom, &neighbor, &stats); } else { @@ -289,9 +290,9 @@ int main(int argc, char** argv) { timer[NEIGH] += reneighbour(¶m, &atom, &neighbor); } -#if defined(MEM_TRACER) || defined(INDEX_TRACER) + #if defined(MEM_TRACER) || defined(INDEX_TRACER) traceAddresses(¶m, &atom, &neighbor, n + 1); -#endif + #endif if(param.force_field == FF_EAM) { timer[FORCE] += computeForceEam(&eam, ¶m, &atom, &neighbor, &stats); @@ -326,14 +327,6 @@ int main(int argc, char** argv) { xtc_end(); } - printf(HLINE); - printf("Kernel: %s, MxN: %dx%d, Vector width: %d\n", KERNEL_NAME, CLUSTER_M, CLUSTER_N, VECTOR_WIDTH); - printf("Data layout for positions: %s\n", POS_DATA_LAYOUT); -#if PRECISION == 1 - printf("Using single precision floating point.\n"); -#else - printf("Using double precision floating point.\n"); -#endif printf(HLINE); printf("System: %d atoms %d ghost atoms, Steps: %d\n", atom.Natoms, atom.Nghost, param.ntimes); printf("TOTAL %.2fs FORCE %.2fs NEIGH %.2fs REST %.2fs\n", @@ -341,9 +334,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 COMPUTE_STATS + #ifdef COMPUTE_STATS displayStatistics(&atom, ¶m, &stats, timer); -#endif + #endif LIKWID_MARKER_CLOSE; return EXIT_SUCCESS; } diff --git a/gromacs/parameter.c b/gromacs/parameter.c index 288657e..8e598f2 100644 --- a/gromacs/parameter.c +++ b/gromacs/parameter.c @@ -24,6 +24,7 @@ #include #include //--- +#include #include #include @@ -136,6 +137,9 @@ void printParameter(Parameter *param) { } printf("\tForce field: %s\n", ff2str(param->force_field)); + printf("\tKernel: %s, MxN: %dx%d, Vector width: %d\n", KERNEL_NAME, CLUSTER_M, CLUSTER_N, VECTOR_WIDTH); + printf("\tData layout: %s\n", POS_DATA_LAYOUT); + printf("\tFloating-point precision: %s\n", PRECISION_STRING); printf("\tUnit cells (nx, ny, nz): %d, %d, %d\n", param->nx, param->ny, param->nz); printf("\tDomain box sizes (x, y, z): %e, %e, %e\n", param->xprd, param->yprd, param->zprd); printf("\tLattice size: %e\n", param->lattice); @@ -155,5 +159,5 @@ void printParameter(Parameter *param) { printf("\tCutoff radius: %e\n", param->cutforce); printf("\tSkin: %e\n", param->skin); printf("\tHalf neighbor lists: %d\n", param->half_neigh); - printf("\tProcessor frequency (GHz): %.4f\n\n", param->proc_freq); + printf("\tProcessor frequency (GHz): %.4f\n", param->proc_freq); }