move fftw_cleanup() into LAMMPS::cleanup()

This commit is contained in:
Christoph Junghans
2020-05-15 13:30:55 -06:00
parent 20ad924a54
commit 58b304be62
3 changed files with 17 additions and 14 deletions

View File

@ -19,10 +19,6 @@
#include <fenv.h>
#endif
#ifdef FFT_FFTW3
#include <fftw3.h>
#endif
#if defined(LAMMPS_EXCEPTIONS)
#include "exceptions.h"
#endif
@ -63,18 +59,9 @@ int main(int argc, char **argv)
#else
LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD);
lammps->input->file();
lammps->cleanup();
delete lammps;
#endif
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
#ifdef FFT_FFTW3
// tell fftw3 to delete its global memory pool
// and thus avoid bogus valgrind memory leak reports
#ifdef FFT_SINGLE
fftwf_cleanup();
#else
fftw_cleanup();
#endif
#endif
}