Changeset bb579a9 in flexpart.git for src/mpi_mod.f90


Ignore:
Timestamp:
Sep 13, 2017, 11:55:16 AM (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:
08a38b5
Parents:
aa8c34a (diff), dd6a4aa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ctbto' into dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mpi_mod.f90

    raa8c34a rbb579a9  
    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
     
    24252432
    24262433! 2) Using in-place reduction
     2434
     2435!!!--------------------------------------------------------------------
     2436!!! DJM - 2017-05-09 change - MPI_IN_PLACE option for MPI_Reduce() causes
     2437!!! severe numerical problems in some cases.  I'm guessing there are memory
     2438!!! overrun issues in this complex code, but have so far failed to identify
     2439!!! a specific problem.  And/or, when one searches the Internet for this
     2440!!! issue, there is "some" hint that the implementation may be buggy. 
     2441!!!
     2442!!! At this point, with the following CPP USE_MPIINPLACE directive, the
     2443!!! default behaviour will be to not use the MPI_IN_PLACE option.
     2444!!! Users will have to compile with -DUSE_MPIINPLACE if they want that option.
     2445!!! Introduction of the CPP directives also requires that the code be compiled
     2446!!! with the "-x f95-cpp-input" option.
     2447!!!
     2448!!! Modification of this section requires the addition of array gridunc0, which
     2449!!! requires an allocation in outgrid_init.f90 and initial declaration in
     2450!!! unc_mod.f90.
     2451!!!--------------------------------------------------------------------
     2452
     2453#ifdef USE_MPIINPLACE
     2454
    24272455    if (lroot) then
    24282456      call MPI_Reduce(MPI_IN_PLACE, gridunc, grid_size3d, mp_sp, MPI_SUM, id_root, &
     
    24332461           & mp_comm_used, mp_ierr)
    24342462    end if
     2463
     2464#else
     2465
     2466      call MPI_Reduce(gridunc, gridunc0, grid_size3d, mp_sp, MPI_SUM, id_root, &
     2467           & mp_comm_used, mp_ierr)
     2468      if (lroot) gridunc = gridunc0
     2469
     2470#endif
    24352471
    24362472    if ((WETDEP).and.(ldirect.gt.0)) then
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG