Skip to content

Commit

Permalink
Merge branch 'kokkos' of github.com:qmcpack/miniQMC into kokkos
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Sep 20, 2017
2 parents 2e5688c + 350cac3 commit d5a1f90
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/QMCWaveFunctions/Jastrow/TwoBodyJastrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ inline void TwoBodyJastrow<FT>::computeU3(ParticleSet &P, int iat_,
std::fill_n(du, N, czero);
std::fill_n(d2u, N, czero);

Kokkos::fence();
// Kokkos::fence();
// Actually we need one u, du and d2u etc. per group in flight.
igt = P.GroupID[iat] * NumGroups;
for (int jg = 0; jg < NumGroups; ++jg)
Expand All @@ -285,7 +285,7 @@ inline void TwoBodyJastrow<FT>::computeU3(ParticleSet &P, int iat_,
///EVIL HACK
jg_hack = jg;
Kokkos::parallel_for(policy_t(1,1,32), *this);
Kokkos::fence();
// Kokkos::fence();
}


Expand Down Expand Up @@ -338,12 +338,12 @@ TwoBodyJastrow<FT>::ratioGrad(ParticleSet &P, int iat, GradType &grad_iat)

computeU3(P, iat, P.DistTables[0]->Temp_r.data(), cur_u.data(), cur_du.data(),
cur_d2u.data());
Kokkos::fence();
// Kokkos::fence();
cur_Uat = simd::accumulate_n(cur_u.data(), N, valT());
Kokkos::fence();
// Kokkos::fence();
DiffVal = Uat[iat] - cur_Uat;
grad_iat += accumulateG(cur_du.data(), P.DistTables[0]->Temp_dr);
Kokkos::fence();
// Kokkos::fence();
return std::exp(DiffVal);
}

Expand All @@ -354,12 +354,12 @@ void TwoBodyJastrow<FT>::acceptMove(ParticleSet &P, int iat)
const DistanceTableData *d_table = P.DistTables[0];
computeU3(P, iat, d_table->Distances[iat], old_u.data(), old_du.data(),
old_d2u.data());
Kokkos::fence();
// Kokkos::fence();
if (UpdateMode == ORB_PBYP_RATIO)
{ // ratio-only during the move; need to compute derivatives
const auto dist = d_table->Temp_r.data();
computeU3(P, iat, dist, cur_u.data(), cur_du.data(), cur_d2u.data());
Kokkos::fence();
// Kokkos::fence();
}

valT cur_d2Uat(0);
Expand Down Expand Up @@ -395,7 +395,7 @@ template <typename FT> void TwoBodyJastrow<FT>::recompute(ParticleSet &P)
{
computeU3(P, iat, d_table->Distances[iat], cur_u.data(), cur_du.data(),
cur_d2u.data());
Kokkos::fence();
// Kokkos::fence();
Uat[iat] = simd::accumulate_n(cur_u.data(), N, valT());
posT grad;
valT lap;
Expand Down Expand Up @@ -423,9 +423,9 @@ void TwoBodyJastrow<FT>::evaluateGL(ParticleSet &P,
ParticleSet::ParticleLaplacian_t &L,
bool fromscratch)
{
Kokkos::fence();
// Kokkos::fence();
if (fromscratch) recompute(P);
Kokkos::fence();
// Kokkos::fence();
LogValue = valT(0);
for (int iat = 0; iat < N; ++iat)
{
Expand Down
4 changes: 2 additions & 2 deletions src/miniapps/miniqmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ int main(int argc, char **argv)

Timers[Timer_ratioGrad]->stop();

Kokkos::fence();
//Kokkos::fence();
// Accept/reject the trial move
if (ur[iel] > accept) // MC
{
// Update position, and update temporary storage
Timers[Timer_Update]->start();
WaveFunction->acceptMove(els, iel);
Timers[Timer_Update]->stop();
Kokkos::fence();
//Kokkos::fence();
Timers[Timer_DT]->start();
els.acceptMove(iel);
Timers[Timer_DT]->stop();
Expand Down
4 changes: 2 additions & 2 deletions src/simd/Mallocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ namespace qmcplusplus
return static_cast<T*>(pt);
#endif*/
void* pt = Kokkos::kokkos_malloc<>(n*sizeof(T));
Kokkos::fence();
// Kokkos::fence();
return static_cast<T*>(pt);
}
void deallocate(T* p, std::size_t) {
Kokkos::fence();
// Kokkos::fence();
Kokkos::kokkos_free(p);
}
};
Expand Down

0 comments on commit d5a1f90

Please sign in to comment.