Changeset 5688

Show
Ignore:
Timestamp:
11/04/09 14:48:36 (3 weeks ago)
Author:
chan
Message:

added count=0 case for both C and forttran version of reduce_local test.

Location:
mpich2/trunk/test/mpi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/test/mpi/coll/reduce_local.c

    r5676 r5688  
    5252    inoutbuf = malloc(sizeof(int) * MAX_BUF_ELEMENTS); 
    5353 
    54  
    55     for (count = 1; count < MAX_BUF_ELEMENTS; count *= 2) { 
     54    for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) { 
    5655        for (i = 0; i < count; ++i) { 
    5756            inbuf[i] = i; 
     
    6968    /* make sure that user-define ops work too */ 
    7069    MPI_Op_create(&user_op, 0/*!commute*/, &uop); 
    71     for (count = 1; count < MAX_BUF_ELEMENTS; count *= 2) { 
     70    for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) { 
    7271        for (i = 0; i < count; ++i) { 
    7372            inbuf[i] = i; 
  • mpich2/trunk/test/mpi/f77/coll/reducelocalf.f

    r5677 r5688  
    4040      call mtest_init(ierr) 
    4141 
    42       count = 1 
     42      count = 0 
    4343      do while (count .le. max_buf_size ) 
    4444         do ii = 1,count 
     
    5757            endif 
    5858         enddo  
    59          count = count + count 
     59         if ( count .gt. 0 ) then 
     60            count = count + count 
     61         else 
     62            count = 1 
     63         endif 
    6064      enddo 
    6165 
    6266      call mpi_op_create( user_op, .false., myop, ierr ) 
    6367 
    64       count = 1 
     68      count = 0 
    6569      do while (count .le. max_buf_size)  
    6670         do ii = 1, count 
     
    7983            endif 
    8084         enddo 
    81          count = count + count 
     85         if ( count .gt. 0 ) then 
     86            count = count + count 
     87         else 
     88            count = 1 
     89         endif 
    8290      enddo 
    8391