2020-08-11 16:34:22 +02:00
|
|
|
/*
|
|
|
|
* =======================================================================================
|
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* Author: Jan Eitzinger (je), jan.eitzinger@fau.de
|
|
|
|
* Copyright (c) 2020 RRZE, University Erlangen-Nuremberg
|
2020-08-11 16:34:22 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* This file is part of MD-Bench.
|
2020-08-11 16:34:22 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* MD-Bench is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published
|
|
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2020-08-11 16:34:22 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* MD-Bench is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
|
|
|
* details.
|
2020-08-11 16:34:22 +02:00
|
|
|
*
|
2020-08-19 10:47:40 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
* with MD-Bench. If not, see <https://www.gnu.org/licenses/>.
|
2020-08-11 16:34:22 +02:00
|
|
|
* =======================================================================================
|
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
2022-03-05 03:21:52 +01:00
|
|
|
//--
|
2020-11-05 12:41:44 +01:00
|
|
|
#include <likwid-marker.h>
|
2022-03-05 03:21:52 +01:00
|
|
|
//--
|
2020-08-19 09:00:35 +02:00
|
|
|
#include <timing.h>
|
2020-08-18 14:27:28 +02:00
|
|
|
#include <allocate.h>
|
|
|
|
#include <neighbor.h>
|
|
|
|
#include <parameter.h>
|
|
|
|
#include <atom.h>
|
2021-10-12 15:04:08 +02:00
|
|
|
#include <stats.h>
|
2020-08-18 14:27:28 +02:00
|
|
|
#include <thermo.h>
|
|
|
|
#include <pbc.h>
|
2021-10-12 22:39:54 +02:00
|
|
|
#include <timers.h>
|
2021-10-26 00:40:39 +02:00
|
|
|
#include <eam.h>
|
2021-10-29 16:52:19 +02:00
|
|
|
#include <vtk.h>
|
2022-03-02 23:12:04 +01:00
|
|
|
#include <xtc.h>
|
2021-12-01 00:07:45 +01:00
|
|
|
#include <util.h>
|
2020-08-18 14:27:28 +02:00
|
|
|
|
2020-08-11 16:34:22 +02:00
|
|
|
#define HLINE "----------------------------------------------------------------------------\n"
|
|
|
|
|
2022-02-02 18:00:44 +01:00
|
|
|
extern double computeForceLJ_ref(Parameter*, Atom*, Neighbor*, Stats*);
|
|
|
|
extern double computeForceLJ_4xn(Parameter*, Atom*, Neighbor*, Stats*);
|
2021-12-01 00:07:45 +01:00
|
|
|
extern double computeForceEam(Eam*, Parameter*, Atom*, Neighbor*, Stats*);
|
2020-08-14 08:32:36 +02:00
|
|
|
|
2022-02-02 18:00:44 +01:00
|
|
|
#ifdef USE_REFERENCE_VERSION
|
|
|
|
# define computeForceLJ computeForceLJ_ref
|
|
|
|
#else
|
|
|
|
# define computeForceLJ computeForceLJ_4xn
|
|
|
|
#endif
|
|
|
|
|
2022-01-31 17:49:22 +01:00
|
|
|
double setup(Parameter *param, Eam *eam, Atom *atom, Neighbor *neighbor, Stats *stats) {
|
2021-10-29 16:52:19 +02:00
|
|
|
if(param->force_field == FF_EAM) { initEam(eam, param); }
|
2020-08-19 09:22:43 +02:00
|
|
|
double S, E;
|
2021-03-30 01:54:56 +02:00
|
|
|
param->lattice = pow((4.0 / param->rho), (1.0 / 3.0));
|
|
|
|
param->xprd = param->nx * param->lattice;
|
|
|
|
param->yprd = param->ny * param->lattice;
|
|
|
|
param->zprd = param->nz * param->lattice;
|
2020-08-19 09:22:43 +02:00
|
|
|
|
|
|
|
S = getTimeStamp();
|
2020-08-19 09:00:35 +02:00
|
|
|
initAtom(atom);
|
2021-11-03 00:57:24 +01:00
|
|
|
initPbc(atom);
|
2021-10-12 15:04:08 +02:00
|
|
|
initStats(stats);
|
2021-11-30 01:33:55 +01:00
|
|
|
initNeighbor(neighbor, param);
|
2022-01-31 17:49:22 +01:00
|
|
|
|
2021-11-30 01:33:55 +01:00
|
|
|
if(param->input_file == NULL) {
|
|
|
|
createAtom(atom, param);
|
|
|
|
} else {
|
|
|
|
readAtom(atom, param);
|
|
|
|
}
|
2022-01-31 17:49:22 +01:00
|
|
|
|
2022-01-27 03:07:31 +01:00
|
|
|
setupNeighbor(param, atom);
|
2020-08-19 09:00:35 +02:00
|
|
|
setupThermo(param, atom->Natoms);
|
2021-11-30 01:33:55 +01:00
|
|
|
if(param->input_file == NULL) { adjustThermo(param, atom); }
|
2022-01-27 03:07:31 +01:00
|
|
|
buildClusters(atom);
|
2020-08-19 09:00:35 +02:00
|
|
|
setupPbc(atom, param);
|
2022-01-27 03:07:31 +01:00
|
|
|
binClusters(atom);
|
|
|
|
buildNeighbor(atom, neighbor);
|
2020-08-19 09:22:43 +02:00
|
|
|
E = getTimeStamp();
|
|
|
|
return E-S;
|
|
|
|
}
|
|
|
|
|
2022-01-31 17:49:22 +01:00
|
|
|
double reneighbour(Parameter *param, Atom *atom, Neighbor *neighbor) {
|
2020-08-19 09:22:43 +02:00
|
|
|
double S, E;
|
|
|
|
S = getTimeStamp();
|
2020-11-05 12:41:44 +01:00
|
|
|
LIKWID_MARKER_START("reneighbour");
|
2022-01-27 03:07:31 +01:00
|
|
|
updateSingleAtoms(atom);
|
2020-08-19 09:22:43 +02:00
|
|
|
updateAtomsPbc(atom, param);
|
2022-01-27 03:07:31 +01:00
|
|
|
buildClusters(atom);
|
2020-08-19 09:22:43 +02:00
|
|
|
setupPbc(atom, param);
|
2022-01-27 03:07:31 +01:00
|
|
|
binClusters(atom);
|
|
|
|
buildNeighbor(atom, neighbor);
|
2020-11-05 12:41:44 +01:00
|
|
|
LIKWID_MARKER_STOP("reneighbour");
|
2020-08-19 09:22:43 +02:00
|
|
|
E = getTimeStamp();
|
|
|
|
return E-S;
|
2020-08-19 09:00:35 +02:00
|
|
|
}
|
|
|
|
|
2022-01-28 18:07:41 +01:00
|
|
|
void initialIntegrate(Parameter *param, Atom *atom) {
|
2022-02-01 20:16:04 +01:00
|
|
|
DEBUG_MESSAGE("initialIntegrate start\n");
|
|
|
|
|
2022-01-28 18:07:41 +01:00
|
|
|
for(int ci = 0; ci < atom->Nclusters_local; ci++) {
|
2022-03-09 17:23:49 +01:00
|
|
|
int ci_vec_base = CI_VECTOR_BASE_INDEX(ci);
|
|
|
|
MD_FLOAT *ci_x = &atom->cl_x[ci_vec_base];
|
|
|
|
MD_FLOAT *ci_v = &atom->cl_v[ci_vec_base];
|
|
|
|
MD_FLOAT *ci_f = &atom->cl_f[ci_vec_base];
|
|
|
|
|
|
|
|
for(int cii = 0; cii < atom->iclusters[ci].natoms; cii++) {
|
|
|
|
ci_v[CL_X_OFFSET + cii] += param->dtforce * ci_f[CL_X_OFFSET + cii];
|
|
|
|
ci_v[CL_Y_OFFSET + cii] += param->dtforce * ci_f[CL_Y_OFFSET + cii];
|
|
|
|
ci_v[CL_Z_OFFSET + cii] += param->dtforce * ci_f[CL_Z_OFFSET + cii];
|
|
|
|
ci_x[CL_X_OFFSET + cii] += param->dt * ci_v[CL_X_OFFSET + cii];
|
|
|
|
ci_x[CL_Y_OFFSET + cii] += param->dt * ci_v[CL_Y_OFFSET + cii];
|
|
|
|
ci_x[CL_Z_OFFSET + cii] += param->dt * ci_v[CL_Z_OFFSET + cii];
|
2022-01-28 18:07:41 +01:00
|
|
|
}
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
2022-02-01 20:16:04 +01:00
|
|
|
|
|
|
|
DEBUG_MESSAGE("initialIntegrate end\n");
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
2022-01-28 18:07:41 +01:00
|
|
|
void finalIntegrate(Parameter *param, Atom *atom) {
|
2022-02-01 20:16:04 +01:00
|
|
|
DEBUG_MESSAGE("finalIntegrate start\n");
|
|
|
|
|
2022-01-28 18:07:41 +01:00
|
|
|
for(int ci = 0; ci < atom->Nclusters_local; ci++) {
|
2022-03-09 17:23:49 +01:00
|
|
|
int ci_vec_base = CI_VECTOR_BASE_INDEX(ci);
|
|
|
|
MD_FLOAT *ci_v = &atom->cl_v[ci_vec_base];
|
|
|
|
MD_FLOAT *ci_f = &atom->cl_f[ci_vec_base];
|
|
|
|
|
|
|
|
for(int cii = 0; cii < atom->iclusters[ci].natoms; cii++) {
|
|
|
|
ci_v[CL_X_OFFSET + cii] += param->dtforce * ci_f[CL_X_OFFSET + cii];
|
|
|
|
ci_v[CL_Y_OFFSET + cii] += param->dtforce * ci_f[CL_Y_OFFSET + cii];
|
|
|
|
ci_v[CL_Z_OFFSET + cii] += param->dtforce * ci_f[CL_Z_OFFSET + cii];
|
2022-01-28 18:07:41 +01:00
|
|
|
}
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
2022-02-01 20:16:04 +01:00
|
|
|
|
|
|
|
DEBUG_MESSAGE("finalIntegrate end\n");
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
2022-01-31 17:49:22 +01:00
|
|
|
void printAtomState(Atom *atom) {
|
2020-08-18 14:27:28 +02:00
|
|
|
printf("Atom counts: Natoms=%d Nlocal=%d Nghost=%d Nmax=%d\n",
|
|
|
|
atom->Natoms, atom->Nlocal, atom->Nghost, atom->Nmax);
|
|
|
|
|
2021-10-26 09:16:31 +02:00
|
|
|
/* int nall = atom->Nlocal + atom->Nghost; */
|
2020-08-18 14:27:28 +02:00
|
|
|
|
2021-10-26 09:16:31 +02:00
|
|
|
/* for (int i=0; i<nall; i++) { */
|
|
|
|
/* printf("%d %f %f %f\n", i, atom->x[i], atom->y[i], atom->z[i]); */
|
|
|
|
/* } */
|
2020-08-18 14:27:28 +02:00
|
|
|
}
|
|
|
|
|
2022-01-31 17:49:22 +01:00
|
|
|
int main(int argc, char** argv) {
|
2020-08-19 09:00:35 +02:00
|
|
|
double timer[NUMTIMER];
|
2021-10-26 00:40:39 +02:00
|
|
|
Eam eam;
|
2020-08-18 14:27:28 +02:00
|
|
|
Atom atom;
|
2020-08-11 16:34:22 +02:00
|
|
|
Neighbor neighbor;
|
2021-10-12 15:04:08 +02:00
|
|
|
Stats stats;
|
2020-08-11 16:34:22 +02:00
|
|
|
Parameter param;
|
|
|
|
|
2020-11-05 12:41:44 +01:00
|
|
|
LIKWID_MARKER_INIT;
|
|
|
|
#pragma omp parallel
|
|
|
|
{
|
|
|
|
LIKWID_MARKER_REGISTER("force");
|
2021-07-16 00:24:43 +02:00
|
|
|
//LIKWID_MARKER_REGISTER("reneighbour");
|
|
|
|
//LIKWID_MARKER_REGISTER("pbc");
|
2020-11-05 12:41:44 +01:00
|
|
|
}
|
2020-08-19 09:00:35 +02:00
|
|
|
|
2022-03-05 03:21:52 +01:00
|
|
|
initParameter(¶m);
|
|
|
|
for(int i = 0; i < argc; i++) {
|
|
|
|
if((strcmp(argv[i], "-p") == 0)) {
|
|
|
|
readParameter(¶m, argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-f") == 0)) {
|
2021-10-26 00:40:39 +02:00
|
|
|
if((param.force_field = str2ff(argv[++i])) < 0) {
|
|
|
|
fprintf(stderr, "Invalid force field!\n");
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-i") == 0)) {
|
2021-10-26 00:40:39 +02:00
|
|
|
param.input_file = strdup(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-e") == 0)) {
|
2021-11-30 01:33:55 +01:00
|
|
|
param.eam_file = strdup(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-n") == 0) || (strcmp(argv[i], "--nsteps") == 0)) {
|
2020-08-19 09:00:35 +02:00
|
|
|
param.ntimes = atoi(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-nx") == 0)) {
|
2020-08-19 09:00:35 +02:00
|
|
|
param.nx = atoi(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-ny") == 0)) {
|
2020-08-19 09:00:35 +02:00
|
|
|
param.ny = atoi(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-nz") == 0)) {
|
2020-08-19 09:00:35 +02:00
|
|
|
param.nz = atoi(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-03-03 20:03:33 +01:00
|
|
|
if((strcmp(argv[i], "-m") == 0) || (strcmp(argv[i], "--mass") == 0)) {
|
|
|
|
param.mass = atof(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-r") == 0) || (strcmp(argv[i], "--radius") == 0)) {
|
|
|
|
param.cutforce = atof(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if((strcmp(argv[i], "-s") == 0) || (strcmp(argv[i], "--skin") == 0)) {
|
|
|
|
param.skin = atof(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if((strcmp(argv[i], "--freq") == 0)) {
|
2021-10-12 15:04:08 +02:00
|
|
|
param.proc_freq = atof(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "--vtk") == 0)) {
|
2021-10-29 16:52:19 +02:00
|
|
|
param.vtk_file = strdup(argv[++i]);
|
|
|
|
continue;
|
|
|
|
}
|
2022-03-02 23:12:04 +01:00
|
|
|
if((strcmp(argv[i], "--xtc") == 0)) {
|
|
|
|
#ifndef XTC_OUTPUT
|
|
|
|
fprintf(stderr, "XTC not available, set XTC_OUTPUT option in config.mk file and recompile MD-Bench!");
|
|
|
|
exit(-1);
|
|
|
|
#else
|
|
|
|
param.xtc_file = strdup(argv[++i]);
|
|
|
|
#endif
|
|
|
|
continue;
|
|
|
|
}
|
2022-02-28 22:34:42 +01:00
|
|
|
if((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0)) {
|
2020-08-19 09:00:35 +02:00
|
|
|
printf("MD Bench: A minimalistic re-implementation of miniMD\n");
|
|
|
|
printf(HLINE);
|
2022-03-05 03:21:52 +01:00
|
|
|
printf("-p <string>: file to read parameters from (can be specified more than once)\n");
|
2021-10-26 00:40:39 +02:00
|
|
|
printf("-f <string>: force field (lj or eam), default lj\n");
|
2021-11-30 01:33:55 +01:00
|
|
|
printf("-i <string>: input file with atom positions (dump)\n");
|
|
|
|
printf("-e <string>: input file for EAM\n");
|
2020-08-19 09:22:43 +02:00
|
|
|
printf("-n / --nsteps <int>: set number of timesteps for simulation\n");
|
|
|
|
printf("-nx/-ny/-nz <int>: set linear dimension of systembox in x/y/z direction\n");
|
2022-02-28 22:34:42 +01:00
|
|
|
printf("-r / --radius <real>: set cutoff radius\n");
|
|
|
|
printf("-s / --skin <real>: set skin (verlet buffer)\n");
|
2021-10-26 00:40:39 +02:00
|
|
|
printf("--freq <real>: processor frequency (GHz)\n");
|
2021-10-29 16:52:19 +02:00
|
|
|
printf("--vtk <string>: VTK file for visualization\n");
|
2022-03-02 23:12:04 +01:00
|
|
|
printf("--xtc <string>: XTC file for visualization\n");
|
2020-08-19 09:00:35 +02:00
|
|
|
printf(HLINE);
|
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-28 22:34:42 +01:00
|
|
|
param.cutneigh = param.cutforce + param.skin;
|
2021-10-26 00:40:39 +02:00
|
|
|
setup(¶m, &eam, &atom, &neighbor, &stats);
|
2022-03-05 03:21:52 +01:00
|
|
|
printParameter(¶m);
|
|
|
|
|
|
|
|
printf("step\ttemp\t\tpressure\n");
|
2020-08-18 14:27:28 +02:00
|
|
|
computeThermo(0, ¶m, &atom);
|
2021-12-01 00:07:45 +01:00
|
|
|
#if defined(MEM_TRACER) || defined(INDEX_TRACER)
|
|
|
|
traceAddresses(¶m, &atom, &neighbor, n + 1);
|
|
|
|
#endif
|
2021-10-26 00:40:39 +02:00
|
|
|
if(param.force_field == FF_EAM) {
|
2021-12-01 00:07:45 +01:00
|
|
|
timer[FORCE] = computeForceEam(&eam, ¶m, &atom, &neighbor, &stats);
|
2021-10-26 00:40:39 +02:00
|
|
|
} else {
|
2021-12-01 00:07:45 +01:00
|
|
|
timer[FORCE] = computeForceLJ(¶m, &atom, &neighbor, &stats);
|
2021-10-26 00:40:39 +02:00
|
|
|
}
|
2020-08-11 16:34:22 +02:00
|
|
|
|
2020-08-19 09:22:43 +02:00
|
|
|
timer[NEIGH] = 0.0;
|
|
|
|
timer[TOTAL] = getTimeStamp();
|
|
|
|
|
2021-10-29 16:52:19 +02:00
|
|
|
if(param.vtk_file != NULL) {
|
2022-02-08 16:12:22 +01:00
|
|
|
write_data_to_vtk_file(param.vtk_file, &atom, 0);
|
2021-10-29 16:52:19 +02:00
|
|
|
}
|
|
|
|
|
2022-03-02 23:12:04 +01:00
|
|
|
if(param.xtc_file != NULL) {
|
|
|
|
xtc_init(param.xtc_file, &atom, 0);
|
|
|
|
}
|
|
|
|
|
2020-08-11 16:34:22 +02:00
|
|
|
for(int n = 0; n < param.ntimes; n++) {
|
2022-01-28 18:07:41 +01:00
|
|
|
initialIntegrate(¶m, &atom);
|
2020-08-11 16:34:22 +02:00
|
|
|
|
2022-03-02 23:12:04 +01:00
|
|
|
if((n + 1) % param.reneigh_every) {
|
2022-02-28 17:20:39 +01:00
|
|
|
if(!((n + 1) % param.prune_every)) {
|
|
|
|
pruneNeighbor(¶m, &atom, &neighbor);
|
|
|
|
}
|
|
|
|
|
2022-01-31 17:49:22 +01:00
|
|
|
updatePbc(&atom, ¶m, 0);
|
2020-08-17 14:01:46 +02:00
|
|
|
} else {
|
2020-08-19 09:22:43 +02:00
|
|
|
timer[NEIGH] += reneighbour(¶m, &atom, &neighbor);
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
2021-12-01 00:07:45 +01:00
|
|
|
#if defined(MEM_TRACER) || defined(INDEX_TRACER)
|
|
|
|
traceAddresses(¶m, &atom, &neighbor, n + 1);
|
|
|
|
#endif
|
|
|
|
|
2021-10-26 00:40:39 +02:00
|
|
|
if(param.force_field == FF_EAM) {
|
2021-12-01 00:07:45 +01:00
|
|
|
timer[FORCE] += computeForceEam(&eam, ¶m, &atom, &neighbor, &stats);
|
2021-10-26 00:40:39 +02:00
|
|
|
} else {
|
2021-12-01 00:07:45 +01:00
|
|
|
timer[FORCE] += computeForceLJ(¶m, &atom, &neighbor, &stats);
|
2021-10-26 00:40:39 +02:00
|
|
|
}
|
2021-12-01 00:07:45 +01:00
|
|
|
|
2022-01-28 18:07:41 +01:00
|
|
|
finalIntegrate(¶m, &atom);
|
2020-08-11 16:34:22 +02:00
|
|
|
|
2020-08-17 14:01:46 +02:00
|
|
|
if(!((n + 1) % param.nstat) && (n+1) < param.ntimes) {
|
2020-08-18 14:27:28 +02:00
|
|
|
computeThermo(n + 1, ¶m, &atom);
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
2021-10-29 16:52:19 +02:00
|
|
|
|
2022-03-02 23:12:04 +01:00
|
|
|
int write_pos = !((n + 1) % param.x_out_every);
|
|
|
|
int write_vel = !((n + 1) % param.v_out_every);
|
|
|
|
if(write_pos || write_vel) {
|
|
|
|
if(param.vtk_file != NULL) {
|
|
|
|
write_data_to_vtk_file(param.vtk_file, &atom, n + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(param.xtc_file != NULL) {
|
|
|
|
xtc_write(&atom, n + 1, write_pos, write_vel);
|
|
|
|
}
|
2021-10-29 16:52:19 +02:00
|
|
|
}
|
2020-08-11 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
2020-08-19 09:22:43 +02:00
|
|
|
timer[TOTAL] = getTimeStamp() - timer[TOTAL];
|
2020-08-18 14:27:28 +02:00
|
|
|
computeThermo(-1, ¶m, &atom);
|
2020-08-12 15:38:08 +02:00
|
|
|
|
2022-03-02 23:12:04 +01:00
|
|
|
if(param.xtc_file != NULL) {
|
|
|
|
xtc_end();
|
|
|
|
}
|
|
|
|
|
2020-08-19 09:22:43 +02:00
|
|
|
printf(HLINE);
|
2021-03-22 21:51:47 +01:00
|
|
|
printf("Data layout for positions: %s\n", POS_DATA_LAYOUT);
|
2020-11-05 12:41:44 +01:00
|
|
|
#if PRECISION == 1
|
|
|
|
printf("Using single precision floating point.\n");
|
|
|
|
#else
|
|
|
|
printf("Using double precision floating point.\n");
|
|
|
|
#endif
|
|
|
|
printf(HLINE);
|
2020-08-19 10:00:19 +02:00
|
|
|
printf("System: %d atoms %d ghost atoms, Steps: %d\n", atom.Natoms, atom.Nghost, param.ntimes);
|
2020-08-19 09:22:43 +02:00
|
|
|
printf("TOTAL %.2fs FORCE %.2fs NEIGH %.2fs REST %.2fs\n",
|
|
|
|
timer[TOTAL], timer[FORCE], timer[NEIGH], timer[TOTAL]-timer[FORCE]-timer[NEIGH]);
|
|
|
|
printf(HLINE);
|
2020-08-19 10:00:19 +02:00
|
|
|
printf("Performance: %.2f million atom updates per second\n",
|
|
|
|
1e-6 * (double) atom.Natoms * param.ntimes / timer[TOTAL]);
|
2021-10-26 09:16:31 +02:00
|
|
|
#ifdef COMPUTE_STATS
|
2021-10-12 22:39:54 +02:00
|
|
|
displayStatistics(&atom, ¶m, &stats, timer);
|
2021-10-26 09:11:17 +02:00
|
|
|
#endif
|
2020-11-05 12:41:44 +01:00
|
|
|
LIKWID_MARKER_CLOSE;
|
2020-08-11 16:34:22 +02:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|