Skip to content

Commit 1084bdc

Browse files
authored
Merge Pull Request #2365 from E3SM-Project/scream/tcclevenger/fix_initcheck_compute_sanitizer_fails
Automatically Merged using E3SM Pull Request AutoTester PR Title: Remove host copy of uninitialized device memory PR Author: tcclevenger
2 parents 4156717 + 2402f98 commit 1084bdc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

components/eamxx/src/physics/rrtmgp/simple_netcdf.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace simple_netcdf {
8181
std::vector<int> dimSizes(ndims);
8282
size_t dimsize;
8383
for (int i = 0; i < ndims; i++) {
84-
handle_error(nc_inq_dimlen(ncid, dimids[i], &dimsize), __FILE__, __LINE__);
84+
handle_error(nc_inq_dimlen(ncid, dimids[i], &dimsize), __FILE__, __LINE__);
8585
dimSizes[i] = dimsize;
8686
}
8787

@@ -95,7 +95,7 @@ namespace simple_netcdf {
9595

9696
// Read variable data
9797
if (myMem == memDevice) {
98-
auto arrHost = arr.createHostCopy();
98+
auto arrHost = arr.createHostObject();
9999
if (std::is_same<T,bool>::value) {
100100
// Create boolean array from integer arrays
101101
Array<int,rank,memHost,myStyle> tmp("tmp",dimSizes);
@@ -222,7 +222,7 @@ namespace simple_netcdf {
222222
handle_error(nc_put_var(ncid, varid, arr), __FILE__, __LINE__);
223223
}
224224

225-
template <class T, int rank, int myMem, int myStyle>
225+
template <class T, int rank, int myMem, int myStyle>
226226
void write(Array<T,rank,myMem,myStyle> const &arr, std::string varName, std::vector<std::string> dimNames) {
227227

228228
// Make sure length of dimension names is equal to rank of array

components/eamxx/tests/uncoupled/rrtmgp/rrtmgp_standalone_unit.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ namespace scream {
134134
auto ncol_all = grid->get_num_global_dofs();
135135
auto p_lay_all = real2d("p_lay", ncol_all, nlay);
136136
auto t_lay_all = real2d("t_lay", ncol_all, nlay);
137-
auto p_del_all = real2d("p_del", ncol_all, nlay);
138137
auto p_lev_all = real2d("p_lev", ncol_all, nlay+1);
139138
auto t_lev_all = real2d("t_lev", ncol_all, nlay+1);
140139
auto sfc_alb_dir_vis_all = real1d("sfc_alb_dir_vis", ncol_all);
@@ -178,7 +177,6 @@ namespace scream {
178177
auto icol_all = ncol * irank + icol;
179178
p_lay(icol,ilay) = p_lay_all(icol_all,ilay);
180179
t_lay(icol,ilay) = t_lay_all(icol_all,ilay);
181-
p_del(icol,ilay) = p_del_all(icol_all,ilay);
182180
lwp(icol,ilay) = lwp_all(icol_all,ilay);
183181
iwp(icol,ilay) = iwp_all(icol_all,ilay);
184182
rel(icol,ilay) = rel_all(icol_all,ilay);
@@ -193,7 +191,6 @@ namespace scream {
193191
// Free temporary variables
194192
p_lay_all.deallocate();
195193
t_lay_all.deallocate();
196-
p_del_all.deallocate();
197194
p_lev_all.deallocate();
198195
t_lev_all.deallocate();
199196
sfc_alb_dir_vis_all.deallocate();

0 commit comments

Comments
 (0)