Commit 936821c4 authored by Anthony Chan's avatar Anthony Chan
Browse files

[svn-r5688] added count=0 case for both C and forttran version of reduce_local test.

parent 42eeeb1d
......@@ -51,8 +51,7 @@ int main( int argc, char *argv[] )
inbuf = malloc(sizeof(int) * MAX_BUF_ELEMENTS);
inoutbuf = malloc(sizeof(int) * MAX_BUF_ELEMENTS);
for (count = 1; count < MAX_BUF_ELEMENTS; count *= 2) {
for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) {
for (i = 0; i < count; ++i) {
inbuf[i] = i;
inoutbuf[i] = i;
......@@ -68,7 +67,7 @@ int main( int argc, char *argv[] )
/* make sure that user-define ops work too */
MPI_Op_create(&user_op, 0/*!commute*/, &uop);
for (count = 1; count < MAX_BUF_ELEMENTS; count *= 2) {
for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) {
for (i = 0; i < count; ++i) {
inbuf[i] = i;
inoutbuf[i] = i;
......
......@@ -39,7 +39,7 @@ C
call mtest_init(ierr)
count = 1
count = 0
do while (count .le. max_buf_size )
do ii = 1,count
vin(ii) = ii
......@@ -56,12 +56,16 @@ C Check if the result is correct
errs = errs + 1
endif
enddo
count = count + count
if ( count .gt. 0 ) then
count = count + count
else
count = 1
endif
enddo
call mpi_op_create( user_op, .false., myop, ierr )
count = 1
count = 0
do while (count .le. max_buf_size)
do ii = 1, count
vin(ii) = ii
......@@ -78,7 +82,11 @@ C Check if the result is correct
errs = errs + 1
endif
enddo
count = count + count
if ( count .gt. 0 ) then
count = count + count
else
count = 1
endif
enddo
call mpi_op_free( myop, ierr )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment