Skip to content

Commit ed5ad3a

Browse files
committed
apply suggestions from code review
1 parent f7aaea4 commit ed5ad3a

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

cmake/dependencies/AMReX.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ option(pyAMReX_amrex_internal "Download & build AMReX" ON)
8686
set(pyAMReX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
8787
CACHE STRING
8888
"Repository URI to pull and build AMReX from if(pyAMReX_amrex_internal)")
89-
set(pyAMReX_amrex_branch "development"
89+
set(pyAMReX_amrex_branch "793ea9f717590d66d178a86298b82aac244b77a7"
9090
CACHE STRING
9191
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")
9292

src/Particle/ParticleContainer.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ namespace
2323

2424
auto buf = idcpus.request();
2525
auto buf2 = ids.request();
26-
if (buf.size != buf2.size) throw std::runtime_error("sizes do not match!");
26+
if (buf.size != buf2.size) {
27+
throw std::runtime_error("sizes do not match!");
28+
}
2729

2830
int N = idcpus.shape()[0];
2931
for (int i = 0; i < N; i++) {
@@ -43,7 +45,9 @@ namespace
4345

4446
auto buf = idcpus.request();
4547
auto buf2 = cpus.request();
46-
if (buf.size != buf2.size) throw std::runtime_error("sizes do not match!");
48+
if (buf.size != buf2.size) {
49+
throw std::runtime_error("sizes do not match!");
50+
}
4751

4852
int N = idcpus.shape()[0];
4953
for (int i = 0; i < N; i++) {

tests/test_particleTile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ def test_ptile_aos():
176176
assert not amr.is_valid(idcpu[0])
177177
idcpu[0] = amr.make_valid(idcpu[0])
178178
assert amr.is_valid(idcpu[0])
179+
180+
# the leftmost bit stores the sign of the id
181+
# the next 39 store its absolute value
182+
# the rightmost 24 then store the cpu number
183+
# using this scheme, id = 1 cpu = 100
184+
# corresponds to 9223372036871553124
179185
assert idcpu[0] == 9223372036871553124
180186

181187
idcpu = np.array([0, 0, 0, 0, 0], dtype=np.uint64)

0 commit comments

Comments
 (0)