Ignore:
Timestamp:
06/12/18 14:21:57 (6 years ago)
Author:
yushan
Message:

add modif for workflow_cmip6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_exscan.cpp

    r1539 r1540  
    122122          reduce_sum<unsigned long>(static_cast<unsigned long*>(comm->my_buffer->void_buffer[i]), static_cast<unsigned long*>(recvbuf), count);     
    123123      } 
    124  
    125       else printf("datatype Error\n"); 
    126  
    127124       
     125      else if(datatype == MPI_LONG_LONG_INT ) 
     126      { 
     127        assert(datasize == sizeof(long long int)); 
     128        for(int i=0; i<ep_rank_loc; i++) 
     129          reduce_sum<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count);     
     130      } 
     131 
     132      else  
     133      { 
     134        printf("datatype Error in ep_exscan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 
     135        MPI_Abort(comm, 0); 
     136      } 
     137 
     138       
    128139    } 
    129140 
     
    172183      } 
    173184      
    174       else printf("datatype Error\n"); 
    175     } 
    176  
    177     else //if(op == MPI_MIN) 
     185      else if(datatype == MPI_LONG_LONG_INT ) 
     186      { 
     187        assert(datasize == sizeof(long long int)); 
     188        for(int i=0; i<ep_rank_loc; i++) 
     189          reduce_max<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count);     
     190      } 
     191 
     192      else  
     193      { 
     194        printf("datatype Error in ep_exscan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 
     195        MPI_Abort(comm, 0); 
     196      } 
     197    } 
     198 
     199    else if(op == MPI_MIN) 
    178200    { 
    179201      if(datatype == MPI_INT ) 
     
    219241      } 
    220242 
    221       else printf("datatype Error\n"); 
     243      else if(datatype == MPI_LONG_LONG_INT ) 
     244      { 
     245        assert(datasize == sizeof(long long int)); 
     246        for(int i=0; i<ep_rank_loc; i++) 
     247          reduce_min<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count);     
     248      } 
     249 
     250      else  
     251      { 
     252        printf("datatype Error in ep_exscan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 
     253        MPI_Abort(comm, 0); 
     254      } 
     255    } 
     256     
     257    else 
     258    { 
     259      printf("op type Error in ep_exscan : MPI_MAX, MPI_MIN, MPI_SUM\n"); 
     260      MPI_Abort(comm, 0); 
    222261    } 
    223262 
     
    231270    if(comm->is_intercomm) return MPI_Exscan_intercomm(sendbuf, recvbuf, count, datatype, op, comm); 
    232271     
    233     valid_type(datatype); 
     272    assert(valid_type(datatype)); 
     273    assert(valid_op(op)); 
    234274 
    235275    int ep_rank = comm->ep_comm_ptr->size_rank_info[0].first; 
Note: See TracChangeset for help on using the changeset viewer.