| 63 |
|
int bsiz; /* ray tree buffer length */ |
| 64 |
|
char *buf; /* ray tree buffer */ |
| 65 |
|
int nbr; /* number of bytes from rtrace */ |
| 66 |
< |
}; /* rtrace process */ |
| 66 |
> |
}; /* rtrace process buffer */ |
| 67 |
|
|
| 68 |
|
/* rtrace command and defaults */ |
| 69 |
|
char *rtargv[256] = { "rtrace", "-dt", "0", "-dj", ".5", "-dr", "3", |
| 79 |
|
struct rtproc *rt_unproc = NULL; /* unprocessed ray trees */ |
| 80 |
|
|
| 81 |
|
char persistfn[] = "pfXXXXXX"; /* persist file name */ |
| 82 |
– |
char fmt[8]; /* rtrace i/o format */ |
| 82 |
|
|
| 83 |
|
int gargc; /* global argc */ |
| 84 |
|
char **gargv; /* global argv */ |
| 106 |
|
|
| 107 |
|
MODCONT *addmodifier(char *modn, char *outf, char *binv); |
| 108 |
|
|
| 110 |
– |
int done_rprocs(struct rtproc *rtp); |
| 109 |
|
void init(int np); |
| 110 |
< |
void tracecontribs(FILE *fp); |
| 110 |
> |
int done_rprocs(struct rtproc *rtp); |
| 111 |
> |
void trace_contribs(FILE *fp); |
| 112 |
|
struct rtproc *wait_rproc(void); |
| 113 |
|
struct rtproc *get_rproc(void); |
| 114 |
|
void queue_raytree(struct rtproc *rtp); |
| 158 |
|
int nprocs = 1; |
| 159 |
|
char *curout = NULL; |
| 160 |
|
char *binval = NULL; |
| 161 |
+ |
char fmt[8]; |
| 162 |
|
int i, j; |
| 163 |
|
/* global program name */ |
| 164 |
|
gargv = argv; |
| 269 |
|
execv(rtpath, rtargv); |
| 270 |
|
perror(rtpath); /* execv() should not return */ |
| 271 |
|
exit(1); |
| 272 |
< |
} else if (nprocs > 1) { /* add persist file if parallel */ |
| 272 |
> |
} |
| 273 |
> |
if (nprocs > 1) { /* add persist file if parallel */ |
| 274 |
|
rtargv[rtargc++] = "-PP"; |
| 275 |
|
rtargv[rtargc++] = mktemp(persistfn); |
| 276 |
|
} |
| 284 |
|
rtargv[rtargc] = NULL; |
| 285 |
|
/* start rtrace & compute contributions */ |
| 286 |
|
init(nprocs); |
| 287 |
< |
tracecontribs(stdin); |
| 287 |
> |
trace_contribs(stdin); |
| 288 |
|
quit(0); |
| 289 |
|
} |
| 290 |
|
|
| 336 |
|
exit(status); /* flushes all output streams */ |
| 337 |
|
} |
| 338 |
|
|
| 339 |
< |
/* start rtrace and initialize buffers */ |
| 339 |
> |
/* start rtrace processes and initialize */ |
| 340 |
|
void |
| 341 |
|
init(int np) |
| 342 |
|
{ |
| 843 |
|
|
| 844 |
|
/* trace ray contributions (main loop) */ |
| 845 |
|
void |
| 846 |
< |
tracecontribs(FILE *fin) |
| 846 |
> |
trace_contribs(FILE *fin) |
| 847 |
|
{ |
| 848 |
|
char inpbuf[128]; |
| 849 |
|
int iblen; |