Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f1da9f4
Add smartredis to MPAS-Ocean build
cbegeman Apr 25, 2022
0c8da57
Add client initialization to forward mode
cbegeman Apr 25, 2022
211e400
Use a modified copy of enum_fortran.inc in mpas_framework
cbegeman Feb 28, 2022
2a09863
Use streams for smartredis io
cbegeman Mar 28, 2022
dd012e7
Add F90 files to mode_forward
cbegeman Jul 12, 2022
c2457bf
Add commented notes/code about smartredis comms
cbegeman Jul 13, 2022
1ec22c4
Updates to forward mode data calls
cbegeman Jul 27, 2022
1f0d582
Test send/recv arrays at init
cbegeman Aug 25, 2022
9152af3
Add other client io
cbegeman Aug 25, 2022
ad7fa97
Run script on client
cbegeman Aug 25, 2022
ea20d13
Add python script with different function defs
cbegeman Aug 25, 2022
34b426f
Run analysis script from mpas-o
cbegeman Aug 26, 2022
f0473aa
Add db launch script
cbegeman Aug 26, 2022
ec04017
Add scripts to sync db with mpas-o
cbegeman Aug 26, 2022
8d8b2be
Test namelist change in forward mode
cbegeman Aug 29, 2022
686a595
Test batch client (nodes>=3)
cbegeman Aug 29, 2022
5d9c285
Add dataset to mpas_forward_mode
cbegeman Aug 30, 2022
8dd8c7a
Fixup mpas_client_script
cbegeman Aug 30, 2022
de1de43
Migrate routines to mpas-framework
cbegeman Aug 30, 2022
7901fc9
Support send tensor and send config to client
cbegeman Aug 31, 2022
7cbf1ef
Test run script
cbegeman Sep 2, 2022
8f9f518
Add smart client recv interface
cbegeman Sep 14, 2022
43ee4a7
Clean-up smartsim calls in forward mode
cbegeman Sep 14, 2022
b065812
Add config option for smartsim
cbegeman Sep 14, 2022
f61482e
Add smart config recv routine
cbegeman Sep 14, 2022
c797338
Add dataset routines
cbegeman Sep 14, 2022
a089bfa
Fixup dataset, client routines
cbegeman Oct 10, 2022
f88bca2
Add error parser to smart routines
cbegeman Oct 10, 2022
137fce2
Update helper scripts
cbegeman Oct 10, 2022
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
12 changes: 11 additions & 1 deletion components/mpas-framework/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ CPPINCLUDES =
FCINCLUDES =
LIBS =


#
# If user has indicated a PIO2 library, define USE_PIO2 pre-processor macro
#
Expand Down Expand Up @@ -605,6 +606,15 @@ endif
LIBS += -L$(PNETCDF)/$(PNETCDFLIBLOC) -lpnetcdf
endif

ifeq "$(USE_SMARTSIM)" "true"
CPPINCLUDES += -I$(SMARTREDIS_PATH)/include
FCINCLUDES += -I$(SMARTREDIS_PATH)/include
LIBS += -L$(SMARTREDIS_PATH)/lib
LIBS += -lhiredis.a
LIBS += -lredis++.a
LIBS += -lsmartredis-fortran.a
endif

ifeq "$(USE_LAPACK)" "true"
ifndef LAPACK
$(error LAPACK is not set. Please set LAPACK to the LAPACK install directory when USE_LAPACK=true)
Expand Down Expand Up @@ -1005,7 +1015,7 @@ drver: $(AUTOCLEAN_DEPS) framework dycore


mpas: $(AUTOCLEAN_DEPS) framework dycore drver
$(LINKER) $(LDFLAGS) -o $(EXE_NAME) $(FWPATH)/driver/*.o -L$(FWPATH) -Lsrc -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L$(FWPATH)/external/esmf_time_f90 -lesmf_time
$(LINKER) $(LDFLAGS) -o $(EXE_NAME) $(FWPATH)/driver/*.o -L$(FWPATH) -Lsrc -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L$(FWPATH)/external/esmf_time_f90 -lesmf_time -L$(SMARTREDIS_PATH)/lib -lhiredis -lredis++ -lsmartredis-fortran

framework:
cd $(FWPATH); $(MAKE) \
Expand Down
6 changes: 6 additions & 0 deletions components/mpas-framework/src/framework/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ OBJS = mpas_kind_types.o \
mpas_domain_routines.o \
mpas_field_routines.o \
mpas_pool_routines.o \
mpas_smart_routines.o \
xml_stream_parser.o \
regex_matching.o \
mpas_field_accessor.o \
Expand Down Expand Up @@ -110,6 +111,11 @@ mpas_forcing.o: mpas_derived_types.o mpas_timekeeping.o mpas_stream_manager.o mp

mpas_c_interfacing.o:

mpas_smart_routines.o: mpas_derived_types.o mpas_kind_types.o mpas_pool_routines.o mpas_field_routines.o mpas_threading.o mpas_log.o \
$(SMARTREDIS_PATH)/../src/fortran/fortran_c_interop.F90 \
$(SMARTREDIS_PATH)/../src/fortran/dataset.F90 \
$(SMARTREDIS_PATH)/../src/fortran/client.F90

xml_stream_parser.o: xml_stream_parser.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(CPPINCLUDES) -I../external/ezxml -c xml_stream_parser.c

Expand Down
79 changes: 79 additions & 0 deletions components/mpas-framework/src/framework/enum_fortran.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
! BSD 2-Clause License
!
! Copyright (c) 2021, Hewlett Packard Enterprise
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
!
! 1. Redistributions of source code must retain the above copyright notice, this
! list of conditions and the following disclaimer.
!
! 2. Redistributions in binary form must reproduce the above copyright notice,
! this list of conditions and the following disclaimer in the documentation
! and/or other materials provided with the distribution.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

! Dummy enum, used to set the integer kind used
integer, parameter :: enum_kind = 4

! The following enums have analogues to the C and C++ clients. Fortran does not haven named enums, but the name:value
! parameters must be the same. By convention negative enums, represent items that are not supported in the Fortran
! client.

! TensorType
enum, bind(c)
enumerator :: tensor_invalid = -1
enumerator :: tensor_dbl = 1
enumerator :: tensor_flt = 2
enumerator :: tensor_int8 = 3
enumerator :: tensor_int16 = 4
enumerator :: tensor_int32 = 5
enumerator :: tensor_int64 = 6
enumerator :: tensor_uint8 = -1
enumerator :: tensor_uint16 = -1
end enum

! MemoryLayout​
enum, bind(c)
enumerator :: c_invalid = -1
enumerator :: c_nested = 1
enumerator :: c_contiguous = 2
enumerator :: c_fortran_nested = 3
enumerator :: c_fortran_contiguous = 4
end enum

! MetadataType​
enum, bind(c)
enumerator :: meta_invalid = -1
enumerator :: meta_dbl = 1
enumerator :: meta_flt = 2
enumerator :: meta_int32 = 3
enumerator :: meta_int64 = 4
enumerator :: meta_uint32 = -1
enumerator :: meta_uint64 = -1
enumerator :: meta_string = 7
end enum

! SRError
enum, bind(c)
enumerator :: SRNoError = 0
enumerator :: SRBadAllocError = 1
enumerator :: SRDatabaseError = 2
enumerator :: SRInternalError = 3
enumerator :: SRRuntimeError = 4
enumerator :: SRParameterError = 5
enumerator :: SRTimeoutError = 6
enumerator :: SRKeyError = 7
enumerator :: SRInvalidError = -1
end enum
Loading