mirror of
https://github.com/JHUAPL/kaiju.git
synced 2026-01-08 22:58:05 -05:00
@@ -1,5 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.20.2)
|
||||
project(Kaiju Fortran)
|
||||
project(Kaiju Fortran C)
|
||||
#K: Adding C to project to deal w/ issues w/ most recent HDF (10/13/25)
|
||||
|
||||
# add and search for pfunit (fingers crossed)
|
||||
list(APPEND CMAKE_PREFIX_PATH "./external")
|
||||
|
||||
@@ -83,7 +83,12 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
|
||||
#Base
|
||||
string(APPEND CMAKE_Fortran_FLAGS " -fPIC -fpconstant")
|
||||
#Production
|
||||
set(PROD "-align array64byte -align rec32byte -no-prec-div -fast-transcendentals")
|
||||
set(PROD "-align array64byte -align rec32byte -no-prec-div")
|
||||
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.1)
|
||||
#Fast transcendentals removed in ifx
|
||||
string(APPEND PROD " -fast-transcendentals")
|
||||
endif()
|
||||
|
||||
#Production with Debug Info
|
||||
set(PRODWITHDEBUGINFO "-traceback -debug all -align array64byte -align rec32byte -no-prec-div -fast-transcendentals")
|
||||
#Debug
|
||||
@@ -123,11 +128,15 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
|
||||
endif()
|
||||
string(APPEND PROD " -march=core-avx2")
|
||||
string(APPEND PRODWITHDEBUGINFO " -march=core-avx2")
|
||||
elseif (HOST MATCHES stampede3)
|
||||
message("You're on Stampede3!")
|
||||
string(APPEND PROD " -xCORE-AVX512")
|
||||
string(APPEND PRODWITHDEBUGINFO " -xCORE-AVX512")
|
||||
endif()
|
||||
|
||||
#Check Intel Fortran version
|
||||
if(NOT ALLOW_INVALID_COMPILERS AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER "2021.9")
|
||||
message(FATAL_ERROR "Intel Fortran compilers newer than 2023 (version 2021.8) are not supported. Set the ALLOW_INVALID_COMPILERS variable to ON to force compilation at your own risk.")
|
||||
if(NOT ALLOW_INVALID_COMPILERS AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER "2021.9" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "2025.1")
|
||||
message(FATAL_ERROR "Intel OneAPI compilers between 2022-2024 have compiler bugs which cause weird numerical errors in our code. You can set the ALLOW_INVALID_COMPILERS variable to ON to force compilation at your own risk. You'll probably get what you deserve.")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
|
||||
|
||||
@@ -86,7 +86,7 @@ module gamCouple_mpi_G2V
|
||||
|
||||
! initialize F08 MPI objects
|
||||
App%couplingComm = MPI_COMM_NULL
|
||||
App%zeroArraytypes = (/ MPI_DATATYPE_NULL /)
|
||||
App%zeroArraytypes(:) = (/ MPI_INTEGER /) ! = (/ MPI_DATATYPE_NULL /)
|
||||
|
||||
! split voltron helpers off of the communicator
|
||||
! split couplingPoolComm into a communicator with only the non-helper voltron rank
|
||||
|
||||
@@ -559,13 +559,13 @@ module gamCouple_mpi_V2G
|
||||
|
||||
subroutine sendGameraCplDataMpi(gCplApp, CouplingTargetT)
|
||||
class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp
|
||||
real(rp), intent(in) :: CouplingTargetT
|
||||
real(rp), intent(inout) :: CouplingTargetT
|
||||
|
||||
call sendShallowCplDataMpi(gCplApp)
|
||||
if(gCplApp%doDeep) call sendDeepCplDataMpi(gCplApp)
|
||||
call sendCplTimeMpi(gCplApp, CouplingTargetT)
|
||||
|
||||
end subroutine
|
||||
end subroutine sendGameraCplDataMpi
|
||||
|
||||
subroutine sendShallowCplDataMpi(gCplApp)
|
||||
class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp
|
||||
@@ -628,14 +628,14 @@ module gamCouple_mpi_V2G
|
||||
|
||||
subroutine sendCplTimeMpi(gCplApp, CouplingTargetT)
|
||||
class(gamCouplerMpi_volt_T), intent(inout) :: gCplApp
|
||||
real(rp), intent(in) :: CouplingTargetT
|
||||
real(rp), intent(inout) :: CouplingTargetT
|
||||
|
||||
integer :: ierr
|
||||
|
||||
! Send Target Time for next coupling
|
||||
call mpi_bcast(CouplingTargetT,1,MPI_MYFLOAT, gCplApp%myRank, gCplApp%couplingComm, ierr)
|
||||
|
||||
end subroutine
|
||||
end subroutine sendCplTimeMpi
|
||||
|
||||
end module
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ module volthelpers_mpi
|
||||
! chimp data update functions
|
||||
|
||||
subroutine sendChimpStateData(ebState, vHelpComm)
|
||||
type(ebState_T), intent(in) :: ebState
|
||||
type(ebState_T), intent(inout) :: ebState
|
||||
type(MPI_Comm), intent(in) :: vHelpComm
|
||||
|
||||
integer :: ierr, length
|
||||
@@ -195,7 +195,7 @@ module volthelpers_mpi
|
||||
call mpi_Abort(MPI_COMM_WORLD, 1, ierr)
|
||||
end if
|
||||
|
||||
end subroutine
|
||||
end subroutine sendChimpStateData
|
||||
|
||||
subroutine recvChimpStateData(ebState, vHelpComm)
|
||||
type(ebState_T), intent(inout) :: ebState
|
||||
@@ -272,7 +272,7 @@ module volthelpers_mpi
|
||||
end subroutine
|
||||
|
||||
subroutine sendChimpUpdate(vApp)
|
||||
type(voltAppMpi_T), intent(in) :: vApp
|
||||
type(voltAppMpi_T), intent(inout) :: vApp
|
||||
|
||||
integer :: ierr, length
|
||||
character( len = MPI_MAX_ERROR_STRING) :: message
|
||||
@@ -317,7 +317,7 @@ module volthelpers_mpi
|
||||
call mpi_Abort(MPI_COMM_WORLD, 1, ierr)
|
||||
end if
|
||||
|
||||
end subroutine
|
||||
end subroutine sendChimpUpdate
|
||||
|
||||
subroutine recvChimpUpdate(vApp)
|
||||
type(voltAppMpi_T), intent(inout) :: vApp
|
||||
@@ -374,14 +374,15 @@ module volthelpers_mpi
|
||||
type(voltAppMpi_T), intent(in) :: vApp
|
||||
integer, intent(in) :: rType
|
||||
|
||||
integer :: ierr
|
||||
integer :: ierr,wtf
|
||||
type(MPI_Request) :: helpReq
|
||||
|
||||
wtf = rType
|
||||
! async to match waiting helper nodes
|
||||
call mpi_Ibcast(rType, 1, MPI_INTEGER, 0, vApp%vHelpComm, helpReq, ierr)
|
||||
call mpi_Ibcast(wtf, 1, MPI_INTEGER, 0, vApp%vHelpComm, helpReq, ierr)
|
||||
call mpi_wait(helpReq, MPI_STATUS_IGNORE, ierr)
|
||||
|
||||
end subroutine
|
||||
end subroutine vhRequestType
|
||||
|
||||
subroutine vhReqStep(vApp)
|
||||
type(voltAppMpi_T), intent(inout) :: vApp
|
||||
|
||||
Reference in New Issue
Block a user