27 |
|
|
28 |
|
int rand_samp = 1; /* pure Monte Carlo sampling? */ |
29 |
|
|
30 |
< |
double dstrsrc = 0.0; /* square source distribution */ |
30 |
> |
double dstrsrc = 0.9; /* square source distribution */ |
31 |
|
double shadthresh = .03; /* shadow threshold */ |
32 |
|
double shadcert = .75; /* shadow certainty */ |
33 |
|
int directrelay = 3; /* number of source relays */ |
137 |
|
} |
138 |
|
|
139 |
|
|
140 |
< |
/* add modifiers from a file list */ |
140 |
> |
/* Add modifiers from a file list */ |
141 |
|
void |
142 |
|
addmodfile(char *fname, char *outf, char *binv, int bincnt) |
143 |
|
{ |
159 |
|
) |
160 |
|
{ |
161 |
|
if (nchild > 0) /* close children if any */ |
162 |
< |
end_children(); |
162 |
> |
end_children(code != 0); |
163 |
|
exit(code); |
164 |
|
} |
165 |
|
|
178 |
|
/* set shared memory boundary */ |
179 |
|
shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY"); |
180 |
|
} |
181 |
– |
if ((nproc > 1) & (accumulate <= 0)) |
182 |
– |
put_zero_record(0); /* prime our queue to accumulate */ |
183 |
– |
|
181 |
|
if (yres > 0) { /* set up flushing & ray counts */ |
182 |
|
if (xres > 0) |
183 |
|
raysleft = (RNUMBER)xres*yres; |
196 |
|
return; /* return to main processing loop */ |
197 |
|
|
198 |
|
if (recover) { /* recover previous output? */ |
199 |
< |
if (accumulate <= 0) { |
199 |
> |
if (accumulate <= 0) |
200 |
|
reload_output(); |
201 |
< |
if (nproc > 1) |
205 |
< |
queue_modifiers(); |
206 |
< |
} else |
201 |
> |
else |
202 |
|
recover_output(); |
203 |
|
} |
204 |
|
if (nproc == 1) /* single process? */ |
205 |
|
return; |
206 |
< |
|
207 |
< |
parental_loop(); /* else run controller */ |
206 |
> |
/* else run appropriate controller */ |
207 |
> |
if (accumulate <= 0) |
208 |
> |
feeder_loop(); |
209 |
> |
else |
210 |
> |
parental_loop(); |
211 |
|
quit(0); /* parent musn't return! */ |
212 |
|
} |
213 |
|
|
336 |
|
if (raysleft && !--raysleft) |
337 |
|
break; /* preemptive EOI */ |
338 |
|
} |
339 |
< |
if (nchild != -1 && (accumulate <= 0) | (account < accumulate)) { |
339 |
> |
if ((accumulate <= 0) | (account < accumulate)) { |
340 |
|
if (account < accumulate) { |
341 |
|
error(WARNING, "partial accumulation in final record"); |
342 |
|
accumulate -= account; |
344 |
|
account = 1; /* output accumulated totals */ |
345 |
|
done_contrib(); |
346 |
|
} |
347 |
+ |
lu_done(&ofiletab); /* close output files */ |
348 |
|
if (raysleft) |
349 |
|
error(USER, "unexpected EOF on input"); |
351 |
– |
lu_done(&ofiletab); /* close output files */ |
350 |
|
} |