Skip to content

Commit

Permalink
Fix a warning in packing communication send buffer (AMReX-Codes#2940)
Browse files Browse the repository at this point in the history
When we communication double precision data in single precision, there is a
conversion from double to float in packing the send buffer.  A static cast
is added to fix the warning.
  • Loading branch information
WeiqunZhang authored Sep 7, 2022
1 parent 3e397bb commit 5b0c598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_FBI.H
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ FabArray<FAB>::pack_send_buffer_cpu (FabArray<FAB> const& src, int scomp, int nc
amrex::LoopConcurrentOnCpu( bx, ncomp,
[=] (int ii, int jj, int kk, int n) noexcept
{
pfab(ii,jj,kk,n) = sfab(ii,jj,kk,n+scomp);
pfab(ii,jj,kk,n) = static_cast<BUF>(sfab(ii,jj,kk,n+scomp));
});
dptr += (bx.numPts() * ncomp * sizeof(BUF));
}
Expand Down

0 comments on commit 5b0c598

Please sign in to comment.