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