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

Comparing ray/src/rt/rxcmain.cpp (file contents):
Revision 2.6 by greg, Wed Nov 6 19:45:59 2024 UTC vs.
Revision 2.9 by greg, Tue Dec 3 17:39:42 2024 UTC

# Line 42 | Line 42 | printdefaults(void)                    /* print default values to stdou
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);
# Line 96 | Line 96 | sigdie(                        /* set fatal signal */
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)
# Line 349 | Line 337 | main(int argc, char *argv[])
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
# Line 494 | Line 482 | rxcontrib(const int rstart)
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;
# Line 503 | Line 491 | rxcontrib(const int rstart)
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          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines