Changes in src/mpi_mod.f90 [6ecb30a:aa8c34a] in flexpart.git


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mpi_mod.f90

    r6ecb30a raa8c34a  
    5959!                                                                            *
    6060!*****************************************************************************
    61 !                                                                            *
    62 ! Modification by DJM, 2017-05-09 - added #ifdef USE_MPIINPLACE cpp          *
    63 ! directive to mpif_tm_reduce_grid() to insure that MPI_IN_PLACE is          *
    64 ! used in the MPI_Reduce() only if specifically compiled with that           *
    65 ! directive.                                                                 *
    66 !                                                                            *
    67 !*****************************************************************************
    6861
    6962  use mpi
     
    16581651      write(*,*) "#### mpi_mod::mpif_gf_send_vars_async> ERROR: &
    16591652           & invalid memstat"
     1653      mind=-1
     1654      stop
    16601655    end if
    16611656
     
    20332028      write(*,*) "#### mpi_mod::mpif_gf_send_vars_nest_async> ERROR: &
    20342029           & invalid memstat"
     2030      mind=-1
     2031      stop
    20352032    end if
    20362033
     
    24282425
    24292426! 2) Using in-place reduction
    2430 
    2431 !!!--------------------------------------------------------------------
    2432 !!! DJM - 2017-05-09 change - MPI_IN_PLACE option for MPI_Reduce() causes
    2433 !!! severe numerical problems in some cases.  I'm guessing there are memory
    2434 !!! overrun issues in this complex code, but have so far failed to identify
    2435 !!! a specific problem.  And/or, when one searches the Internet for this
    2436 !!! issue, there is "some" hint that the implementation may be buggy. 
    2437 !!!
    2438 !!! At this point, with the following CPP USE_MPIINPLACE directive, the
    2439 !!! default behaviour will be to not use the MPI_IN_PLACE option.
    2440 !!! Users will have to compile with -DUSE_MPIINPLACE if they want that option.
    2441 !!! Introduction of the CPP directives also requires that the code be compiled
    2442 !!! with the "-x f95-cpp-input" option.
    2443 !!!
    2444 !!! Modification of this section requires the addition of array gridunc0, which
    2445 !!! requires an allocation in outgrid_init.f90 and initial declaration in
    2446 !!! unc_mod.f90.
    2447 !!!--------------------------------------------------------------------
    2448 
    2449 #ifdef USE_MPIINPLACE
    2450 
    24512427    if (lroot) then
    24522428      call MPI_Reduce(MPI_IN_PLACE, gridunc, grid_size3d, mp_sp, MPI_SUM, id_root, &
     
    24572433           & mp_comm_used, mp_ierr)
    24582434    end if
    2459 
    2460 #else
    2461 
    2462       call MPI_Reduce(gridunc, gridunc0, grid_size3d, mp_sp, MPI_SUM, id_root, &
    2463            & mp_comm_used, mp_ierr)
    2464       if (lroot) gridunc = gridunc0
    2465 
    2466 #endif
    24672435
    24682436    if ((WETDEP).and.(ldirect.gt.0)) then
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG