Skip to content

Commit

Permalink
Parallel run and GPU compile successful.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Lattanzi committed Nov 8, 2023
1 parent 663fc20 commit 1523c72
Show file tree
Hide file tree
Showing 5 changed files with 577 additions and 656 deletions.
12 changes: 7 additions & 5 deletions Source/Diffusion/ComputeTurbulentViscosity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void ComputeTurbulentViscosityLES (const amrex::MultiFab& Tau11, const amrex::Mu
{
Box bxcc = mfi.tilebox();
Box planex = bxcc; planex.setSmall(0, 1); planex.setBig(0, ngc); planex.grow(1,1);
Box planey = bxcc; planey.setSmall(1, 1); planey.setBig(1, ngc);
Box planey = bxcc; planey.setSmall(1, 1); planey.setBig(1, ngc); planey.grow(0,1);
int i_lo = bxcc.smallEnd(0); int i_hi = bxcc.bigEnd(0);
int j_lo = bxcc.smallEnd(1); int j_hi = bxcc.bigEnd(1);
bxcc.growLo(0,ngc); bxcc.growHi(0,ngc);
Expand Down Expand Up @@ -222,15 +222,17 @@ void ComputeTurbulentViscosityLES (const amrex::MultiFab& Tau11, const amrex::Mu
if (j_lo == domain.smallEnd(1)) {
amrex::ParallelFor(planey, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
mu_turb(i, j_lo-j, k, EddyDiff::Mom_h) = mu_turb(i, j_lo, k, EddyDiff::Mom_h);
mu_turb(i, j_lo-j, k, EddyDiff::Mom_v) = mu_turb(i, j_lo, k, EddyDiff::Mom_v);
int li = amrex::min(amrex::max(i, domain.smallEnd(0)), domain.bigEnd(0));
mu_turb(i, j_lo-j, k, EddyDiff::Mom_h) = mu_turb(li, j_lo, k, EddyDiff::Mom_h);
mu_turb(i, j_lo-j, k, EddyDiff::Mom_v) = mu_turb(li, j_lo, k, EddyDiff::Mom_v);
});
}
if (j_hi == domain.bigEnd(1)) {
amrex::ParallelFor(planey, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
mu_turb(i, j_hi+j, k, EddyDiff::Mom_h) = mu_turb(i, j_hi, k, EddyDiff::Mom_h);
mu_turb(i, j_hi+j, k, EddyDiff::Mom_v) = mu_turb(i, j_hi, k, EddyDiff::Mom_v);
int li = amrex::min(amrex::max(i, domain.smallEnd(0)), domain.bigEnd(0));
mu_turb(i, j_hi+j, k, EddyDiff::Mom_h) = mu_turb(li, j_hi, k, EddyDiff::Mom_h);
mu_turb(i, j_hi+j, k, EddyDiff::Mom_v) = mu_turb(li, j_hi, k, EddyDiff::Mom_v);
});
}

Expand Down
10 changes: 5 additions & 5 deletions Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ public:
static amrex::Vector<std::string> tracer_particle_varnames;
#endif

#ifdef ERF_USE_NETCDF
void init_from_wrfinput (int lev);
void init_from_metgrid (int lev);
#endif // ERF_USE_NETCDF

private:

///////////////////////////
Expand Down Expand Up @@ -345,11 +350,6 @@ private:

void initialize_integrator (int lev, amrex::MultiFab& cons_mf, amrex::MultiFab& vel_mf);

#ifdef ERF_USE_NETCDF
void init_from_wrfinput (int lev);
void init_from_metgrid (int lev);
#endif // ERF_USE_NETCDF

// more flexible version of AverageDown() that lets you average down across multiple levels
void AverageDownTo (int crse_lev); // NOLINT

Expand Down
Loading

0 comments on commit 1523c72

Please sign in to comment.