47 |
|
if (myRCmanager.HasFlag(RTimmIrrad)) |
48 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
49 |
|
printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc); |
50 |
< |
if (myRCmanager.xres > 0) |
51 |
< |
printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres); |
50 |
> |
printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres); |
51 |
|
printf("-y %-9d\t\t\t# y resolution\n", myRCmanager.yres); |
52 |
|
printf(myRCmanager.HasFlag(RTlimDist) ? |
53 |
|
"-ld+\t\t\t\t# limit distance on\n" : |
55 |
|
printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n", |
56 |
|
inpfmt, outfmt, formstr(inpfmt), formstr(outfmt)); |
57 |
|
if (report_intvl > 0) |
58 |
< |
printf("-t %-9d\t\t\t# time between reports\n", report_intvl); |
58 |
> |
printf("-t %-9d\t\t\t# time between reports\n", report_intvl); |
59 |
|
printf(erract[WARNING].pf != NULL ? |
60 |
|
"-w+\t\t\t\t# warning messages on\n" : |
61 |
|
"-w-\t\t\t\t# warning messages off\n"); |
74 |
|
_exit(signo); |
75 |
|
|
76 |
|
#ifdef SIGALRM |
77 |
< |
alarm(180); /* allow 3 minutes to clean up */ |
77 |
> |
alarm(600); /* allow 10 minutes to clean up */ |
78 |
|
signal(SIGALRM, SIG_DFL); /* make certain we do die */ |
79 |
|
#endif |
80 |
|
eputs("signal - "); |
242 |
|
if (rval) erract[WARNING].pf = wputs; |
243 |
|
else erract[WARNING].pf = NULL; |
244 |
|
break; |
246 |
– |
case 'e': /* .cal expression */ |
247 |
– |
check(2,"s"); |
248 |
– |
scompile(argv[++i], NULL, 0); |
249 |
– |
break; |
245 |
|
case 'l': /* limit distance */ |
246 |
|
if (argv[i][2] != 'd') |
247 |
|
goto badopt; |
254 |
|
check_bool(2,rval); |
255 |
|
myRCmanager.SetFlag(RTimmIrrad, rval); |
256 |
|
break; |
257 |
< |
case 'f': /* .cal file or force or format */ |
263 |
< |
if (!argv[i][2]) { |
264 |
< |
check(2,"s"); |
265 |
< |
loadfunc(argv[++i]); |
266 |
< |
break; |
267 |
< |
} |
257 |
> |
case 'f': /* force or format */ |
258 |
|
if (argv[i][2] == 'o') { |
259 |
|
check_bool(3,force_open); |
260 |
|
break; |
335 |
|
myRCmanager.LoadOctree(argv[argc-1]); |
336 |
|
// add to header |
337 |
|
myRCmanager.AddHeader(argc-1, argv); |
338 |
+ |
{ |
339 |
+ |
char buf[128] = "SOFTWARE= "; |
340 |
+ |
strcpy(buf+10, VersionID); |
341 |
+ |
myRCmanager.AddHeader(buf); |
342 |
+ |
} |
343 |
|
// prepare output files |
344 |
|
if (recover) |
345 |
|
myRCmanager.outOp = RCOrecover; |
353 |
|
if (rval >= myRCmanager.GetRowMax()) { |
354 |
|
error(WARNING, "nothing left to compute"); |
355 |
|
quit(0); |
356 |
< |
} // add processes as requested |
362 |
< |
myRCmanager.SetThreadCount(nproc); |
363 |
< |
|
356 |
> |
} |
357 |
|
rxcontrib(rval); /* trace ray contributions (loop) */ |
358 |
|
|
359 |
|
quit(0); /* exit clean */ |
492 |
|
} |
493 |
|
last_report = tstart = time(0); |
494 |
|
} |
495 |
+ |
// start children as requested |
496 |
+ |
myRCmanager.SetThreadCount(nproc); |
497 |
+ |
|
498 |
|
while (r < totRows) { // loop until done |
499 |
|
time_t tnow; |
500 |
|
if (!getRayBundle(odarr)) |
504 |
|
r++; |
505 |
|
if (report_intvl <= 0) |
506 |
|
continue; |
507 |
< |
tnow = time(0); // time to report progress? |
508 |
< |
if (r == totRows) |
509 |
< |
myRCmanager.FlushQueue(); |
510 |
< |
else if (tnow < last_report+report_intvl) |
507 |
> |
if (r == totRows) // need to finish up? |
508 |
> |
myRCmanager.SetThreadCount(1); |
509 |
> |
tnow = time(0); |
510 |
> |
if ((r < totRows) & (tnow < last_report+report_intvl)) |
511 |
|
continue; |
512 |
|
sprintf(errmsg, "%.2f%% done after %.3f hours\n", |
513 |
|
100.*myRCmanager.GetRowFinished()/totRows, |
563 |
|
int code |
564 |
|
) |
565 |
|
{ |
566 |
< |
if (!code && myRCmanager.Ready()) // clean up on normal exit |
571 |
< |
code = myRCmanager.Cleanup(); |
566 |
> |
myRCmanager.FlushQueue(); // leave nothing in queue |
567 |
|
|
568 |
|
exit(code); |
569 |
|
} |