Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f6ebba0
#NOTHING_WORKS
uramirez8707 Nov 3, 2023
972bc90
wut
uramirez8707 Nov 3, 2023
06d2405
push uncommitted updates
uramirez8707 May 13, 2025
bdde8ed
separate and move modules to new offloading directory
Jun 2, 2025
130ab90
Merge remote-tracking branch 'origin/main' into HEAD
Jun 2, 2025
90c0c8c
add routines for metadata transfer type
Jun 2, 2025
710d887
add constants for allocatable workaround and expand metadata transfer…
Jun 17, 2025
f762986
add inherited class structure for reals and ints
Jun 23, 2025
fbd739e
finish up support for all data types and add to test
Jul 7, 2025
757764b
add metadata object usage to offload moduld
Jul 7, 2025
1fe352f
free memory after redistribute calls and adjust domains total mem add…
Jul 16, 2025
b3770af
fix for cubic domains
Jul 16, 2025
0d54864
add clocks for offload writes/redistributes
Jul 21, 2025
9e31d77
update for layouts and fix for more than 1 offload pe per tile
Jul 21, 2025
6c56515
fix bug with different layouts and pe counts
Jul 28, 2025
1176605
Merge branch 'main' of github.com:noaa-gfdl/fms into metadata-transfer
Nov 10, 2025
ed4c178
remove attribute_type from base class and any unused variables/args
Nov 10, 2025
890bfd6
comments and linter
Nov 12, 2025
9541c66
undo accidental change to data override test
Nov 12, 2025
79a3af4
add cast for r8 build option to pass
Nov 12, 2025
a9ce72c
add ifdefs for for mpi-less build
Nov 13, 2025
18c7178
fix mpi transfer for intel but not gcc :(
Nov 24, 2025
ecba40d
fix mpi struct bug with gcc and remove mpp test
Dec 1, 2025
b2be463
Merge branch 'main' into metadata-transfer
rem1776 Dec 29, 2025
c0ab0dc
add more documentation and any missing headers
Jan 5, 2026
08a7da9
fix typo and white space
Jan 6, 2026
596da47
add any missing apache licenses
Jan 9, 2026
4a5ed59
add nml for io offload module
Jan 9, 2026
969513e
add in todo comments and some type/length changes from reviews
Jan 12, 2026
07ea5a8
clean up typing for netcdf file objs
Jan 12, 2026
9dc1d4f
line lengths for linter
Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SUBDIRS = \
fms2_io \
mosaic2 \
fms \
offloading \
parser \
string_utils \
affinity \
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ AC_CONFIG_FILES([
diag_integral/Makefile
sat_vapor_pres/Makefile
random_numbers/Makefile
offloading/Makefile
libFMS/Makefile
docs/Makefile
parser/Makefile
Expand Down Expand Up @@ -554,6 +555,7 @@ AC_CONFIG_FILES([
test_fms/random_numbers/Makefile
test_fms/topography/Makefile
test_fms/column_diagnostics/Makefile
test_fms/offloading/Makefile
test_fms/block_control/Makefile
FMS.pc
])
Expand Down
44 changes: 38 additions & 6 deletions fms2_io/netcdf_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module netcdf_io_mod
#endif
use netcdf
use mpp_mod
use mpp_domains_mod
use fms_io_utils_mod
use platform_mod
implicit none
Expand Down Expand Up @@ -122,6 +123,17 @@ module netcdf_io_mod
!! cur_dim_len(3) : z dimensions
endtype dimension_information

type, public :: fmsOffloadingIn_type
!TODO should be private, need getter functions
integer, public :: id !< unique identifier for each type
integer, public, allocatable :: offloading_pes(:) !< list of pe numbers that will be used to just write
integer, public, allocatable :: model_pes(:) !< list of pe numbers that will be running the model
logical :: is_model_pe !< true if current pe is in model_pes
type(domain2D) :: domain_in !< domain for grid that is to be written out
contains
procedure :: init
endtype fmsOffloadingIn_type

!> @brief Netcdf file type.
!> @ingroup netcdf_io_mod
type, public :: FmsNetcdfFile_t
Expand All @@ -148,12 +160,13 @@ module netcdf_io_mod
character (len=20) :: time_name
type(dimension_information) :: bc_dimensions !<information about the current dimensions for regional
!! restart variables
integer :: tile_comm=MPP_COMM_NULL !< MPI communicator used for parallel reads.
!! This is deprecated. Please use open_file(..., tile_comm=...)
logical :: use_netcdf_mpi = .false. !< Enable parallel reads/writes via NetCDF MPI. This
!! causes the I/O domain to be ignored.
logical :: use_collective = .false. !< Flag indicating whether reads and writes should be performed
!! collectively rather than independently.
type(fmsOffloadingIn_type) :: offloading_obj_in
logical :: use_collective = .false. !< Flag indicating if we should open the file for collective input
!! this should be set to .true. in the user application if they want
!! collective reads (put before open_file())
integer :: tile_comm=MPP_COMM_NULL !< MPI communicator used for collective reads.
!! To be replaced with a real communicator at user request
logical :: use_netcdf_mpi = .false.

contains

Expand Down Expand Up @@ -2417,6 +2430,25 @@ subroutine flush_file(fileobj)
endif
end subroutine flush_file

!> Initialization routine for fmsOffloadingIn_type
subroutine init(this, offloading_obj_id, offloading_pes, model_pes, domain)
class(fmsOffloadingIn_type), intent(inout) :: this !< offloading object to initialize
integer, intent(in) :: offloading_obj_id !< unique id number to set
integer, intent(in) :: offloading_pes(:) !< list of pe's from current list to offload writes to
integer, intent(in) :: model_pes(:) !< list of model pe's (any pes not in offloading_pes argument)
type(domain2D) :: domain

this%id = offloading_obj_id
allocate(this%offloading_pes(size(offloading_pes)))
this%offloading_pes = offloading_pes
allocate(this%model_pes(size(model_pes)))
this%model_pes = model_pes

this%is_model_pe = .false.
if (any(model_pes .eq. mpp_pe())) &
this%is_model_pe = .true.
this%domain_in = domain
end subroutine
!> @brief Getter for use_netcdf_mpi
pure logical function is_file_using_netcdf_mpi(this)
class(FmsNetcdfFile_t), intent(in) :: this !< fms2io fileobj to query
Expand Down
1 change: 1 addition & 0 deletions libFMS/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ libFMS_la_LIBADD += $(top_builddir)/diag_integral/libdiag_integral.la
libFMS_la_LIBADD += $(top_builddir)/sat_vapor_pres/libsat_vapor_pres.la
libFMS_la_LIBADD += $(top_builddir)/parser/libparser.la
libFMS_la_LIBADD += $(top_builddir)/string_utils/libstring_utils.la
libFMS_la_LIBADD += $(top_builddir)/offloading/liboffload.la
libFMS_la_LIBADD += $(top_builddir)/libFMS_mod.la

libFMS_la_SOURCES =
Expand Down
44 changes: 44 additions & 0 deletions offloading/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#***********************************************************************
#* Apache License 2.0
#*
#* This file is part of the GFDL Flexible Modeling System (FMS).
#*
#* Licensed under the Apache License, Version 2.0 (the "License");
#* you may not use this file except in compliance with the License.
#* You may obtain a copy of the License at
#*
#* http://www.apache.org/licenses/LICENSE-2.0
#*
#* FMS is distributed in the hope that it will be useful, but WITHOUT
#* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied;
#* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
#* PARTICULAR PURPOSE. See the License for the specific language
#* governing permissions and limitations under the License.
#***********************************************************************
# This is an automake file for the offloading directory of the FMS
# package.

# Ryan Mulhall 2025

# Include .h and .mod files.
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_FCFLAGS = $(FC_MODINC). $(FC_MODOUT)$(MODDIR)

# Build this uninstalled convenience library.
noinst_LTLIBRARIES = liboffload.la

# The convenience library depends on its source.
liboffload_la_SOURCES = \
metadata_transfer.F90 \
offloading_io.F90

MODFILES = \
metadata_transfer_mod.$(FC_MODEXT) \
offloading_io_mod.$(FC_MODEXT)

offloading_io_mod.$(FC_MODEXT): metadata_transfer_mod.$(FC_MODEXT)

BUILT_SOURCES = $(MODFILES)
nodist_include_HEADERS = $(MODFILES)

include $(top_srcdir)/mkmods.mk
Loading
Loading