Skip to content

Commit

Permalink
fix(rxtrace): Don't call FIFO routines with single process
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed May 1, 2024
1 parent 6350ef3 commit 0d91c85
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/rt/RtraceSimulManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.6 2024/04/30 23:16:23 greg Exp $";
static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.7 2024/05/01 20:28:53 greg Exp $";
#endif
/*
* RtraceSimulManager.cpp
Expand Down Expand Up @@ -117,7 +117,8 @@ RadSimulManager::ThreadsAvailable() const
// Global pointer to simulation manager for trace call-back (only one)
static const RtraceSimulManager * ourRTsimMan = NULL;

void // static call-back
// Call-back for trace output
void
RtraceSimulManager::RTracer(RAY *r)
{
(*ourRTsimMan->traceCall)(r, ourRTsimMan->tcData);
Expand Down Expand Up @@ -237,8 +238,9 @@ RtraceSimulManager::EnqueueBundle(const FVECT orig_direc[], int n, RNUMBER rID0)
if (d > 0) { // direction vector is valid?
if (curFlags & RTlimDist)
res.rmax = d;
if (curFlags & RTdoFIFO) {
ray_fifo_in(&res);
if (((curFlags&RTdoFIFO) != 0) & (ray_pnprocs > 0)) {
if (ray_fifo_in(&res) < 0)
return -1;
sendRes = false;
} else
sendRes &= ProcessRay(&res);
Expand All @@ -257,9 +259,11 @@ RtraceSimulManager::EnqueueBundle(const FVECT orig_direc[], int n, RNUMBER rID0)
int
RtraceSimulManager::FlushQueue()
{
if (curFlags & RTdoFIFO)
return ray_fifo_flush();

if (curFlags & RTdoFIFO) {
if (ray_pnprocs)
return ray_fifo_flush();
return 0;
}
int nsent = 0;
RAY res;

Expand Down

0 comments on commit 0d91c85

Please sign in to comment.