| 358 |
|
if (rval >= myRCmanager.GetRowMax()) { |
| 359 |
|
error(WARNING, "nothing left to compute"); |
| 360 |
|
quit(0); |
| 361 |
< |
} // add processes as requested |
| 362 |
< |
myRCmanager.SetThreadCount(nproc); |
| 363 |
< |
|
| 361 |
> |
} |
| 362 |
|
rxcontrib(rval); /* trace ray contributions (loop) */ |
| 363 |
|
|
| 364 |
|
quit(0); /* exit clean */ |
| 413 |
|
int n2go = myRCmanager.accum; |
| 414 |
|
|
| 415 |
|
switch (inpfmt) { |
| 416 |
< |
case 'a': // ASCII input |
| 416 |
> |
case 'a': // ASCII input |
| 417 |
|
if (!orig_dir) |
| 418 |
|
return skipWords(6*n2go); |
| 419 |
|
while (n2go-- > 0) { |
| 426 |
|
orig_dir += 2; |
| 427 |
|
} |
| 428 |
|
break; |
| 429 |
< |
case 'f': // float input |
| 429 |
> |
case 'f': // float input |
| 430 |
|
if (!orig_dir) |
| 431 |
|
return skipBytes(6*sizeof(float)*n2go); |
| 432 |
|
#ifdef SMLFLT |
| 433 |
|
if (getbinary(orig_dir, sizeof(FVECT), 2*n2go, stdin) != 2*n2go) |
| 434 |
|
return false; |
| 435 |
+ |
orig_dir += 2*n2go; |
| 436 |
|
#else |
| 437 |
|
while (n2go-- > 0) { |
| 438 |
|
float fvecs[6]; |
| 444 |
|
} |
| 445 |
|
#endif |
| 446 |
|
break; |
| 447 |
< |
case 'd': // double input |
| 447 |
> |
case 'd': // double input |
| 448 |
|
if (!orig_dir) |
| 449 |
|
return skipBytes(6*sizeof(double)*n2go); |
| 450 |
|
#ifndef SMLFLT |
| 451 |
|
if (getbinary(orig_dir, sizeof(FVECT), 2*n2go, stdin) != 2*n2go) |
| 452 |
|
return false; |
| 453 |
+ |
orig_dir += 2*n2go; |
| 454 |
|
#else |
| 455 |
|
while (n2go-- > 0) { |
| 456 |
|
double dvecs[6]; |
| 466 |
|
error(INTERNAL, "unsupported format in getRayBundle()"); |
| 467 |
|
return false; |
| 468 |
|
} |
| 469 |
< |
int warned = 0; // normalize directions |
| 470 |
< |
n2go = myRCmanager.accum; |
| 469 |
> |
n2go = myRCmanager.accum; // normalize directions |
| 470 |
|
while (n2go-- > 0) { |
| 471 |
|
orig_dir -= 2; |
| 472 |
< |
if (normalize(orig_dir[1]) == 0) |
| 474 |
< |
if (!warned++) |
| 475 |
< |
error(WARNING, "zero ray direction on input"); |
| 472 |
> |
normalize(orig_dir[1]); |
| 473 |
|
} |
| 474 |
|
return true; |
| 475 |
|
} |
| 497 |
|
} |
| 498 |
|
last_report = tstart = time(0); |
| 499 |
|
} |
| 500 |
+ |
// start children as requested |
| 501 |
+ |
myRCmanager.SetThreadCount(nproc); |
| 502 |
+ |
|
| 503 |
|
while (r < totRows) { // loop until done |
| 504 |
|
time_t tnow; |
| 505 |
|
if (!getRayBundle(odarr)) |
| 510 |
|
if (report_intvl <= 0) |
| 511 |
|
continue; |
| 512 |
|
tnow = time(0); // time to report progress? |
| 513 |
< |
if (r == totRows) |
| 514 |
< |
myRCmanager.FlushQueue(); |
| 513 |
> |
if (r == totRows) // finished? |
| 514 |
> |
myRCmanager.SetThreadCount(1); |
| 515 |
|
else if (tnow < last_report+report_intvl) |
| 516 |
|
continue; |
| 517 |
|
sprintf(errmsg, "%.2f%% done after %.3f hours\n", |