From 94c670bc8c351f51fbf689e45c29d512e414f963 Mon Sep 17 00:00:00 2001 From: DrTVockerodtMO <114994380+DrTVockerodtMO@users.noreply.github.com> Date: Mon, 17 Aug 2026 12:22:02 +0100 Subject: [PATCH 1/3] Fixed some formatting and source of large memory leaks --- infrastructure/source/utilities/halo_comms_mod.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/infrastructure/source/utilities/halo_comms_mod.F90 b/infrastructure/source/utilities/halo_comms_mod.F90 index 0546fe2f0..1f230c47f 100644 --- a/infrastructure/source/utilities/halo_comms_mod.F90 +++ b/infrastructure/source/utilities/halo_comms_mod.F90 @@ -860,10 +860,13 @@ function generate_redistribution_map(src_indices, tgt_indices, datatype, xmap) & end do datatype_mpi_val = datatype%get_datatype_mpi_val() - redist = xt_redist_p2p_off_new(xmap, src_offsets,tgt_offsets, datatype_mpi_val) + redist = xt_redist_p2p_off_new(xmap, src_offsets, tgt_offsets, datatype_mpi_val) deallocate(src_offsets) deallocate(tgt_offsets) + + call xt_idxlist_delete(tgt_idxlist) + call xt_idxlist_delete(src_idxlist) else call log_event( & 'Call to generate_redistribution_map failed. Must initialise mpi first', & @@ -903,7 +906,7 @@ function generate_exchange_map(src_indices, tgt_indices) result(xmap) ! generate exchange map comm = global_mpi%get_comm() xmap = xt_xmap_dist_dir_new( src_idxlist, tgt_idxlist, & - comm%get_comm_mpi_val() ) + comm%get_comm_mpi_val() ) call xt_idxlist_delete(tgt_idxlist) call xt_idxlist_delete(src_idxlist) else From 4de4f3d9b7b430181f1f93534f21eb256b19c138 Mon Sep 17 00:00:00 2001 From: DrTVockerodtMO <114994380+DrTVockerodtMO@users.noreply.github.com> Date: Mon, 17 Aug 2026 12:43:45 +0100 Subject: [PATCH 2/3] Signed CLA --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 595630b49..38dd04091 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -35,3 +35,4 @@ | ukmo-juan-castillo | Juan M. Castillo | Met Office | 2026-03-24 | | mcdalvi | Mohit Dalvi | Met Office | 2026-06-19 | | cjohnson-pi | Christine Johnson | Met Office | 2026-06-29 | +| DrTVockerodtMO | Terence Vockerodt | Met Office | 2026-08-17 | From a79c3303594a1855466c25831d86fa6d9ae06e5f Mon Sep 17 00:00:00 2001 From: DrTVockerodtMO <114994380+DrTVockerodtMO@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:36:12 +0100 Subject: [PATCH 3/3] It seems the idx_lists are vestigial in this routine so they ought to be removed. --- infrastructure/source/utilities/halo_comms_mod.F90 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/infrastructure/source/utilities/halo_comms_mod.F90 b/infrastructure/source/utilities/halo_comms_mod.F90 index 1f230c47f..8cc14102f 100644 --- a/infrastructure/source/utilities/halo_comms_mod.F90 +++ b/infrastructure/source/utilities/halo_comms_mod.F90 @@ -837,7 +837,6 @@ function generate_redistribution_map(src_indices, tgt_indices, datatype, xmap) & redist = 0 #else type(xt_redist) :: redist - type(xt_idxlist) :: src_idxlist, tgt_idxlist integer(i_def), allocatable :: src_offsets(:) integer(i_def), allocatable :: tgt_offsets(:) integer(i_def) :: i @@ -845,9 +844,6 @@ function generate_redistribution_map(src_indices, tgt_indices, datatype, xmap) & if( global_mpi%is_comm_set() )then ! create decomposition descriptors - src_idxlist = xt_idxvec_new( src_indices, size(src_indices) ) - tgt_idxlist = xt_idxvec_new( tgt_indices, size(tgt_indices) ) - allocate(src_offsets( size(src_indices) )) allocate(tgt_offsets( size(tgt_indices) )) @@ -864,9 +860,6 @@ function generate_redistribution_map(src_indices, tgt_indices, datatype, xmap) & deallocate(src_offsets) deallocate(tgt_offsets) - - call xt_idxlist_delete(tgt_idxlist) - call xt_idxlist_delete(src_idxlist) else call log_event( & 'Call to generate_redistribution_map failed. Must initialise mpi first', &