ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/RtraceSimulManager.h
(Generate patch)

Comparing ray/src/rt/RtraceSimulManager.h (file contents):
Revision 2.1 by greg, Wed Feb 8 17:41:48 2023 UTC vs.
Revision 2.2 by greg, Wed Jul 26 23:27:44 2023 UTC

# Line 22 | Line 22 | typedef void   RayReportCall(RAY *r, void *cd);
22   /// Multi-threaded simulation manager base class
23   class RadSimulManager {
24          int                     nThreads;       // number of active threads
25 + protected:
26 +                                /// How many cores are there?
27 +        static int              GetNCores();
28   public:
29                                  RadSimulManager(const char *octn = NULL) {
30                                          LoadOctree(octn);
# Line 74 | Line 77 | class RtraceSimulManager : public RadSimulManager { (p
77                                          traceCall = NULL; tcData = NULL;
78                                  }
79                                  ~RtraceSimulManager() {}
80 +                                /// Set number of computation threads (0 => #cores)
81 +        int                     SetThreadCount(int nt = 0) {
82 +                                        if (nt <= 0) nt = GetNCores();
83 +                                        if (nt == NThreads()) return nt;
84 +                                        FlushQueue();
85 +                                        return RadSimulManager::SetThreadCount(nt);
86 +                                }
87                                  /// Add ray bundle to queue w/ optional 1st ray ID
88          int                     EnqueueBundle(const FVECT orig_direc[], int n,
89                                                  RNUMBER rID0 = 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines