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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.28 by greg, Wed Sep 21 17:17:24 2005 UTC vs.
Revision 1.29 by greg, Wed Oct 5 05:20:21 2005 UTC

# Line 112 | Line 112 | int            using_stdout = 0;       /* are we using stdout? */
112   const char      *modname[MAXMODLIST];   /* ordered modifier name list */
113   int             nmods = 0;              /* number of modifiers */
114  
115 + #define queue_length()          (lastray - lastdone)
116 +
117   MODCONT *addmodifier(char *modn, char *outf, char *binv);
118   void addmodfile(char *fname, char *outf, char *binv);
119  
# Line 128 | Line 130 | void put_contrib(const DCOLOR cnt, FILE *fout);
130   void add_contrib(const char *modn);
131   void done_contrib(void);
132  
133 + /* return number of open rtrace processes */
134 + static int
135 + nrtprocs(void)
136 + {
137 +        int     nrtp = 0;
138 +        struct rtproc   *rtp;
139 +
140 +        for (rtp = &rt0; rtp != NULL; rtp = rtp->next)
141 +                nrtp += rtp->pd.running;
142 +        return(nrtp);
143 + }
144 +
145   /* set input/output format */
146   static void
147   setformat(const char *fmt)
# Line 956 | Line 970 | trace_contribs(FILE *fin)
970          struct rtproc   *rtp;
971                                                  /* loop over input */
972          while ((iblen = getinp(inpbuf, fin)) > 0) {
973 <                if (lastray+1 < lastray) {      /* counter rollover? */
973 >                if (lastray+1 < lastray ||      /* need reset? */
974 >                                queue_length() > 5*nrtprocs()) {
975                          while (wait_rproc() != NULL)
976                                  process_queue();
977                          lastdone = lastray = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines