Changeset 4875

Show
Ignore:
Timestamp:
06/30/09 16:14:38 (5 months ago)
Author:
rross
Message:

fix for bug similar to #664 in block indexed flatten code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/mpid/common/datatype/dataloop/segment_ops.c

    r4874 r4875  
    823823             */ 
    824824            last_end = (char*) MPI_AINT_CAST_TO_VOID_PTR 
    825                        (paramp->disps[last_idx] + ((DLOOP_Offset) paramp->blklens[last_idx])); 
     825                       (paramp->disps[last_idx] + 
     826                        ((DLOOP_Offset) paramp->blklens[last_idx])); 
    826827        } 
    827828 
     
    836837             * the end of the last one. 
    837838             */ 
    838             *blocks_p -= ((DLOOP_Offset) blocks_left + (((DLOOP_Offset) size) / el_size)); 
    839 #ifdef MPID_SP_VERBOSE 
    840             MPIU_dbg_printf("\t[vector to vec exiting (1): next ind = %d, %d blocks processed.\n", 
    841                             paramp->u.pack_vector.index, 
    842                             (int) *blocks_p); 
    843 #endif 
     839            *blocks_p -= ((DLOOP_Offset) blocks_left + 
     840                          (((DLOOP_Offset) size) / el_size)); 
    844841            return 1; 
    845842        } 
     
    850847        } 
    851848        else { 
    852             /* Since bufp can be a displacement and can be negative, we cannot use 
    853              * MPI_VOID_PTR_CAST_TO_MPI_AINT to cast the sum to a pointer.  Just let it 
    854              * sign extend. 
     849            /* Since bufp can be a displacement and can be negative, we cannot 
     850             * use MPI_VOID_PTR_CAST_TO_MPI_AINT to cast the sum to a pointer. 
     851             * Just let it sign extend. 
    855852             */ 
    856             paramp->disps[last_idx+1]   = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp + rel_off + offsetarray[last_idx+1]; 
     853            paramp->disps[last_idx+1]   = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp +  
     854                rel_off + offsetarray[i]; 
    857855            paramp->blklens[last_idx+1] = size; 
    858856            paramp->index++; 
    859857        } 
    860  
    861         rel_off += offsetarray[i]; 
    862     } 
    863  
    864 #ifdef MPID_SP_VERBOSE 
    865     MPIU_dbg_printf("\t[vector to vec exiting (2): next ind = %d, " MPI_AINT_FMT_DEC_SPEC " blocks processed.\n", 
    866                     paramp->u.pack_vector.index, 
    867                     *blocks_p); 
    868 #endif 
     858    } 
    869859 
    870860    /* if we get here then we processed ALL the blocks; don't need to update 
    871861     * blocks_p 
    872862     */ 
    873  
    874863    DLOOP_Assert(blocks_left == 0); 
    875864    return 0;