ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rholo.c
(Generate patch)

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.44 by gwlarson, Wed Dec 30 08:02:37 1998 UTC vs.
Revision 3.48 by gwlarson, Tue Feb 2 16:13:24 1999 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1999 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ SGI";
14   #include <sys/types.h>
15   #include <sys/stat.h>
16  
17 + #ifndef RTFLUSH
18 + #define RTFLUSH         0               /* flush one at a time in batch */
19 + #endif
20   #ifndef FRAGWARN
21   #define FRAGWARN        20              /* fragmentation for warning (%) */
22   #endif
# Line 147 | Line 150 | int  signo;
150   {
151          static int  gotsig = 0;
152  
153 <        if (gotsig++)                   /* two signals and we're gone! */
153 >        if (gotsig > 1)                 /* we're going as fast as we can! */
154 >                return;
155 >        if (gotsig++) {                 /* two signals and we split */
156 >                hdsync(NULL, 0);        /* don't leave w/o saying goodbye */
157                  _exit(signo);
158 <
159 <        alarm(60);                      /* allow 60 seconds to clean up */
154 <        signal(SIGALRM, SIG_DFL);       /* make certain we do die */
158 >        }
159 >        alarm(300);                     /* allow 5 minutes to clean up */
160          eputs("signal - ");
161          eputs(sigerr[signo]);
162          eputs("\n");
# Line 313 | Line 318 | rholo()                                /* holodeck main loop */
318          if (reporttime > 0 && t >= reporttime)
319                  report(t);
320                                          /* figure out good packet size */
321 +        pksiz = RPACKSIZ;
322   #if MAXQTIME
323 <        pksiz = nraysdone*MAXQTIME/(totqlen*(t - starttime + 1L));
324 <        if (pksiz < 1)
325 <                pksiz = 1;
326 <        else if (pksiz > RPACKSIZ)
323 >        if (!chunkycmp) {
324 >                pksiz = nraysdone*MAXQTIME/(totqlen*(t - starttime + 1L));
325 >                if (pksiz < 1) pksiz = 1;
326 >                else if (pksiz > RPACKSIZ) pksiz = RPACKSIZ;
327 >        }
328   #endif
322                pksiz = RPACKSIZ;
329          idle = 0;                       /* get packets to process */
330          while (freepacks != NULL) {
331                  p = freepacks; freepacks = p->next; p->next = NULL;
# Line 511 | Line 517 | PACKET *pl;
517                                  p->nr*sizeof(RAYVAL));
518                          if (outdev != NULL)     /* display it */
519                                  disp_packet((PACKHEAD *)p);
520 <                        if (hdcachesize <= 0)   /* manual flushing */
520 >                        if (hdcachesize <= 0) {
521 > #if RTFLUSH
522 >                                if (outdev == NULL)
523 >                                        hdfreebeam(hdlist[p->hd], p->bi);
524 > #endif
525                                  n2flush++;
526 +                        }
527                          nraysdone += p->nr;
528                          npacksdone++;
529                          p->nr = 0;
# Line 525 | Line 536 | PACKET *pl;
536   #else
537          if (n2flush > 50*totqlen) {
538   #endif
539 <                if (outdev == NULL)
540 <                        hdflush(NULL);          /* flush holodeck buffers */
539 > #if RTFLUSH
540 >                hdsync(NULL, outdev!=NULL);     /* sync beams & directories */
541 > #else
542 >                if (outdev != NULL)
543 >                        hdsync(NULL, 1);
544                  else
545 <                        hdsync(NULL, 1);        /* sync holodeck file */
545 >                        hdflush(NULL);
546 > #endif
547                  n2flush = 0;
548          }
549   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines