| 21 |
|
if (octname) { // already running? |
| 22 |
|
if (octn && !strcmp(octn, octname)) |
| 23 |
|
return true; |
| 24 |
< |
Cleanup(); |
| 24 |
> |
Cleanup(false); |
| 25 |
|
} |
| 26 |
|
if (!octn) |
| 27 |
|
return false; |
| 30 |
|
return true; |
| 31 |
|
} |
| 32 |
|
|
| 33 |
+ |
// How many processors are there? |
| 34 |
+ |
int |
| 35 |
+ |
RadSimulManager::GetNCores() |
| 36 |
+ |
{ |
| 37 |
+ |
return 1; // XXX temporary |
| 38 |
+ |
} |
| 39 |
+ |
|
| 40 |
|
// Set number of computation threads (0 => #cores) |
| 41 |
|
int |
| 42 |
|
RadSimulManager::SetThreadCount(int nt) |
| 46 |
|
|
| 47 |
|
// Close octree, free data, return status |
| 48 |
|
int |
| 49 |
< |
RadSimulManager::Cleanup() |
| 49 |
> |
RadSimulManager::Cleanup(bool everything) |
| 50 |
|
{ |
| 51 |
< |
ray_done(0); |
| 51 |
> |
ray_done(everything); |
| 52 |
|
return 0; |
| 53 |
|
} |
| 54 |
|
|
| 173 |
|
res.rmax = d; |
| 174 |
|
samplendx++; |
| 175 |
|
rayvalue(&res); // XXX single-threaded for now |
| 169 |
– |
++nqueued; |
| 176 |
|
} else if (ThreadsAvailable() < NThreads() && |
| 177 |
|
!FlushQueue()) |
| 178 |
|
return -1; |
| 179 |
|
if (cookedCall) |
| 180 |
|
(*cookedCall)(&res, ccData); |
| 181 |
+ |
nqueued++; |
| 182 |
|
} |
| 183 |
|
return nqueued; |
| 184 |
|
} |