Skip to content

Commit 7b6c07f

Browse files
committed
Line most likely redundant
1) The line "if (nj == 0) return 0;" should be a safeguard against crashing for runs with only massless particles. 2) "nj_massive" has become redundant since we started with the new method of weeding out massless particles from the j-particles.
1 parent 4f15dd9 commit 7b6c07f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/sapporo_light/send_fetch_data.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ int sapporo::fetch_ngb_list_from_device(int ignore) {
111111

112112

113113
double sapporo::evaluate_gravity(int ni, int nj) {
114+
// If no j particles, skip evaluation to avoid kernel launch with nj=0
115+
if (nj == 0) return 0;
116+
114117
#ifdef NGB
115118
bool ngb = true;
116119
#else
@@ -141,7 +144,6 @@ double sapporo::evaluate_gravity(int ni, int nj) {
141144

142145
gpu.nj_max = nj_max;
143146
gpu.nj_modified = nj_modified;
144-
gpu.nj_massive = nj_massive; // number of massive (non-test) particles
145147
gpu.predict = predict;
146148

147149
gpu.t_i_x = t_i.x;

0 commit comments

Comments
 (0)