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.2 by greg, Tue Oct 29 19:47:19 2024 UTC vs.
Revision 2.8 by greg, Thu Nov 7 20:56:09 2024 UTC

# Line 41 | Line 41 | static void
41   printdefaults(void)                     /* print default values to stdout */
42   {
43          printf("-c %-5d\t\t\t# accumulated rays per record\n", myRCmanager.accum);
44 <        printf("-V%c\t\t\t\t# output %s\n", contrib ? '+' : '-',
45 <                        contrib ? "contributions" : "coefficients");
44 >        printf(myRCmanager.HasFlag(RCcontrib) ?
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);
50 <        if (xres > 0)
51 <                printf("-x %-9d\t\t\t# x resolution\n", xres);
52 <        printf("-y %-9d\t\t\t# y resolution\n", yres);
50 >        if (myRCmanager.xres > 0)
51 >                printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres);
52 >        printf("-y %-9d\t\t\t# y resolution\n", myRCmanager.yres);
53          printf(myRCmanager.HasFlag(RTlimDist) ?
54                          "-ld+\t\t\t\t# limit distance on\n" :
55                          "-ld-\t\t\t\t# limit distance off\n");
# Line 74 | Line 75 | onsig(                         /* fatal signal */
75                  _exit(signo);
76  
77   #ifdef SIGALRM
78 <        alarm(15);                      /* allow 15 seconds to clean up */
78 >        alarm(180);                     /* allow 3 minutes to clean up */
79          signal(SIGALRM, SIG_DFL);       /* make certain we do die */
80   #endif
81          eputs("signal - ");
# Line 218 | Line 219 | main(int argc, char *argv[])
219                                  nproc = 1;
220                          break;
221                  case 'V':                       /* output contributions? */
222 <                        check_bool(2,contrib);
222 >                        rval = myRCmanager.HasFlag(RCcontrib);
223 >                        check_bool(2,rval);
224 >                        myRCmanager.SetFlag(RCcontrib, rval);
225                          break;
226                  case 'x':                       /* x resolution */
227                          check(2,"i");
228 <                        xres = atoi(argv[++i]);
228 >                        myRCmanager.xres = atoi(argv[++i]);
229                          break;
230                  case 'y':                       /* y resolution */
231                          check(2,"i");
232 <                        yres = atoi(argv[++i]);
232 >                        myRCmanager.yres = atoi(argv[++i]);
233                          break;
234                  case 'w':                       /* warnings on/off */
235                          rval = (erract[WARNING].pf != NULL);
# Line 346 | Line 349 | main(int argc, char *argv[])
349                                          // rval = # rows recovered
350          rval = myRCmanager.PrepOutput();
351                                          // check if recovered everything
352 <        if (recover && rval >= myRCmanager.GetRowMax()) {
352 >        if (rval >= myRCmanager.GetRowMax()) {
353                  error(WARNING, "nothing left to compute");
354                  quit(0);
355          }                               // add processes as requested
# Line 491 | Line 494 | rxcontrib(const int rstart)
494                  }
495                  last_report = tstart = time(0);
496          }
497 <        while (r < totRows) {           // getting to work...
497 >        while (r < totRows) {           // loop until done
498                  time_t  tnow;
499                  if (!getRayBundle(odarr))
500                          goto readerr;
501 <                if (myRCmanager.ComputeRecord(odarr) < 0)
501 >                if (myRCmanager.ComputeRecord(odarr) <= 0)
502                          return;         // error reported, hopefully...
503                  r++;
504                  if (report_intvl <= 0)
505                          continue;
506 <                if ((r < totRows) & ((tnow = time(0)) < last_report+report_intvl))
506 >                tnow = time(0);         // time to report progress?
507 >                if (r == totRows)
508 >                        myRCmanager.FlushQueue();
509 >                else if (tnow < last_report+report_intvl)
510                          continue;
511                  sprintf(errmsg, "%.2f%% done after %.3f hours\n",
512 <                                100.*r/totRows, (1./3600.)*(tnow - tstart));
512 >                                100.*myRCmanager.GetRowFinished()/totRows,
513 >                                (1./3600.)*(tnow - tstart));
514                  eputs(errmsg);
515                  last_report = tnow;
516          }
# Line 521 | Line 528 | wputs(                         /* warning output function */
528          const char      *s
529   )
530   {
531 +        if (!erract[WARNING].pf) return;
532          int  lasterrno = errno;
533          eputs(s);
534          errno = lasterrno;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines