9 |
|
*/ |
10 |
|
|
11 |
|
#include "rholo.h" |
12 |
+ |
#include "random.h" |
13 |
|
#include "paths.h" |
14 |
|
#include <signal.h> |
15 |
|
#include <sys/types.h> |
62 |
|
int force = 0; |
63 |
|
/* mark start time */ |
64 |
|
starttime = time(NULL); |
65 |
+ |
initurand(10240); /* initialize urand */ |
66 |
|
progname = argv[0]; /* get arguments */ |
67 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
68 |
|
switch (argv[i][1]) { |
371 |
|
vval(OBSTRUCTIONS) = "T"; |
372 |
|
vdef(OBSTRUCTIONS)++; |
373 |
|
} |
374 |
+ |
if (!vdef(VDIST)) { |
375 |
+ |
vval(VDIST) = "F"; |
376 |
+ |
vdef(VDIST)++; |
377 |
+ |
} |
378 |
|
if (!vdef(OCCUPANCY)) { |
379 |
|
vval(OCCUPANCY) = "U"; |
380 |
|
vdef(OCCUPANCY)++; |
469 |
|
done_packets(pl) /* handle finished packets */ |
470 |
|
PACKET *pl; |
471 |
|
{ |
472 |
< |
static int nunflushed = 0; |
472 |
> |
static int n2flush = 0; |
473 |
|
register PACKET *p; |
474 |
|
|
475 |
|
while (pl != NULL) { |
480 |
|
p->nr*sizeof(RAYVAL)); |
481 |
|
if (outdev != NULL) /* display it */ |
482 |
|
disp_packet((PACKHEAD *)p); |
483 |
< |
else |
484 |
< |
nunflushed += p->nr; |
483 |
> |
if (hdcachesize <= 0) /* manual flushing */ |
484 |
> |
n2flush += p->nr; |
485 |
|
nraysdone += p->nr; |
486 |
|
npacksdone++; |
487 |
|
} |
489 |
|
p->next = freepacks; |
490 |
|
freepacks = p; |
491 |
|
} |
492 |
< |
if (nunflushed >= 256*RPACKSIZ) { |
492 |
> |
if (n2flush > 512*RPACKSIZ*ncprocs) { |
493 |
|
hdflush(NULL); /* flush holodeck buffers */ |
494 |
< |
nunflushed = 0; |
494 |
> |
n2flush = 0; |
495 |
|
} |
496 |
|
} |
497 |
|
|