--- ray/src/rt/rxcmain.cpp 2024/12/23 18:14:20 2.12 +++ ray/src/rt/rxcmain.cpp 2025/03/05 17:29:57 2.16 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rxcmain.cpp,v 2.12 2024/12/23 18:14:20 greg Exp $"; +static const char RCSid[] = "$Id: rxcmain.cpp,v 2.16 2025/03/05 17:29:57 greg Exp $"; #endif /* * rxcmain.c - main for rxcontrib ray contribution tracer @@ -47,8 +47,7 @@ printdefaults(void) /* print default values to stdou if (myRCmanager.HasFlag(RTimmIrrad)) printf("-I+\t\t\t\t# immediate irradiance on\n"); printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc); - if (myRCmanager.xres > 0) - printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres); + printf("-x %-9d\t\t\t# x resolution\n", myRCmanager.xres); printf("-y %-9d\t\t\t# y resolution\n", myRCmanager.yres); printf(myRCmanager.HasFlag(RTlimDist) ? "-ld+\t\t\t\t# limit distance on\n" : @@ -56,7 +55,7 @@ printdefaults(void) /* print default values to stdou printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n", inpfmt, outfmt, formstr(inpfmt), formstr(outfmt)); if (report_intvl > 0) - printf("-t %-9d\t\t\t# time between reports\n", report_intvl); + printf("-t %-9d\t\t\t# time between reports\n", report_intvl); printf(erract[WARNING].pf != NULL ? "-w+\t\t\t\t# warning messages on\n" : "-w-\t\t\t\t# warning messages off\n"); @@ -75,7 +74,7 @@ onsig( /* fatal signal */ _exit(signo); #ifdef SIGALRM - alarm(180); /* allow 3 minutes to clean up */ + alarm(600); /* allow 10 minutes to clean up */ signal(SIGALRM, SIG_DFL); /* make certain we do die */ #endif eputs("signal - "); @@ -345,6 +344,11 @@ main(int argc, char *argv[]) myRCmanager.LoadOctree(argv[argc-1]); // add to header myRCmanager.AddHeader(argc-1, argv); + { + char buf[128] = "SOFTWARE= "; + strcpy(buf+10, VersionID); + myRCmanager.AddHeader(buf); + } // prepare output files if (recover) myRCmanager.outOp = RCOrecover; @@ -509,10 +513,10 @@ rxcontrib(const int rstart) r++; if (report_intvl <= 0) continue; - tnow = time(0); // time to report progress? - if (r == totRows) // finished? + if (r == totRows) // need to finish up? myRCmanager.SetThreadCount(1); - else if (tnow < last_report+report_intvl) + tnow = time(0); + if ((r < totRows) & (tnow < last_report+report_intvl)) continue; sprintf(errmsg, "%.2f%% done after %.3f hours\n", 100.*myRCmanager.GetRowFinished()/totRows, @@ -568,8 +572,7 @@ quit( int code ) { - if (!code && myRCmanager.Ready()) // clean up on normal exit - code = myRCmanager.Cleanup(); + myRCmanager.FlushQueue(); // leave nothing in queue exit(code); }