Merge pull request #1908 from stanmoore1/kk_finalize
Finalize Kokkos on error exit
This commit is contained in:
@ -61,6 +61,11 @@ class KokkosLMP {
|
|||||||
int neigh_count(int) {return 0;}
|
int neigh_count(int) {return 0;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Kokkos {
|
||||||
|
public:
|
||||||
|
static void finalize() {}
|
||||||
|
};
|
||||||
|
|
||||||
class AtomKokkos : public Atom {
|
class AtomKokkos : public Atom {
|
||||||
public:
|
public:
|
||||||
tagint **k_special;
|
tagint **k_special;
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
#include "universe.h"
|
#include "universe.h"
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
#include "accelerator_kokkos.h"
|
||||||
|
|
||||||
#if defined(LAMMPS_EXCEPTIONS)
|
#if defined(LAMMPS_EXCEPTIONS)
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
@ -83,6 +84,7 @@ void Error::universe_all(const char *file, int line, const char *str)
|
|||||||
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
|
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
|
||||||
throw LAMMPSException(msg);
|
throw LAMMPSException(msg);
|
||||||
#else
|
#else
|
||||||
|
if (lmp->kokkos) Kokkos::finalize();
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
@ -173,6 +175,7 @@ void Error::all(const char *file, int line, const char *str)
|
|||||||
if (logfile) fclose(logfile);
|
if (logfile) fclose(logfile);
|
||||||
|
|
||||||
if (universe->nworlds > 1) MPI_Abort(universe->uworld,1);
|
if (universe->nworlds > 1) MPI_Abort(universe->uworld,1);
|
||||||
|
if (lmp->kokkos) Kokkos::finalize();
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
exit(1);
|
exit(1);
|
||||||
#endif
|
#endif
|
||||||
@ -259,6 +262,7 @@ void Error::done(int status)
|
|||||||
if (screen && screen != stdout) fclose(screen);
|
if (screen && screen != stdout) fclose(screen);
|
||||||
if (logfile) fclose(logfile);
|
if (logfile) fclose(logfile);
|
||||||
|
|
||||||
|
if (lmp->kokkos) Kokkos::finalize();
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
exit(status);
|
exit(status);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user