ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rtcontrib.c
(Generate patch)

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.40 by greg, Sun Feb 5 22:22:21 2006 UTC vs.
Revision 1.44 by greg, Thu Nov 15 18:32:34 2007 UTC

# Line 101 | Line 101 | struct rtproc {
101                                          /* rtrace command and defaults */
102   char            *rtargv[256+2*MAXMODLIST] = { "rtrace",
103                                  "-dj", ".5", "-dr", "3",
104 <                                "-ab", "1", "-ad", "128", };
104 >                                "-ab", "1", "-ad", "350", };
105  
106   int  rtargc = 9;
107                                          /* overriding rtrace options */
# Line 115 | Line 115 | struct rtproc  rt0;                    /* head of rtrace process list */
115  
116   struct rtproc   *rt_unproc = NULL;      /* unprocessed ray trees */
117  
118 < char    persistfn[] = "pfXXXXXX";       /* persist file name */
118 > #define PERSIST_NONE    0               /* no persist file */
119 > #define PERSIST_SINGLE  1               /* user set -P persist */
120 > #define PERSIST_PARALL  2               /* user set -PP persist */
121 > #define PERSIST_OURS    3               /* -PP persist belongs to us */
122 > int     persist_state = PERSIST_NONE;   /* persist file state */
123 > char    persistfn[] = "pfXXXXXX";       /* our persist file name, if set */
124  
125   int             gargc;                  /* global argc */
126   char            **gargv;                /* global argv */
# Line 348 | Line 353 | main(int argc, char *argv[])
353                                  addmodfile(argv[i], curout, binval, bincnt);
354                                  continue;
355                          case 'P':               /* persist file */
356 <                                error(USER, "persist file is automatic");
357 <                                break;
356 >                                if (i >= argc-2) break;
357 >                                persist_state = (argv[i][2] == 'P') ?
358 >                                                PERSIST_PARALL : PERSIST_SINGLE;
359 >                                rtargv[rtargc++] = argv[i];
360 >                                rtargv[rtargc++] = argv[++i];
361 >                                continue;
362                          }
363                  rtargv[rtargc++] = argv[i];     /* assume rtrace option */
364          }
# Line 389 | Line 398 | main(int argc, char *argv[])
398                  exit(1);
399          }
400          if (nprocs > 1) {       /* add persist file if parallel */
401 <                rtargv[rtargc++] = "-PP";
402 <                rtargv[rtargc++] = mktemp(persistfn);
401 >                if (persist_state == PERSIST_SINGLE)
402 >                        error(USER, "use -PP option for multiple processes");
403 >                if (persist_state == PERSIST_NONE) {
404 >                        rtargv[rtargc++] = "-PP";
405 >                        rtargv[rtargc++] = mktemp(persistfn);
406 >                        persist_state = PERSIST_OURS;
407 >                }
408          }
409                                  /* add format string */
410          sprintf(fmt, "-f%cf", inpfmt);
# Line 450 | Line 464 | quit(int status)
464   {
465          int     rtstat;
466  
467 <        if (rt0.next != NULL)           /* terminate persistent rtrace */
467 >        if (persist_state == PERSIST_OURS)  /* terminate persistent rtrace */
468                  killpersist();
469                                          /* clean up rtrace process(es) */
470          rtstat = done_rprocs(&rt0);
# Line 567 | Line 581 | addmodifier(char *modn, char *outf, char *binv, int bi
581                  mp = growmodifier(mp, bincnt);
582          lep->data = (char *)mp;
583                                          /* allocate output streams */
584 <        for (i = outf==NULL || outf[0]=='!' ? 0 : bincnt; i--; )
584 >        for (i = outf==NULL || outf[0]=='!' ? 0 : bincnt; i-- > 0; )
585                  getostream(mp->outspec, mp->modname, i, 1);
586          return mp;
587   }
# Line 1132 | Line 1146 | myseeko(const LUENT *e, void *p)
1146                  sprintf(errmsg, "seek error on file '%s'", e->key);
1147                  error(SYSTEM, errmsg);
1148          }
1149 +        return 0;
1150   }
1151  
1152   /* recover output if possible */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines