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.48 by gwlarson, Tue Feb 2 16:13:24 1999 UTC vs.
Revision 3.50 by gwlarson, Tue Mar 9 08:51:39 1999 UTC

# Line 11 | Line 11 | static char SCCSid[] = "$SunId$ SGI";
11   #include "rholo.h"
12   #include "random.h"
13   #include <signal.h>
14 #include <sys/types.h>
14   #include <sys/stat.h>
15  
17 #ifndef RTFLUSH
18 #define RTFLUSH         0               /* flush one at a time in batch */
19 #endif
16   #ifndef FRAGWARN
17   #define FRAGWARN        20              /* fragmentation for warning (%) */
18   #endif
19   #ifndef MAXQTIME
20   #define MAXQTIME        5               /* target maximum seconds in queue */
21   #endif
22 +                                        /* manual cache flushing frequency */
23 + #ifndef RTFLUSH
24 + #if MAXQTIME
25 + #define RTFLUSH         (300/MAXQTIME*totqlen)  /* <= 5 minutes */
26 + #else
27 + #define RTFLUSH         (50*totqlen)            /* just guess */
28 + #endif
29 + #endif
30                          /* the following must be consistent with rholo.h */
31   int     NVARS = NRHVARS;                /* total number of variables */
32  
# Line 55 | Line 59 | long   nraysdone = 0L;         /* number of rays done */
59   long    npacksdone = 0L;        /* number of packets done */
60  
61   PACKET  *freepacks;             /* available packets */
62 < int     totqlen;                /* maximum queue length when full */
62 > int     totqlen;                /* maximum queue length (number of packets) */
63  
64   char  *sigerr[NSIG];            /* signal error messages */
65  
# Line 212 | Line 216 | initrholo()                    /* get our holodeck running */
216                  maxdisk = 1024.*1024.*vflt(DISKSPACE);
217                                                  /* set up memory cache */
218          if (outdev == NULL)
219 <                hdcachesize = 0;        /* manual flushing */
219 >                hdcachesize = 0;                /* manual flushing */
220          else if (vdef(CACHE))
221                  hdcachesize = 1024.*1024.*vflt(CACHE);
222                                                  /* open report file */
# Line 267 | Line 271 | initrholo()                    /* get our holodeck running */
271          sigdie(SIGXCPU, "CPU limit exceeded");
272          sigdie(SIGXFSZ, "File size exceeded");
273   #endif
274 <                                                /* protect holodeck file */
274 >                                        /* protect holodeck file */
275          orig_mode = resfmode(hdlist[0]->fd, ncprocs>0 ? 0 : 0444);
276          return;
277   memerr:
# Line 517 | Line 521 | PACKET *pl;
521                                  p->nr*sizeof(RAYVAL));
522                          if (outdev != NULL)     /* display it */
523                                  disp_packet((PACKHEAD *)p);
524 <                        if (hdcachesize <= 0) {
521 < #if RTFLUSH
522 <                                if (outdev == NULL)
523 <                                        hdfreebeam(hdlist[p->hd], p->bi);
524 < #endif
524 >                        if (hdcachesize <= 0)
525                                  n2flush++;
526                        }
526                          nraysdone += p->nr;
527                          npacksdone++;
528                          p->nr = 0;
# Line 531 | Line 530 | PACKET *pl;
530                  p->next = freepacks;            /* push onto free list */
531                  freepacks = p;
532          }
533 < #if MAXQTIME
535 <        if (n2flush > 300/MAXQTIME*totqlen) {
536 < #else
537 <        if (n2flush > 50*totqlen) {
538 < #endif
539 < #if RTFLUSH
540 <                hdsync(NULL, outdev!=NULL);     /* sync beams & directories */
541 < #else
533 >        if (n2flush >= RTFLUSH) {
534                  if (outdev != NULL)
535                          hdsync(NULL, 1);
536                  else
537                          hdflush(NULL);
546 #endif
538                  n2flush = 0;
539          }
540   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines