Skip to content

Commit

Permalink
feat(rxcontrib): Added a couple of minor sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Nov 1, 2024
1 parent eeab870 commit 9a8e2e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/rt/RcontribSimulManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: RcontribSimulManager.cpp,v 2.4 2024/11/01 16:17:33 greg Exp $";
static const char RCSid[] = "$Id: RcontribSimulManager.cpp,v 2.5 2024/11/01 23:05:01 greg Exp $";
#endif
/*
* RcontribSimulManager.cpp
Expand Down Expand Up @@ -148,7 +148,7 @@ RcontribSimulManager::RctCall(RAY *r, void *cd)

int bi = 0; // get bin index
if (mp->binv) {
worldfunc(RCCONTEXT, r); // compute bin #
worldfunc(RCCONTEXT, r);
set_eparams(mp->params);
double bval = evalue(mp->binv);
if (bval <= -.5)
Expand Down Expand Up @@ -324,6 +324,10 @@ RcontribSimulManager::PrepOutput()
error(INTERNAL, "PrepOutput() called before octree & modifiers assigned");
return -1;
}
if (!cdsF) {
error(INTERNAL, "missing RdataShare constructor call (*cdsF)");
return -1;
}
if (lu_doall(&modLUT, checkModExists, NULL) < 0)
return -1;

Expand Down
4 changes: 2 additions & 2 deletions src/rt/RcontribSimulManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* RCSid $Id: RcontribSimulManager.h,v 2.3 2024/10/30 01:38:21 greg Exp $ */
/* RCSid $Id: RcontribSimulManager.h,v 2.4 2024/11/01 23:05:01 greg Exp $ */
/*
* RcontribSimulManager.h
*
Expand Down Expand Up @@ -279,7 +279,7 @@ class RcontribSimulManager : protected RtraceSimulManager {
int PrepOutput();
/// Are we ready to compute some records?
bool Ready() const {
return rowsDone.Length();
return (rowsDone.Length() > 0) & (accum > 0);
}
/// Set number of computation threads (0 => #cores)
int SetThreadCount(int nt = 0);
Expand Down

0 comments on commit 9a8e2e3

Please sign in to comment.