Changes in src/mpi_mod.f90 [aa8c34a:6ecb30a] in flexpart.git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mpi_mod.f90
raa8c34a r6ecb30a 59 59 ! * 60 60 !***************************************************************************** 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 !***************************************************************************** 61 68 62 69 use mpi … … 1651 1658 write(*,*) "#### mpi_mod::mpif_gf_send_vars_async> ERROR: & 1652 1659 & invalid memstat" 1653 mind=-11654 stop1655 1660 end if 1656 1661 … … 2028 2033 write(*,*) "#### mpi_mod::mpif_gf_send_vars_nest_async> ERROR: & 2029 2034 & invalid memstat" 2030 mind=-12031 stop2032 2035 end if 2033 2036 … … 2425 2428 2426 2429 ! 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 2427 2451 if (lroot) then 2428 2452 call MPI_Reduce(MPI_IN_PLACE, gridunc, grid_size3d, mp_sp, MPI_SUM, id_root, & … … 2433 2457 & mp_comm_used, mp_ierr) 2434 2458 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 2435 2467 2436 2468 if ((WETDEP).and.(ldirect.gt.0)) then
Note: See TracChangeset
for help on using the changeset viewer.