Enhance output for gromacs variant

Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
This commit is contained in:
Rafael Ravedutti 2022-08-16 19:32:49 +02:00
parent 911ba63336
commit 29fa08fa7f
3 changed files with 27 additions and 21 deletions

View File

@ -26,12 +26,15 @@
#ifndef MIN #ifndef MIN
# define MIN(x,y) ((x)<(y)?(x):(y)) # define MIN(x,y) ((x)<(y)?(x):(y))
#endif #endif
#ifndef MAX #ifndef MAX
# define MAX(x,y) ((x)>(y)?(x):(y)) # define MAX(x,y) ((x)>(y)?(x):(y))
#endif #endif
#ifndef ABS #ifndef ABS
# define ABS(a) ((a) >= 0 ? (a) : -(a)) # define ABS(a) ((a) >= 0 ? (a) : -(a))
#endif #endif
#ifdef DEBUG #ifdef DEBUG
# define DEBUG_MESSAGE printf # define DEBUG_MESSAGE printf
#else #else
@ -42,6 +45,12 @@
# define MAXLINE 4096 # define MAXLINE 4096
#endif #endif
#if PRECISION == 1
# define PRECISION_STRING "single"
#else
# define PRECISION_STRING "double"
#endif
#define FF_LJ 0 #define FF_LJ 0
#define FF_EAM 1 #define FF_EAM 1

View File

@ -253,6 +253,7 @@ int main(int argc, char** argv) {
param.cutneigh = param.cutforce + param.skin; param.cutneigh = param.cutforce + param.skin;
setup(&param, &eam, &atom, &neighbor, &stats); setup(&param, &eam, &atom, &neighbor, &stats);
printParameter(&param); printParameter(&param);
printf(HLINE);
printf("step\ttemp\t\tpressure\n"); printf("step\ttemp\t\tpressure\n");
computeThermo(0, &param, &atom); computeThermo(0, &param, &atom);
@ -326,14 +327,6 @@ int main(int argc, char** argv) {
xtc_end(); 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(HLINE);
printf("System: %d atoms %d ghost atoms, Steps: %d\n", atom.Natoms, atom.Nghost, param.ntimes); 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", printf("TOTAL %.2fs FORCE %.2fs NEIGH %.2fs REST %.2fs\n",

View File

@ -24,6 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
//--- //---
#include <atom.h>
#include <parameter.h> #include <parameter.h>
#include <util.h> #include <util.h>
@ -136,6 +137,9 @@ void printParameter(Parameter *param) {
} }
printf("\tForce field: %s\n", ff2str(param->force_field)); 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("\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("\tDomain box sizes (x, y, z): %e, %e, %e\n", param->xprd, param->yprd, param->zprd);
printf("\tLattice size: %e\n", param->lattice); printf("\tLattice size: %e\n", param->lattice);
@ -155,5 +159,5 @@ void printParameter(Parameter *param) {
printf("\tCutoff radius: %e\n", param->cutforce); printf("\tCutoff radius: %e\n", param->cutforce);
printf("\tSkin: %e\n", param->skin); printf("\tSkin: %e\n", param->skin);
printf("\tHalf neighbor lists: %d\n", param->half_neigh); 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);
} }