Fix memory issue in fix_nvt_sllod_kokkos
This commit is contained in:
@ -65,8 +65,6 @@ void FixNVTSllodKokkos<DeviceType>::init()
|
||||
{
|
||||
FixNHKokkos<DeviceType>::init();
|
||||
|
||||
vdelu = typename ArrayTypes<DeviceType>::t_v_array("nvt/sllod/kk:vdelu", atomKK->nlocal);
|
||||
|
||||
if (!this->temperature->tempbias)
|
||||
this->error->all(FLERR,"Temperature for fix nvt/sllod does not have a bias");
|
||||
|
||||
@ -100,7 +98,7 @@ void FixNVTSllodKokkos<DeviceType>::nh_v_temp()
|
||||
// calculate temperature since some computes require temp
|
||||
// computed on current nlocal atoms to remove bias
|
||||
|
||||
if (nondeformbias){
|
||||
if (nondeformbias) {
|
||||
atomKK->sync(this->temperature->execution_space,this->temperature->datamask_read);
|
||||
this->temperature->compute_scalar();
|
||||
atomKK->modified(this->temperature->execution_space,this->temperature->datamask_modify);
|
||||
@ -115,6 +113,9 @@ void FixNVTSllodKokkos<DeviceType>::nh_v_temp()
|
||||
|
||||
d_h_two = Few<double, 6>(h_two);
|
||||
|
||||
if (vdelu.extent(0) < atomKK->nmax)
|
||||
vdelu = typename AT::t_v_array(Kokkos::NoInit("nvt/sllod/kk:vdelu"), atomKK->nmax);
|
||||
|
||||
this->copymode = 1;
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNVTSllod_temp1>(0,nlocal),*this);
|
||||
this->copymode = 0;
|
||||
|
||||
@ -35,6 +35,9 @@ struct TagFixNVTSllod_temp2{};
|
||||
template<class DeviceType>
|
||||
class FixNVTSllodKokkos : public FixNHKokkos<DeviceType> {
|
||||
public:
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
||||
FixNVTSllodKokkos(class LAMMPS *, int, char **);
|
||||
~FixNVTSllodKokkos() {}
|
||||
void init();
|
||||
@ -51,14 +54,14 @@ class FixNVTSllodKokkos : public FixNHKokkos<DeviceType> {
|
||||
void nh_v_temp();
|
||||
|
||||
protected:
|
||||
typename ArrayTypes<DeviceType>::t_x_array x;
|
||||
typename ArrayTypes<DeviceType>::t_v_array v;
|
||||
typename ArrayTypes<DeviceType>::t_v_array vdelu;
|
||||
typename ArrayTypes<DeviceType>::t_f_array_const f;
|
||||
typename ArrayTypes<DeviceType>::t_float_1d rmass;
|
||||
typename ArrayTypes<DeviceType>::t_float_1d mass;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d type;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d mask;
|
||||
typename AT::t_x_array x;
|
||||
typename AT::t_v_array v;
|
||||
typename AT::t_v_array vdelu;
|
||||
typename AT::t_f_array_const f;
|
||||
typename AT::t_float_1d rmass;
|
||||
typename AT::t_float_1d mass;
|
||||
typename AT::t_int_1d type;
|
||||
typename AT::t_int_1d mask;
|
||||
|
||||
Few<double, 6> d_h_two;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user