Ignore:
Timestamp:
06/05/18 19:14:40 (3 years ago)
Author:
yushan
Message:

Test_client 6*8 clients 2 servers OK. TO DO : intercomm->intracomm, comm_free_intercomm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/ep_dev/main.cpp

    r1518 r1522  
    852852 
    853853      if(rank == 0) printf("            \t Test iP2P for intercomm \t OK\n"); 
     854       
     855       
    854856 
    855857 
     
    888890      MPI_Comm_size(inter_comm_dup_merged, &inter_comm_dup_merged_size); 
    889891 
    890       printf("rank = %d, inter_comm_dup_merged_rank = %d, inter_comm_dup_merged_size = %d\n", rank, inter_comm_dup_merged_rank, inter_comm_dup_merged_size); 
     892      //printf("rank = %d, inter_comm_dup_merged_rank = %d, inter_comm_dup_merged_size = %d\n", rank, inter_comm_dup_merged_rank, inter_comm_dup_merged_size); 
     893       
     894      // TEST OF TESTALL 
     895       
     896        int merged_size, merged_rank; 
     897        MPI_Comm_rank(inter_comm_dup_merged, &merged_rank); 
     898        MPI_Comm_size(inter_comm_dup_merged, &merged_size); 
     899         
     900        int left = merged_rank>0? merged_rank-1 : merged_size-1; 
     901        int right = (merged_rank+1) % merged_size; 
     902         
     903        //printf("rank = %d, left = %d, right = %d\n", merged_rank, left, right); 
     904         
     905        int N=10000; 
     906        int *left_buf = new int[N]; 
     907        int *right_buf = new int[N]; 
     908                 
     909        for(int i=0; i<N; i++) 
     910        { 
     911          right_buf[i] = merged_rank*100000+i; 
     912        } 
     913         
     914        MPI_Request request[2]; 
     915        MPI_Status status[2]; 
     916         
     917        MPI_Irecv(left_buf, N, MPI_INT, left, 0, inter_comm_dup_merged, &request[0]); 
     918        MPI_Isend(right_buf, N, MPI_INT, right, 0, inter_comm_dup_merged, &request[1]); 
     919         
     920         
     921        int flag; 
     922        MPI_Testall(2, request, &flag, status); 
     923       
     924        printf("rank = %d, flag = %d\n", merged_rank, flag); 
     925         
     926        while(!flag) MPI_Testall(2, request, &flag, status); 
     927        //if(!flag)  MPI_Waitall(2, request, status); 
     928         
     929        int recv_count; 
     930        MPI_Get_count(&status[0], MPI_INT, &recv_count); 
     931         
     932        MPI_Barrier(inter_comm_dup_merged); 
     933         
     934        printf("rank = %d, recv_count = %d, left_buf[5-10] = %d\t%d\t%d\t%d\t%d\t%d\n", merged_rank, recv_count, left_buf[5], left_buf[6], left_buf[7], left_buf[8], left_buf[9], left_buf[10]); 
     935                         
     936        delete[] left_buf; 
     937        delete[] right_buf; 
     938       
     939       
    891940 
    892941      // TEST OF GATHER 
     
    9611010 
    9621011      // TEST OF EXSCAN 
    963       { 
     1012      /*{ 
    9641013  
    9651014        std::vector<int>sendbuf(2, inter_comm_dup_merged_rank); 
     
    9881037        if(inter_comm_dup_merged_rank == 0 && exscan_result)  printf("            \t test MPI_Exscan for merged comm \t OK\n"); 
    9891038        if(inter_comm_dup_merged_rank == 0 && !exscan_result) printf("            \t test MPI_Exscan for merged comm \t FAILED %d\n", exscan_result); 
    990       } 
     1039      }*/ 
    9911040 
    9921041      // TEST OF SCATTERV 
Note: See TracChangeset for help on using the changeset viewer.