Skip to content

Commit 9eb01c7

Browse files
Merge pull request #735 from NCAR/mpi-win
remove copy of state into mpi window
2 parents e218864 + d56aa4a commit 9eb01c7

19 files changed

+651
-305
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ test_quad_reg_interp
203203
test_table_read
204204
test_ran_unif
205205
test_kde_dist
206+
test_window
206207

207208
# Directories to NOT IGNORE ... same as executable names
208209
# as far as I know, these must be listed after the executables

CHANGELOG.rst

+12-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@ individual files.
2222

2323
The changes are now listed with the most recent at the top.
2424

25-
**October 22 2024 :: Bug-fixes: WRF and GOES. Tag 11.8.2**
25+
**November 7 2024 :: MPI window memory reduction. Tag v11.8.3**
26+
27+
- Removes unnecessary copy of state into mpi window.
28+
- Removes cray pointer version of the mpi window.
29+
- | Fortran-testanything included in developer tests.
30+
| *From dennisdjensen: see developer_tests/contrib/fortran-testanything/LICENSE.txt*
31+
32+
**October 22 2024 :: Bug-fixes: WRF and GOES. Tag v11.8.2**
2633

2734
- Force THM to be the WRF-DART temperature variable
2835
- Remove offset on GOES observation converter
2936

30-
**September 27 2024 :: MOM6 mask bug-fix. Tag 11.8.1**
37+
**September 27 2024 :: MOM6 mask bug-fix. Tag v11.8.1**
3138

3239
- Fix for MOM6 CESM3 workhorse 2/3 degree grid TL319_t232 to
3340
mask missing geolon|lat|u|v|t values
3441

35-
**September 10 2024 :: MARBL_column. Tag 11.8.0**
42+
**September 10 2024 :: MARBL_column. Tag v11.8.0**
3643

3744
- Interface for MARBL_column for DART:
3845

@@ -48,7 +55,7 @@ Bugfix:
4855

4956
- fix for IO for NetCDF files when only some variables have the unlimited dimension
5057

51-
**August 29 2024 :: Bug fixes for shortest_time_between_assimilations and get_close_init. Tag 11.7.1**
58+
**August 29 2024 :: Bug fixes for shortest_time_between_assimilations and get_close_init. Tag v11.7.1**
5259

5360
Bug fixes:
5461

@@ -64,7 +71,7 @@ Doc fixes:
6471
- GitHub template for reporting documentation issues
6572

6673

67-
**August 26 2024 :: KQCEF. Tag 11.7.0**
74+
**August 26 2024 :: KQCEF. Tag v11.7.0**
6875

6976
- Adds a Quantile-Conserving Ensemble Filter Based on Kernel-Density Estimation to DART.
7077
- New distribution module kde_distribution_mod.

assimilation_code/modules/utilities/cray_win_mod.f90

-219
This file was deleted.

assimilation_code/modules/utilities/distributed_state_mod.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ subroutine get_fwd(x, my_index, state_ens_handle)
110110
!x = get_local_state(element_index)
111111
x = state_ens_handle%copies(1:data_count, element_index)
112112
else
113-
call get_from_fwd(owner_of_state, state_win, element_index, data_count, x)
113+
call get_from_fwd(owner_of_state, state_win, element_index, state_ens_handle%num_copies, data_count, x)
114114
endif
115115
endif
116116

assimilation_code/modules/utilities/mpi_utilities_mod.f90

+5-4
Original file line numberDiff line numberDiff line change
@@ -1968,13 +1968,14 @@ end subroutine get_from_mean
19681968

19691969
!-----------------------------------------------------------------------------
19701970

1971-
subroutine get_from_fwd(owner, window, mindex, num_rows, x)
1971+
subroutine get_from_fwd(owner, window, mindex, rows_in_window, num_rows, x)
19721972

19731973
integer, intent(in) :: owner ! task in the window that owns the memory
19741974
integer, intent(in) :: window ! window object
19751975
integer, intent(in) :: mindex ! index in the tasks memory
1976-
integer, intent(in) :: num_rows ! number of rows in the window
1977-
real(r8), intent(out) :: x(:) ! result
1976+
integer, intent(in) :: rows_in_window ! number of rows in the window
1977+
integer, intent(in) :: num_rows ! number of rows to get from the window
1978+
real(r8), intent(out) :: x(num_rows) ! result
19781979

19791980
integer(KIND=MPI_ADDRESS_KIND) :: target_disp
19801981
integer :: errcode
@@ -1983,7 +1984,7 @@ subroutine get_from_fwd(owner, window, mindex, num_rows, x)
19831984
! to have occured until the call to mpi_win_unlock.
19841985
! => Don't do anything with x in between mpi_get and mpi_win_lock
19851986

1986-
target_disp = (mindex - 1)*num_rows
1987+
target_disp = (mindex - 1)*rows_in_window
19871988
call mpi_win_lock(MPI_LOCK_SHARED, owner, 0, window, errcode)
19881989
call mpi_get(x, num_rows, datasize, owner, target_disp, num_rows, datasize, window, errcode)
19891990
call mpi_win_unlock(owner, window, errcode)

assimilation_code/modules/utilities/mpif08_utilities_mod.f90

+4-3
Original file line numberDiff line numberDiff line change
@@ -1969,12 +1969,13 @@ end subroutine get_from_mean
19691969

19701970
!-----------------------------------------------------------------------------
19711971

1972-
subroutine get_from_fwd(owner, window, mindex, num_rows, x)
1972+
subroutine get_from_fwd(owner, window, mindex, rows_in_window, num_rows, x)
19731973

19741974
integer, intent(in) :: owner ! task in the window that owns the memory
19751975
type(MPI_Win), intent(in) :: window ! window object
19761976
integer, intent(in) :: mindex ! index in the tasks memory
1977-
integer, intent(in) :: num_rows ! number of rows in the window
1977+
integer, intent(in) :: rows_in_window ! number of rows in the window
1978+
integer, intent(in) :: num_rows ! number of rows to get from the window
19781979
real(r8), intent(out) :: x(num_rows) ! result
19791980

19801981
integer(KIND=MPI_ADDRESS_KIND) :: target_disp
@@ -1984,7 +1985,7 @@ subroutine get_from_fwd(owner, window, mindex, num_rows, x)
19841985
! to have occured until the call to mpi_win_unlock.
19851986
! => Don't do anything with x in between mpi_get and mpi_win_lock
19861987

1987-
target_disp = (mindex - 1)*num_rows
1988+
target_disp = (mindex - 1)*rows_in_window
19881989
call mpi_win_lock(MPI_LOCK_SHARED, owner, 0, window, errcode)
19891990
call mpi_get(x, num_rows, datasize, owner, target_disp, num_rows, datasize, window, errcode)
19901991
call mpi_win_unlock(owner, window, errcode)

assimilation_code/modules/utilities/null_mpi_utilities_mod.f90

+4-3
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,14 @@ end subroutine get_from_mean
634634

635635
!-----------------------------------------------------------------------------
636636

637-
subroutine get_from_fwd(owner, window, mindex, num_rows, x)
637+
subroutine get_from_fwd(owner, window, mindex, rows_in_window, num_rows, x)
638638

639639
integer, intent(in) :: owner ! task in the window that owns the memory
640640
integer, intent(in) :: window ! window object
641641
integer, intent(in) :: mindex ! index in the tasks memory
642-
integer, intent(in) :: num_rows ! number of rows in the window
643-
real(r8), intent(out) :: x(num_rows) ! result
642+
integer, intent(in) :: rows_in_window ! number of rows in the window
643+
integer, intent(in) :: num_rows ! number of rows to get from the window
644+
real(r8), intent(out) :: x(num_rows) ! result
644645

645646
call error_handler(E_ERR,'get_from_fwd', 'cannot be used in serial mode', source)
646647

0 commit comments

Comments
 (0)