Skip to content

Commit b3df102

Browse files
committed
move assertion that SD don't move by more than 1 domain from adjust_x to unpack
1 parent 4c87fb9 commit b3df102

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

src/impl/particles_impl_pack.ipp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ namespace libcloudphxx
9999
thrust::make_permutation_iterator(x.begin(), lft_id.begin()), // in place
100100
detail::remote<real_t>(x0, x1)
101101
);
102-
#if !defined(NDEBUG)
103-
auto min_it = thrust::min_element(
104-
thrust::make_permutation_iterator(x.begin(), lft_id.begin()),
105-
thrust::make_permutation_iterator(x.begin(), lft_id.begin()) + lft_count);
106-
if(*min_it < x0)
107-
{
108-
std::cerr << "x (" << *min_it << ") < x0 (" << x0 << ") after adjustment for distmem copy, potentially SD moved by more than one process/GPU domain size" << std::endl;
109-
assert(0);
110-
}
111-
#endif
112102
}
113103

114104
template <typename real_t, backend_t device>
@@ -120,16 +110,6 @@ namespace libcloudphxx
120110
thrust::make_permutation_iterator(x.begin(), rgt_id.begin()), // in place
121111
detail::remote<real_t>(x1, x0)
122112
);
123-
#if !defined(NDEBUG)
124-
auto max_it = thrust::max_element(
125-
thrust::make_permutation_iterator(x.begin(), lft_id.begin()),
126-
thrust::make_permutation_iterator(x.begin(), lft_id.begin()) + lft_count);
127-
if(*max_it >= x1)
128-
{
129-
std::cerr << "x (" << *max_it << ") >= x1 (" << x1 << ") after adjustment for distmem copy, potentially SD moved by more than one process/GPU domain size" << std::endl;
130-
assert(0);
131-
}
132-
#endif
133113
}
134114
};
135115
};

src/impl/particles_impl_unpack.ipp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ namespace libcloudphxx
3131
thrust::copy( in_real_bfr.begin() + distance * n_copied, in_real_bfr.begin() + (distance+1) * n_copied, (*it)->begin() + n_part_old);
3232
it++;
3333
}
34+
#if !defined(NDEBUG)
35+
auto min_it = thrust::min_element(x.begin() + n_part_old, x.end());
36+
if(*min_it < opts_init.x0)
37+
{
38+
std::cerr << "x (" << *min_it << ") < opts_init.x0 (" << opts_init.x0 << ") after unpacking, potentially SD moved by more than one process/GPU domain size" << std::endl;
39+
assert(0);
40+
}
41+
auto max_it = thrust::max_element(x.begin() + n_part_old, x.end());
42+
if(*max_it >= opts_init.x1)
43+
{
44+
std::cerr << "x (" << *max_it << ") >= opts_init.x1 (" << opts_init.x1 << ") after unpacking, potentially SD moved by more than one process/GPU domain size" << std::endl;
45+
assert(0);
46+
}
47+
#endif
3448
}
3549

3650
template <typename real_t, backend_t device>

0 commit comments

Comments
 (0)