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> |
231 |
|
if (!pm -> distribTarget) |
232 |
|
error(INTERNAL, "no photons to distribute in distribPhotonContrib"); |
233 |
|
|
234 |
< |
/* Get photon ports if specified */ |
235 |
< |
if (ambincl == 1) |
235 |
< |
getPhotonPorts(); |
234 |
> |
/* Get photon ports from modifier list */ |
235 |
> |
getPhotonPorts(photonPortList); |
236 |
|
|
237 |
|
/* Get photon sensor modifiers */ |
238 |
|
getPhotonSensors(photonSensorList); |
393 |
|
} |
394 |
|
#endif |
395 |
|
|
396 |
< |
#if PMAP_SIGUSR |
396 |
> |
#ifdef PMAP_SIGUSR |
397 |
|
signal(SIGUSR1, sigUsrDiags); |
398 |
|
#endif |
399 |
< |
|
399 |
> |
|
400 |
> |
#ifdef DEBUG_PMAP |
401 |
|
/* Output child process PID after random delay to prevent corrupted |
402 |
|
* console output due to race condition */ |
403 |
|
usleep(1e6 * pmapRandom(rouletteState)); |
404 |
< |
fprintf(stderr, "Proc %d: PID = %d\n", proc, getpid()); |
404 |
> |
fprintf(stderr, "Proc %d: PID = %d " |
405 |
> |
"(waiting 10 sec to attach debugger...)\n", |
406 |
> |
proc, getpid()); |
407 |
|
/* Allow time for debugger to attach to child process */ |
408 |
|
sleep(10); |
409 |
+ |
#endif |
410 |
|
|
411 |
|
/* ============================================================= |
412 |
|
* 2-PASS PHOTON DISTRIBUTION |
414 |
|
* Pass 2 (main): based on outcome of pass 1, estimate remaining |
415 |
|
* number of photons to emit to approximate target |
416 |
|
* count |
417 |
< |
* ============================================================= */ |
417 |
> |
* ============================================================= */ |
418 |
|
for (srcIdx = 0; srcIdx < nsources; srcIdx++) { |
419 |
|
#ifndef PMAP_SIGUSR |
420 |
|
unsigned portCnt, passCnt = 0, prePassCnt = 0; |