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

Comparing ray/src/rt/pmapcontrib.c (file contents):
Revision 2.16 by rschregle, Fri Mar 16 21:00:09 2018 UTC vs.
Revision 2.20 by greg, Tue Feb 16 20:06:06 2021 UTC

# Line 23 | Line 23 | static const char RCSid[] = "$Id$";
23   #include "pmapdiag.h"
24   #include "rcontrib.h"
25   #include "otypes.h"
26 + #include "otspecial.h"
27   #if NIX
28     #include <sys/mman.h>
29     #include <sys/wait.h>  
# Line 196 | Line 197 | void distribPhotonContrib (PhotonMap* pm, unsigned num
197     if (!nsources)
198        error(USER, "no light sources in distribPhotonContrib");
199  
199   if (nsources > MAXMODLIST)
200      error(USER, "too many light sources in distribPhotonContrib");
201      
200     /* Allocate photon flux per light source; this differs for every
201      * source as all sources contribute the same number of distributed
202      * photons (srcDistribTarget), hence the number of photons emitted per
# Line 230 | Line 228 | void distribPhotonContrib (PhotonMap* pm, unsigned num
228     if (!pm -> distribTarget)
229        error(INTERNAL, "no photons to distribute in distribPhotonContrib");
230    
231 <   /* Get photon ports if specified */
232 <   if (ambincl == 1)
235 <      getPhotonPorts();
231 >   /* Get photon ports from modifier list */
232 >   getPhotonPorts(photonPortList);
233        
234     /* Get photon sensor modifiers */
235     getPhotonSensors(photonSensorList);      
# Line 393 | Line 390 | void distribPhotonContrib (PhotonMap* pm, unsigned num
390     }
391   #endif
392          
393 < #if PMAP_SIGUSR
393 > #ifdef PMAP_SIGUSR
394           signal(SIGUSR1, sigUsrDiags);
395   #endif        
396 <        
396 >
397 > #ifdef DEBUG_PMAP          
398           /* Output child process PID after random delay to prevent corrupted
399            * console output due to race condition */
400           usleep(1e6 * pmapRandom(rouletteState));
401 <         fprintf(stderr, "Proc %d: PID = %d\n", proc, getpid());
401 >         fprintf(stderr, "Proc %d: PID = %d "
402 >                 "(waiting 10 sec to attach debugger...)\n",
403 >                 proc, getpid());
404           /* Allow time for debugger to attach to child process */
405           sleep(10);
406 + #endif
407  
408           /* =============================================================
409            * 2-PASS PHOTON DISTRIBUTION
# Line 410 | Line 411 | void distribPhotonContrib (PhotonMap* pm, unsigned num
411            * Pass 2 (main): based on outcome of pass 1, estimate remaining
412            *                number of photons to emit to approximate target
413            *                count
414 <          * ============================================================= */        
414 >          * ============================================================= */
415           for (srcIdx = 0; srcIdx < nsources; srcIdx++) {
416   #ifndef PMAP_SIGUSR        
417              unsigned       portCnt, passCnt = 0, prePassCnt = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines