Changeset 6ecb30a in flexpart.git for src/mpi_mod.f90


Ignore:
Timestamp:
Aug 17, 2017, 4:39:17 PM (7 years ago)
Author:
Espen Sollum ATMOS <eso@…>
Branches:
master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
Children:
5b34509
Parents:
61e07ba
Message:

Merged changes from CTBTO project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mpi_mod.f90

    rb5127f9 r6ecb30a  
    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!*****************************************************************************
    6168
    6269  use mpi
     
    24212428
    24222429! 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
    24232451    if (lroot) then
    24242452      call MPI_Reduce(MPI_IN_PLACE, gridunc, grid_size3d, mp_sp, MPI_SUM, id_root, &
     
    24292457           & mp_comm_used, mp_ierr)
    24302458    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
    24312467
    24322468    if ((WETDEP).and.(ldirect.gt.0)) then
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG