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

Comparing ray/src/rt/rcontrib.c (file contents):
Revision 2.7 by greg, Fri Jun 15 21:32:11 2012 UTC vs.
Revision 2.13 by greg, Fri Jun 22 22:03:02 2012 UTC

# Line 7 | Line 7 | static const char RCSid[] = "$Id$";
7   */
8  
9   #include "rcontrib.h"
10 #include "source.h"
10   #include "otypes.h"
12 #include "platform.h"
11  
12   char    *shm_boundary = NULL;           /* boundary of shared memory */
13  
# Line 27 | Line 25 | int    do_irrad = 0;                   /* compute irradiance? */
25  
26   int     rand_samp = 1;                  /* pure Monte Carlo sampling? */
27  
28 < double  dstrsrc = 0.0;                  /* square source distribution */
28 > double  dstrsrc = 0.9;                  /* square source distribution */
29   double  shadthresh = .03;               /* shadow threshold */
30   double  shadcert = .75;                 /* shadow certainty */
31   int     directrelay = 3;                /* number of source relays */
# Line 137 | Line 135 | addmodifier(char *modn, char *outf, char *binv, int bi
135   }
136  
137  
138 < /* add modifiers from a file list */
138 > /* Add modifiers from a file list */
139   void
140   addmodfile(char *fname, char *outf, char *binv, int bincnt)
141   {
# Line 159 | Line 157 | quit(                  /* quit program */
157   )
158   {
159          if (nchild > 0)         /* close children if any */
160 <                end_children();
160 >                end_children(code != 0);
161          exit(code);
162   }
163  
# Line 178 | Line 176 | rcinit()
176                                          /* set shared memory boundary */
177                  shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY");
178          }
181        if ((nproc > 1) & (accumulate <= 0))
182                put_zero_record(0);     /* prime our queue to accumulate */
183
179          if (yres > 0) {                 /* set up flushing & ray counts */
180                  if (xres > 0)
181                          raysleft = (RNUMBER)xres*yres;
# Line 191 | Line 186 | rcinit()
186          if ((account = accumulate) > 1)
187                  raysleft *= accumulate;
188          waitflush = (yres > 0) & (xres > 1) ? 0 : xres;
194                                        /* tracing to sources as well */
195        for (i = 0; i < nsources; i++)
196                source[i].sflags |= SFOLLOW;
189  
190          if (nproc > 1 && in_rchild())   /* forked child? */
191                  return;                 /* return to main processing loop */
192  
193          if (recover) {                  /* recover previous output? */
194 <                if (accumulate <= 0) {
194 >                if (accumulate <= 0)
195                          reload_output();
196 <                        if (nproc > 1)
205 <                                queue_modifiers();
206 <                } else
196 >                else
197                          recover_output();
198          }
199          if (nproc == 1)                 /* single process? */
200                  return;
201 <
202 <        parental_loop();                /* else run controller */
201 >                                        /* else run appropriate controller */
202 >        if (accumulate <= 0)
203 >                feeder_loop();
204 >        else
205 >                parental_loop();
206          quit(0);                        /* parent musn't return! */
207   }
208  
# Line 346 | Line 339 | rcontrib()
339                  account = 1;            /* output accumulated totals */
340                  done_contrib();
341          }
342 +        lu_done(&ofiletab);             /* close output files */
343          if (raysleft)
344                  error(USER, "unexpected EOF on input");
351        lu_done(&ofiletab);             /* close output files */
345   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines