42 |
|
{ |
43 |
|
printf("-c %-5d\t\t\t# accumulated rays per record\n", myRCmanager.accum); |
44 |
|
printf(myRCmanager.HasFlag(RCcontrib) ? |
45 |
< |
"-V+\t\t\t\t# output contributions" : |
46 |
< |
"-V-\t\t\t\t# output coefficients"); |
45 |
> |
"-V+\t\t\t\t# output contributions\n" : |
46 |
> |
"-V-\t\t\t\t# output coefficients\n"); |
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); |
96 |
|
sigerr[signo] = msg; |
97 |
|
} |
98 |
|
|
99 |
– |
const char * |
100 |
– |
formstr(int f) // return format identifier |
101 |
– |
{ |
102 |
– |
switch (f) { |
103 |
– |
case 'a': return("ascii"); |
104 |
– |
case 'f': return("float"); |
105 |
– |
case 'd': return("double"); |
106 |
– |
case 'c': return(NCSAMP==3 ? COLRFMT : SPECFMT); |
107 |
– |
} |
108 |
– |
return("unknown"); |
109 |
– |
} |
110 |
– |
|
99 |
|
/* set input/output format */ |
100 |
|
static void |
101 |
|
setformat(const char *fmt) |
337 |
|
// rval = # rows recovered |
338 |
|
rval = myRCmanager.PrepOutput(); |
339 |
|
// check if recovered everything |
340 |
< |
if (recover && rval >= myRCmanager.GetRowMax()) { |
340 |
> |
if (rval >= myRCmanager.GetRowMax()) { |
341 |
|
error(WARNING, "nothing left to compute"); |
342 |
|
quit(0); |
343 |
|
} // add processes as requested |
482 |
|
} |
483 |
|
last_report = tstart = time(0); |
484 |
|
} |
485 |
< |
while (r < totRows) { // getting to work... |
485 |
> |
while (r < totRows) { // loop until done |
486 |
|
time_t tnow; |
487 |
|
if (!getRayBundle(odarr)) |
488 |
|
goto readerr; |
491 |
|
r++; |
492 |
|
if (report_intvl <= 0) |
493 |
|
continue; |
494 |
< |
if ((r < totRows) & ((tnow = time(0)) < last_report+report_intvl)) |
494 |
> |
tnow = time(0); // time to report progress? |
495 |
> |
if (r == totRows) |
496 |
> |
myRCmanager.FlushQueue(); |
497 |
> |
else if (tnow < last_report+report_intvl) |
498 |
|
continue; |
499 |
|
sprintf(errmsg, "%.2f%% done after %.3f hours\n", |
500 |
< |
100.*r/totRows, (1./3600.)*(tnow - tstart)); |
500 |
> |
100.*myRCmanager.GetRowFinished()/totRows, |
501 |
> |
(1./3600.)*(tnow - tstart)); |
502 |
|
eputs(errmsg); |
503 |
|
last_report = tnow; |
504 |
|
} |