--- ray/src/util/rad.c 2010/05/18 04:24:17 2.94 +++ ray/src/util/rad.c 2010/05/28 17:29:14 2.97 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.94 2010/05/18 04:24:17 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.97 2010/05/28 17:29:14 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -1358,13 +1358,17 @@ rpict( /* run rpict and pfilt for each view */ /* parallel running? */ if (do_rpiece) { if (rfdt < oct1date || !fdate(sfile)) { + int xdiv = 8+nprocs/3, ydiv = 8+nprocs/3; rfdt = 0; /* start fresh */ + if (!silent) + printf("\techo %d %d > %s\n", + xdiv, ydiv, sfile); if ((fp = fopen(sfile, "w")) == NULL) { fprintf(stderr, "%s: cannot create\n", sfile); quit(1); } - fprintf(fp, "%d %d\n", 8+nprocs/3, 8+nprocs/3); + fprintf(fp, "%d %d\n", xdiv, ydiv); fclose(fp); } } else if (next_process()) { @@ -1396,11 +1400,19 @@ rpict( /* run rpict and pfilt for each view */ "%s%s %s%s -x 64 -y 64 -ps 1 %s > %s", c_rpict, rep, vw, opts, oct1name, overfile); + if (do_rpiece) + while (children_running < nprocs-1 && + next_process()) + sleep(5); if (runcom(combuf)) { fprintf(stderr, "%s: error in overture for view %s\n", progname, vs); quit(1); + } + if (do_rpiece) { + finish_process(); + wait_process(1); } #ifndef NULL_DEVICE rmfile(overfile);