diff options
author | 2019-05-06 20:54:02 -0400 | |
---|---|---|
committer | 2019-05-06 20:54:02 -0400 | |
commit | 9f99d4f819c7760d174c8888134496bdee5b03f0 (patch) | |
tree | cb2203482d801f43dfe1c5b29b054ab47eed59de /Source | |
parent | 4a34f2ea9ab825a0af92fc0c03017043951032e7 (diff) | |
download | WarpX-9f99d4f819c7760d174c8888134496bdee5b03f0.tar.gz WarpX-9f99d4f819c7760d174c8888134496bdee5b03f0.tar.zst WarpX-9f99d4f819c7760d174c8888134496bdee5b03f0.zip |
printoutstatement to debug the swap in rho_old and rho_new in the gpu vs cpu
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Evolve/WarpXEvolveEM.cpp | 53 | ||||
-rw-r--r-- | Source/FieldSolver/WarpXFFT.cpp | 14 | ||||
-rw-r--r-- | Source/Initialization/WarpXInitData.cpp | 9 | ||||
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 2 |
4 files changed, 77 insertions, 1 deletions
diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp index 60b0b5fa3..025ff993a 100644 --- a/Source/Evolve/WarpXEvolveEM.cpp +++ b/Source/Evolve/WarpXEvolveEM.cpp @@ -80,12 +80,32 @@ WarpX::EvolveEM (int numsteps) *Bfield_aux[lev][0],*Bfield_aux[lev][1],*Bfield_aux[lev][2]); } is_synchronized = false; + + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at if synchronized rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } + + } else { // Beyond one step, we have E^{n} and B^{n}. // Particles have p^{n-1/2} and x^{n}. FillBoundaryE(); FillBoundaryB(); UpdateAuxilaryData(); + + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at if synchronized rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } } if (do_subcycling == 0 || finest_level == 0) { @@ -258,15 +278,48 @@ WarpX::OneStep_nosub (Real cur_time) if (warpx_py_particlescraper) warpx_py_particlescraper(); if (warpx_py_beforedeposition) warpx_py_beforedeposition(); #endif + + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at before pushf particles and depose rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } PushParticlesandDepose(cur_time); + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at after pushf particles and depose rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } #ifdef WARPX_USE_PY if (warpx_py_afterdeposition) warpx_py_afterdeposition(); #endif SyncCurrent(); + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " before sync rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } SyncRho(rho_fp, rho_cp); + for (MFIter mfi(*rho_fp[0]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp[0]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " after sync rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } // Push E and B from {n} to {n+1} // (And update guard cells immediately afterwards) #ifdef WARPX_USE_PSATD diff --git a/Source/FieldSolver/WarpXFFT.cpp b/Source/FieldSolver/WarpXFFT.cpp index e8b1442bb..ffeb237c0 100644 --- a/Source/FieldSolver/WarpXFFT.cpp +++ b/Source/FieldSolver/WarpXFFT.cpp @@ -405,6 +405,20 @@ WarpX::PushPSATD (int lev, amrex::Real /* dt */) rho_fp_fft[lev]->ParallelCopy(*rho_fp[lev], 0, 0, 2, 0, 0, period_fp); BL_PROFILE_VAR_STOP(blp_copy); + + for (MFIter mfi(*rho_fp_fft[lev]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp_fft[lev]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at begin Push PSATD rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + MultiFab &mf_orig = *rho_fp[lev]; + Array4<const Real> mforig_arr = mf_orig[mfi].array(); + amrex::Print() << " at begin Push PSATD rho " << mforig_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mforig_arr(0,0,0,1) << "\n"; + } + BL_PROFILE_VAR_START(blp_push_eb); if (fft_hybrid_mpi_decomposition){ if (Efield_fp_fft[lev][0]->local_size() == 1) diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 23637ec97..589ee168c 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -342,6 +342,15 @@ WarpX::InitLevelDataFFT (int lev, Real time) current_cp_fft[lev][2]->setVal(0.0); rho_cp_fft[lev]->setVal(0.0); } + + for (MFIter mfi(*rho_fp_fft[lev]); mfi.isValid(); ++mfi) + { + MultiFab &mf = *rho_fp_fft[lev]; + Box realspace_bx = mf[mfi].box(); // Copy the box + Array4<const Real> mf_arr = mf[mfi].array(); + amrex::Print() << " at initialization rho " << mf_arr(0,0,0,0) ; + amrex::Print() << " new rho " << mf_arr(0,0,0,1) << "\n"; + } } #endif diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 2edd3c636..695faaa62 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -608,7 +608,7 @@ WarpXParticleContainer::DepositCharge ( WarpXParIter& pti, RealVector& wp, const std::array<Real, 3>& xyzmin = xyzmin_tile; #ifdef AMREX_USE_GPU - data_ptr = (*rhomf)[pti].dataPtr(); + data_ptr = (*rhomf)[pti].dataPtr(icomp); auto rholen = (*rhomf)[pti].length(); #else tile_box.grow(ngRho); |