Changeset fb0d416 in flexpart.git
- Timestamp:
- Apr 20, 2015, 10:35:26 AM (9 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 5f42c27
- Parents:
- b5d0e7e
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
README_PARALLEL.md
rf9ce123 rfb0d416 1 1 2 FLEXPART VERSION 9.2.0(MPI)2 FLEXPART VERSION 10.0 beta (MPI) 3 3 4 4 Description … … 62 62 'numpart' are complemented by variables 'maxpart_mpi' and 'numpart_mpi' 63 63 which are the run-time determined number of particles per process, i.e, 64 maxpart_mpi = maxpart/ [number of processes]. The variable 'numpart'64 maxpart_mpi = maxpart/np, where np are the number of processes. The variable 'numpart' 65 65 is still used in the code, but redefined to mean 'number of particles 66 66 per MPI process' … … 79 79 But it is also possible that the 80 80 program will run even faster if the 4th process is participating in 81 the calculation of particle trajectories . This will largely depend on81 the calculation of particle trajectories instead. This will largely depend on 82 82 the problem size (total number of particles in the simulation, resolution 83 83 of grids etc) and hardware being used (disk speed/buffering, memory … … 173 173 * Nested wind fields 174 174 175 -The following will probably/possibly not work (untested/under developement):175 -The following will most probably not work (untested/under developement): 176 176 177 177 * Backward runs -
options/RELEASES
r5f9d14a rfb0d416 16 16 ZKIND= 1, 17 17 MASS= 2.0000E8 , 18 PARTS= 2000000 18 PARTS= 20000000 19 19 COMMENT="TEST1 ", 20 20 / … … 32 32 ZKIND= 1, 33 33 MASS= 2.0000E8 , 34 PARTS= 2000000 34 PARTS= 20000000 35 35 COMMENT="TEST2 ", 36 36 / -
src/FLEXPART_MPI.f90
r2f8635b rfb0d416 336 336 !****************************************************************** 337 337 338 if (mp_measure_time) call mpif_mtime('iotime',0) 339 ! :DEV: was a bug here (all processes writing)? 340 if (lroot) then ! MPI: this part root process only 341 338 342 if (lnetcdfout.eq.1) then 339 343 call writeheader_netcdf(lnest=.false.) … … 350 354 endif 351 355 352 if (lroot) then ! MPI: this part root process only 356 ! 353 357 if (verbosity.gt.0) then 354 358 print*,'call writeheader' … … 364 368 end if ! (mpif_pid == 0) 365 369 370 if (mp_measure_time) call mpif_mtime('iotime',0) 371 366 372 !open(unitdates,file=path(2)(1:length(2))//'dates') 367 368 !open(unitdates,file=path(2)(1:length(2))//'dates')369 373 370 374 if (verbosity.gt.0 .and. lroot) then -
src/getfields_mpi.f90
r5f9d14a rfb0d416 43 43 ! 44 44 ! eso 2014: 45 ! MPI version. 3 fields instead of 2, to allow reading the newest in 46 ! the background. 47 ! Only one process (lmpreader=.true.) does the actual reading, while the 48 ! rest call this routine only to update memind, memstat etc. 45 ! MPI version. 46 ! If running with number of processes >= mpi_mod::read_grp_min, 47 ! only one process (mpi_mod::lmpreader=.true.) does the actual reading, while 48 ! the rest call this routine only to update memind, memstat etc. 49 ! 50 ! If mpi_mod::lmp_sync=.true., uses 3 fields instead of 2, to allow reading 51 ! the newest in the background. 49 52 ! 50 53 ! Return memstat, which is the sum of … … 61 64 ! indj indicates the number of the wind field to be read in * 62 65 ! indmin remembers the number of wind fields already treated * 63 ! memind(2 )pointer, on which place the wind fields are stored *64 ! memtime(2 ) [s]times of the wind fields, which are kept in memory *66 ! memind(2[3]) pointer, on which place the wind fields are stored * 67 ! memtime(2[3]) [s] times of the wind fields, which are kept in memory * 65 68 ! itime [s] current time since start date of trajectory calcu- * 66 69 ! lation * -
src/gethourlyOH.f90
r5f9d14a rfb0d416 120 120 memOHtime(1)=0. 121 121 122 jul2=bdate+ real(1./24.,kind=dp) ! date for next hour122 jul2=bdate+ldirect*real(1./24.,kind=dp) ! date for next hour 123 123 call caldate(jul2,jjjjmmdd,hhmmss) 124 124 m2=(jjjjmmdd-(jjjjmmdd/10000)*10000)/100 -
src/makefile
rb5d0e7e rfb0d416 36 36 37 37 ## COMPILERS 38 F90 = /usr/bin/gfortran39 #F90 = ${HOME}/gcc-4.9.1/bin/gfortran38 #F90 = /usr/bin/gfortran 39 F90 = ${HOME}/gcc-4.9.1/bin/gfortran 40 40 #MPIF90 = ${HOME}/opt/bin/mpifort 41 41 #MPIF90 = mpif90.mpich 42 MPIF90 = mpif90.openmpi43 #MPIF90 = mpifort42 #MPIF90 = mpif90.openmpi 43 MPIF90 = mpifort 44 44 45 45 ## OPTIMIZATION LEVEL … … 51 51 52 52 ## 1) System libraries at NILU 53 INCPATH1 = /usr/include54 INCPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/include55 LIBPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/lib56 LIBPATH2 = /usr/lib/x86_64-linux-gnu53 # INCPATH1 = /usr/include 54 # INCPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/include 55 # LIBPATH1 = /xnilu_wrk/flex_wrk/bin64/grib_api/lib 56 # LIBPATH2 = /usr/lib/x86_64-linux-gnu 57 57 58 58 ## 2) Home-made libraries 59 #INCPATH1 = ${HOME}/include60 #INCPATH2 = /homevip/flexpart/include/61 #LIBPATH2 = /homevip/flexpart/lib/62 #LIBPATH1 = ${HOME}/lib59 INCPATH1 = ${HOME}/include 60 INCPATH2 = /homevip/flexpart/include/ 61 LIBPATH2 = /homevip/flexpart/lib/ 62 LIBPATH1 = ${HOME}/lib 63 63 #LIBPATH2 = ${HOME}/lib 64 64 65 65 FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) -mtune=native -fuse-linker-plugin $(FUSER) # -march=native 66 66 67 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Warray-bounds -Wall -fcheck=all $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -fdump-core67 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Warray-bounds -Wall -fcheck=all $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -fdump-core 68 68 69 69 LDFLAGS = $(FFLAGS) -L$(LIBPATH1) -L$(LIBPATH2) $(LIBS) -
src/mpi_mod.f90
r5f9d14a rfb0d416 90 90 integer :: tm1 91 91 integer, parameter :: nvar_async=27 !29 :DBG: 92 92 !integer, dimension(:), allocatable :: tags 93 93 integer, dimension(:), allocatable :: reqs 94 94 … … 1243 1243 1244 1244 do dest=0,mp_np-1 ! mp_np-2 will also work if last proc reserved for reading 1245 1245 ! TODO: use mp_partgroup_np here 1246 1246 if (dest.eq.id_read) cycle 1247 1247 i=dest*nvar_async … … 1339 1339 &MPI_COMM_WORLD,reqs(i),mp_ierr) 1340 1340 if (mp_ierr /= 0) goto 600 1341 1342 1341 ! else 1342 ! i=i+2 1343 1343 end if 1344 1344 … … 1389 1389 1390 1390 ! :TODO: don't need these 1391 1392 1393 1394 1391 ! d3s1=d3_size1 1392 ! d3s2=d3_size2 1393 ! d2s1=d2_size1 1394 ! d2s2=d2_size2 1395 1395 1396 1396 ! At the time this immediate receive is posted, memstat is the state of … … 1593 1593 call MPI_Waitall(n_req,reqs,MPI_STATUSES_IGNORE,mp_ierr) 1594 1594 ! endif 1595 1596 1597 1598 1599 1600 1601 1602 1603 1595 ! else 1596 ! do i = 0, nvar_async*mp_np-1 1597 ! if (mod(i,27).eq.0 .or. mod(i,28).eq.0) then 1598 ! call MPI_Cancel(reqs(i),mp_ierr) 1599 ! cycle 1600 ! end if 1601 ! call MPI_Wait(reqs(i),MPI_STATUS_IGNORE,mp_ierr) 1602 ! end do 1603 ! end if 1604 1604 1605 1605 if (mp_ierr /= 0) goto 600 … … 1909 1909 !*********************************************************************** 1910 1910 1911 if (mp_measure_time) then1911 IF (mp_measure_time) THEN 1912 1912 do ip=0, mp_np-1 1913 1913 call MPI_BARRIER(MPI_COMM_WORLD, mp_ierr) … … 1962 1962 end if 1963 1963 1964 ! This call to barrier is for correctly formatting output 1965 call MPI_BARRIER(MPI_COMM_WORLD, mp_ierr) 1966 1967 if (lroot) then 1968 write(*,FMT='(72("#"))') 1969 WRITE(*,*) "To turn off output of time measurements, set " 1970 WRITE(*,*) " mp_measure_time=.false." 1971 WRITE(*,*) "in file mpi_mod.f90" 1972 write(*,FMT='(72("#"))') 1973 end if 1974 1964 1975 ! j=mp_pid*nvar_async 1965 1976 ! In the implementation with 3 fields, the processes may have posted 1966 1977 ! MPI_Irecv requests that should be cancelled here 1967 1978 !! TODO: 1968 1969 1970 1971 1972 1973 1974 1979 ! if (.not.lmp_sync) then 1980 ! r=mp_pid*nvar_async 1981 ! do j=r,r+nvar_async-1 1982 ! call MPI_Cancel(j,mp_ierr) 1983 ! if (mp_ierr /= 0) write(*,*) '#### mpif_finalize::MPI_Cancel> ERROR ####' 1984 ! end do 1985 ! end if 1975 1986 1976 1987 call MPI_FINALIZE(mp_ierr) … … 1981 1992 1982 1993 1983 end subroutine mpif_finalize1984 1985 1986 subroutine get_lun(my_lun)1994 end subroutine mpif_finalize 1995 1996 1997 subroutine get_lun(my_lun) 1987 1998 !*********************************************************************** 1988 1999 ! get_lun: … … 1990 2001 !*********************************************************************** 1991 2002 1992 implicit none1993 1994 integer, intent(inout) :: my_lun1995 integer, save :: free_lun=1001996 logical :: exists, iopen1997 1998 !*********************************************************************** 1999 2000 loop1: do2001 inquire(UNIT=free_lun, EXIST=exists, OPENED=iopen)2002 if (exists .and. .not.iopen) exit loop12003 free_lun = free_lun+12004 end do loop12005 my_lun = free_lun2006 2007 end subroutine get_lun2008 2009 2010 subroutine write_data_dbg(array_in, array_name, tstep, ident)2003 implicit none 2004 2005 integer, intent(inout) :: my_lun 2006 integer, save :: free_lun=100 2007 logical :: exists, iopen 2008 2009 !*********************************************************************** 2010 2011 loop1: do 2012 inquire(UNIT=free_lun, EXIST=exists, OPENED=iopen) 2013 if (exists .and. .not.iopen) exit loop1 2014 free_lun = free_lun+1 2015 end do loop1 2016 my_lun = free_lun 2017 2018 end subroutine get_lun 2019 2020 2021 subroutine write_data_dbg(array_in, array_name, tstep, ident) 2011 2022 !*********************************************************************** 2012 2023 ! Write one-dimensional arrays to disk (for debugging purposes) 2013 2024 !*********************************************************************** 2014 implicit none2015 2016 real, intent(in), dimension(:) :: array_in2017 integer, intent(in) :: tstep2018 integer :: lios2019 character(LEN=*), intent(in) :: ident, array_name2020 2021 character(LEN=8) :: c_ts2022 character(LEN=40) :: fn_1, fn_22023 2024 !*********************************************************************** 2025 2026 write(c_ts, FMT='(I8.8,BZ)') tstep2027 fn_1='-'//trim(adjustl(c_ts))//'-'//trim(ident)2028 write(c_ts, FMT='(I2.2,BZ)') mp_np2029 fn_2= trim(adjustl(array_name))//trim(adjustl(fn_1))//'-np'//trim(adjustl(c_ts))//'.dat'2030 2031 call get_lun(dat_lun)2032 open(UNIT=dat_lun, FILE=fn_2, IOSTAT=lios, ACTION='WRITE', &2033 FORM='UNFORMATTED', STATUS='REPLACE')2034 write(UNIT=dat_lun, IOSTAT=lios) array_in2035 close(UNIT=dat_lun)2036 2037 end subroutine write_data_dbg2025 implicit none 2026 2027 real, intent(in), dimension(:) :: array_in 2028 integer, intent(in) :: tstep 2029 integer :: lios 2030 character(LEN=*), intent(in) :: ident, array_name 2031 2032 character(LEN=8) :: c_ts 2033 character(LEN=40) :: fn_1, fn_2 2034 2035 !*********************************************************************** 2036 2037 write(c_ts, FMT='(I8.8,BZ)') tstep 2038 fn_1='-'//trim(adjustl(c_ts))//'-'//trim(ident) 2039 write(c_ts, FMT='(I2.2,BZ)') mp_np 2040 fn_2= trim(adjustl(array_name))//trim(adjustl(fn_1))//'-np'//trim(adjustl(c_ts))//'.dat' 2041 2042 call get_lun(dat_lun) 2043 open(UNIT=dat_lun, FILE=fn_2, IOSTAT=lios, ACTION='WRITE', & 2044 FORM='UNFORMATTED', STATUS='REPLACE') 2045 write(UNIT=dat_lun, IOSTAT=lios) array_in 2046 close(UNIT=dat_lun) 2047 2048 end subroutine write_data_dbg 2038 2049 2039 2050 -
src/readOHfield.f90
r8a65cb0 rfb0d416 45 45 use par_mod 46 46 use com_mod 47 48 47 49 48 implicit none -
src/readspecies.f90
rf9ce123 rfb0d416 211 211 ohcconst(pos_spec)=pohcconst 212 212 ohdconst(pos_spec)=pohdconst 213 oh dconst(pos_spec)=pohnconst213 ohnconst(pos_spec)=pohnconst 214 214 spec_ass(pos_spec)=pspec_ass 215 215 kao(pos_spec)=pkao -
src/timemanager_mpi.f90
r5f9d14a rfb0d416 208 208 endif 209 209 210 ! This time measure includes reading/MPI communication (for the reader process), 211 ! or MPI communication time only (for other processes) 210 212 if (mp_measure_time) call mpif_mtime('getfields',0) 211 213 … … 213 215 214 216 if (mp_measure_time) call mpif_mtime('getfields',1) 217 218 215 219 216 220 ! Broadcast fields to all MPI processes 217 221 ! Skip if all processes have called getfields or if no new fields 218 222 !***************************************************************** 223 224 if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',0) 219 225 220 226 ! Version 1 (lmp_sync=.true.) uses a read-ahead process where send/recv is done … … 258 264 259 265 end if 266 267 if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',1) 268 260 269 261 270 !******************************************************************************* … … 446 455 call mpif_tm_reduce_grid 447 456 457 if (mp_measure_time) call mpif_mtime('iotime',0) 448 458 if (surf_only.ne.1) then 449 459 if (lroot) then … … 470 480 endif 471 481 endif 482 if (mp_measure_time) call mpif_mtime('iotime',1) 472 483 473 484 ! :TODO: Correct calling of conc_surf above? … … 481 492 !********************************************* 482 493 call mpif_tm_reduce_grid_nest 494 495 if (mp_measure_time) call mpif_mtime('iotime',0) 483 496 484 497 if (lnetcdfout.eq.0) then … … 515 528 end if 516 529 end if 530 517 531 518 532 outnum=0. … … 520 534 if ((iout.eq.4).or.(iout.eq.5)) call plumetraj(itime) 521 535 if (iflux.eq.1) call fluxoutput(itime) 536 if (mp_measure_time) call mpif_mtime('iotime',1) 537 522 538 if (lroot) write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,& 523 539 &wetgridtotalunc,drygridtotalunc
Note: See TracChangeset
for help on using the changeset viewer.