Unverified Commit ee10b200 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

Merge branch 'master' into write-bonus-data

parents 181b7cf3 438346a9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -123,6 +123,8 @@ void FixQEqReaxKokkos<DeviceType>::init()

  init_shielding_k();
  init_hist();

  last_allocate = -1;
}

/* ---------------------------------------------------------------------- */
@@ -216,8 +218,10 @@ void FixQEqReaxKokkos<DeviceType>::pre_force(int vflag)

  // get max number of neighbor

  if (!allocated_flag || update->ntimestep == neighbor->lastcall)
  if (!allocated_flag || last_allocate < neighbor->lastcall) {
    allocate_matrix();
    last_allocate = update->ntimestep;
  }

  // compute_H

@@ -1504,6 +1508,9 @@ int FixQEqReaxKokkos<DeviceType>::pack_exchange(int i, double *buf)
template<class DeviceType>
int FixQEqReaxKokkos<DeviceType>::unpack_exchange(int nlocal, double *buf)
{
  k_s_hist.template sync<LMPHostType>();
  k_t_hist.template sync<LMPHostType>();

  for (int m = 0; m < nprev; m++) s_hist[nlocal][m] = buf[m];
  for (int m = 0; m < nprev; m++) t_hist[nlocal][m] = buf[nprev+m];

+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ class FixQEqReaxKokkos : public FixQEqReax {

 private:
  int inum,ignum;
  int allocated_flag;
  int allocated_flag, last_allocate;
  int need_dup;

  typename AT::t_int_scalar d_mfill_offset;
+10 −0
Original line number Diff line number Diff line
@@ -22,9 +22,13 @@
#include "tbb/scalable_allocator.h"
#else
#include <cstring>
#if defined(__APPLE__)
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#endif
#endif

#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32)
#define LAMMPS_MEMALIGN 64
@@ -84,7 +88,13 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name)
  if (offset) {
    void *optr = ptr;
    ptr = smalloc(nbytes, name);
#if defined(__APPLE__)
    memcpy(ptr, optr, MIN(nbytes,malloc_size(optr)));
#elif defined(_WIN32) || defined(__MINGW32__)
    memcpy(ptr, optr, MIN(nbytes,_msize(optr)));
#else
    memcpy(ptr, optr, MIN(nbytes,malloc_usable_size(optr)));
#endif
    free(optr);
  }
#else