--- ray/src/hd/rholo.c 1998/01/28 12:32:50 3.38 +++ ray/src/hd/rholo.c 1998/12/10 10:47:29 3.43 @@ -26,8 +26,6 @@ char *progname; /* our program name */ char *hdkfile; /* holodeck file name */ char froot[256]; /* root file name */ -int nowarn = 0; /* turn warnings off? */ - int ncprocs = 0; /* desired number of compute processes */ char *outdev = NULL; /* output device name */ @@ -55,6 +53,8 @@ int totqlen; /* maximum queue length when full */ char *sigerr[NSIG]; /* signal error messages */ +extern int nowarn; /* turn warnings off? */ + extern time_t time(); @@ -367,7 +367,7 @@ register HDGRID *gp; for (i = 0; i < 3; i++) len[i] = VLEN(gp->xv[i]); if (!vdef(GRID)) { - d = 2/5e5*( len[0]*len[0]*(len[1]*len[1] + + d = 2/2e5*( len[0]*len[0]*(len[1]*len[1] + len[2]*len[2] + 4*len[1]*len[2]) + len[1]*len[1]*len[2]*(len[2] + 4*len[0]) + 4*len[0]*len[1]*len[2]*len[2] ); @@ -420,6 +420,7 @@ HDGRID *gp; } +int headline(s) /* process information header line */ char *s; { @@ -433,7 +434,7 @@ char *s; HOLOFMT, hdkfile, FMTSTR, fmt); error(USER, errmsg); } - return; + return(0); } for (cp = s; *cp; cp++) /* take off any comments */ if (*cp == '#') { @@ -441,6 +442,7 @@ char *s; break; } setvariable(s, matchvar); /* don't flag errors */ + return(0); } @@ -453,8 +455,8 @@ loadholo() /* start loading a holodeck from fname */ int4 nextloc; /* open holodeck file */ if ((fp = fopen(hdkfile, ncprocs>0 ? "r+" : "r")) == NULL) { - sprintf(errmsg, "cannot open \"%s\" for %s", hdkfile, - ncprocs>0 ? "appending" : "reading"); + sprintf(errmsg, "cannot %s \"%s\"", + ncprocs>0 ? "append" : "read", hdkfile); error(SYSTEM, errmsg); } /* load variables from header */ @@ -504,8 +506,15 @@ PACKET *pl; p->next = freepacks; /* push onto free list */ freepacks = p; } +#if MAXQTIME if (n2flush > 300/MAXQTIME*totqlen) { - hdflush(NULL); /* flush holodeck buffers */ +#else + if (n2flush > 50*totqlen) { +#endif + if (outdev == NULL) + hdflush(NULL); /* flush holodeck buffers */ + else + hdsync(NULL, 1); /* sync holodeck file */ n2flush = 0; } } @@ -550,14 +559,6 @@ register char *s; fflush(stderr); midline = 0; } -} - - -wputs(s) /* put warning string to stderr */ -char *s; -{ - if (!nowarn) - eputs(s); }