Merge pull request #3116 from akohlmey/build-kokkos-staticlib

Build KOKKOS package updates for Python module and Windows compatibility
This commit is contained in:
Axel Kohlmeyer
2022-02-07 16:36:46 -05:00
committed by GitHub
11 changed files with 52 additions and 50 deletions

View File

@ -600,7 +600,8 @@ void KokkosLMP::my_signal_handler(int sig)
{
if (sig == SIGSEGV) {
#if defined(_WIN32)
kill(_getpid(),SIGABRT);
// there is no kill() function on Windows
exit(1);
#else
kill(getpid(),SIGABRT);
#endif

View File

@ -17,9 +17,7 @@
------------------------------------------------------------------------- */
#include "pair_exp6_rx_kokkos.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "comm.h"
#include "force.h"
@ -28,12 +26,14 @@
#include "memory_kokkos.h"
#include "error.h"
#include "fix.h"
#include <cfloat>
#include "atom_masks.h"
#include "neigh_request.h"
#include "atom_kokkos.h"
#include "kokkos.h"
#include <cmath>
#include <cfloat>
#include <cstring>
#ifdef _OPENMP
#include <omp.h>
@ -57,22 +57,6 @@ using namespace MathSpecialKokkos;
#define exp6PotentialType (1)
#define isExp6PotentialType(_type) ( (_type) == exp6PotentialType )
namespace /* anonymous */
{
//typedef double TimerType;
//TimerType getTimeStamp(void) { return platform::walltime(); }
//double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; }
typedef struct timespec TimerType;
TimerType getTimeStamp(void) { TimerType tick; clock_gettime( CLOCK_MONOTONIC, &tick); return tick; }
double getElapsedTime( const TimerType &t0, const TimerType &t1)
{
return (t1.tv_sec - t0.tv_sec) + 1e-9*(t1.tv_nsec - t0.tv_nsec);
}
} // end namespace
/* ---------------------------------------------------------------------- */
template<class DeviceType>
@ -142,8 +126,6 @@ void PairExp6rxKokkos<DeviceType>::init_style()
template<class DeviceType>
void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
{
//TimerType t_start = getTimeStamp();
copymode = 1;
eflag = eflag_in;
@ -187,7 +169,6 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
// and ghost atoms. Make the parameter data persistent
// and exchange like any other atom property later.
//TimerType t_mix_start = getTimeStamp();
{
const int np_total = nlocal + atom->nghost;
@ -260,7 +241,6 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
error->all(FLERR,"Computed fraction less than -10*DBL_EPSILON");
#endif
}
//TimerType t_mix_stop = getTimeStamp();
k_error_flag.template modify<DeviceType>();
k_error_flag.template sync<LMPHostType>();
@ -377,9 +357,6 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
}
copymode = 0;
//TimerType t_stop = getTimeStamp();
//printf("PairExp6rxKokkos::compute %f %f\n", getElapsedTime(t_start, t_stop), getElapsedTime(t_mix_start, t_mix_stop));
}
template<class DeviceType>

View File

@ -2711,10 +2711,9 @@ void PPPMKokkos<DeviceType>::compute_rho_coeff()
{
int j,k,l,m;
FFT_SCALAR s;
//FFT_SCALAR **a;
//memory->create2d_offset(a,order,-order,order,"pppm:a");
FFT_SCALAR a[order][2*order+1];
FFT_SCALAR **a = new FFT_SCALAR *[order];
for (int i = 0; i < order; ++i)
a[i] = new FFT_SCALAR[2*order+1];
for (k = 0; k <= 2*order; k++)
for (l = 0; l < order; l++)
@ -2744,7 +2743,9 @@ void PPPMKokkos<DeviceType>::compute_rho_coeff()
h_rho_coeff(l,m-(1-order)/2) = a[l][k+order];
m++;
}
//memory->destroy2d_offset(a,-order);
for (int i = 0; i < order; ++i)
delete[] a[i];
delete[] a;
}
/* ----------------------------------------------------------------------