Commit 111786e9 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid trying to free NULL pointers and reallocate storage for OpenMP, when not using OpenMP styles

parent 132cee98
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ static int Reallocate_Bonds_List( reax_system *system, reax_list *bonds,
  *total_bonds = (int)(MAX( *total_bonds * safezone, mincap*MIN_BONDS ));

#ifdef LMP_USER_OMP
  if (system->omp_active)
    for (i = 0; i < bonds->num_intrs; ++i)
      sfree(bonds->select.bond_list[i].bo_data.CdboReduction, "CdboReduction");
#endif
@@ -384,6 +385,7 @@ static int Reallocate_Bonds_List( reax_system *system, reax_list *bonds,
  int nthreads = 1;
#endif

  if (system->omp_active)
    for (i = 0; i < bonds->num_intrs; ++i)
      bonds->select.bond_list[i].bo_data.CdboReduction =
        (double*) smalloc(sizeof(double)*nthreads, "CdboReduction", comm);