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

Comparing ray/src/util/pvsum.c (file contents):
Revision 2.11 by greg, Thu Oct 30 04:44:45 2025 UTC vs.
Revision 2.12 by greg, Thu Oct 30 16:47:13 2025 UTC

# Line 624 | Line 624 | multi_process(void)
624          while (++coff < nprocs) {
625                  int     st;
626                  if (wait(&st) < 0) {
627 <                        fprintf(stderr, "%s: warning - wait() call failed unexpectedly\n", gargv[0]);
627 >                        fprintf(stderr, "%s: warning - child disappeared\n", gargv[0]);
628                          break;
629                  }
630 <                if (st) c = st;
630 >                if (st) {
631 >                        fprintf(stderr, "%s: bad exit status from child\n", gargv[0]);
632 >                        c = st;
633 >                }
634          }
635          return(c == 0);
636   writerr:
# Line 719 | Line 722 | badopt:                        fprintf(stderr, "%s: bad option: %s\n", argv
722          if (cacheGB > 1e-4) {           /* figure out # of passes => rintvl */
723                  size_t  inp_bytes = (in_type==DTfloat ? sizeof(float)*ncomp
724                                                  : (size_t)(ncomp+1)) * xres*yres;
725 <                size_t  mem_bytes = sizeof(float)*ncomp*xres*yres;
725 >                size_t  over_bytes = sizeof(float)*ncomp*xres*yres +
726 >                                        2*(out_type==DTfloat ? sizeof(float)*ncomp
727 >                                                : (size_t)(ncomp+1)) * xres*yres;
728                  int     npasses = (double)inp_bytes*cmtx->nrows /
729 <                                (cacheGB*(1L<<30) - (double)mem_bytes*nprocs) + 1;
730 <                if ((npasses <= 0) | (npasses*8 >= cmtx->nrows))
731 <                        npasses = 1;    /* let's not go there... */
729 >                                (cacheGB*(1L<<30) - (double)over_bytes*nprocs) + 1;
730 >                if ((npasses <= 0) | (npasses*6 >= cmtx->nrows)) {
731 >                        fprintf(stderr,
732 >                            "%s: warning - insufficient cache space for multi-pass\n",
733 >                                        argv[0]);
734 >                        npasses = 1;
735 >                }
736                  rintvl = cmtx->nrows / npasses;
737                  rintvl += (rintvl*npasses < cmtx->nrows);
738          } else
739                  rintvl = cmtx->nrows;
740 <                                        /* make our passes */
740 >                                        /* make our output accumulation passes */
741          for (row0 = 0; row0 < cmtx->nrows; row0 += rintvl) {
742                  if ((rowN = row0 + rintvl) > cmtx->nrows)
743                          rowN = cmtx->nrows;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)