Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows double precision compilation #145

Merged
merged 4 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
18 changes: 15 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
mpi: ["Yes", "No"]
mtln: ["Yes"]
hdf: ["Yes"]
double-precision: ["No"]

include:
- os: ubuntu-22.04
Expand All @@ -32,18 +33,28 @@ jobs:
mpi: "No"
mtln: "No"
hdf: "Yes"
double-precision: "No"

- os: ubuntu-latest
compiler: {name: 'nvidia-hpc', version: '24.5'}
build-type: "Release"
mpi: "No"
mtln: "No"
hdf: "No"

double-precision: "No"

- os: ubuntu-latest
compiler: {name: 'intel', version: '2024.2'}
build-type: "Release"
mpi: "Yes"
mtln: "No"
hdf: "Yes"
double-precision: "Yes"

fail-fast: false

runs-on: ${{ matrix.os }}
name: ${{matrix.os}} / ${{matrix.compiler.name}} / ${{matrix.build-type}}-mpi(${{matrix.mpi}})-mtln(${{matrix.mtln}})-hdf(${{matrix.hdf}})
name: ${{matrix.os}} / ${{matrix.compiler.name}} / ${{matrix.build-type}}-mpi(${{matrix.mpi}})-mtln(${{matrix.mtln}})-hdf(${{matrix.hdf}})-double(${{matrix.double-precision}})

steps:
- name: Checkout
Expand Down Expand Up @@ -80,7 +91,8 @@ jobs:
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DSEMBA_FDTD_ENABLE_MPI=${{matrix.mpi}} \
-DSEMBA_FDTD_ENABLE_HDF=${{matrix.hdf}} \
-DSEMBA_FDTD_ENABLE_MTLN=${{matrix.mtln}}
-DSEMBA_FDTD_ENABLE_MTLN=${{matrix.mtln}} \
-DSEMBA_FDTD_ENABLE_DOUBLE_PRECISION=${{matrix.double-precision}}
cmake --build build -j

- name: Run unit tests
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
mpi: ["No"]
mtln: ["Yes"]
hdf: ["Yes"]
double-precision: ["Yes", "No"]

fail-fast: false
runs-on: ${{matrix.os}}

name: ${{matrix.os}} / ${{matrix.compiler.name}} / ${{matrix.build-type}}-mpi(${{matrix.mpi}})-mtln(${{matrix.mtln}})-hdf(${{matrix.hdf}})
name: ${{matrix.os}} / ${{matrix.compiler.name}} / ${{matrix.build-type}}-mpi(${{matrix.mpi}})-mtln(${{matrix.mtln}})-hdf(${{matrix.hdf}})-double(${{matrix.double-precision}})

steps:

Expand Down Expand Up @@ -61,7 +62,8 @@ jobs:
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DSEMBA_FDTD_ENABLE_MPI=${{matrix.mpi}} \
-DSEMBA_FDTD_ENABLE_HDF=${{matrix.hdf}} \
-DSEMBA_FDTD_ENABLE_MTLN=${{matrix.mtln}}
-DSEMBA_FDTD_ENABLE_MTLN=${{matrix.mtln}} \
-DSEMBA_FDTD_ENABLE_DOUBLE_PRECISION=${{matrix.double-precision}}
cmake --build build -j

- name: Run unit tests
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,27 @@ option(SEMBA_FDTD_ENABLE_MPI "Use MPI" OFF)
option(SEMBA_FDTD_ENABLE_HDF "Use HDF" ON)
option(SEMBA_FDTD_ENABLE_MTLN "Use MTLN" ON)
option(SEMBA_FDTD_ENABLE_SMBJSON "Use smbjson" ON)
option(SEMBA_FDTD_ENABLE_DOUBLE_PRECISION "Use double precision (CompileWithReal8)" OFF)
option(SEMBA_FDTD_ENABLE_TEST "Compile tests" ON)

option(SEMBA_FDTD_EXECUTABLE "Compiles executable" ON)
option(SEMBA_FDTD_MAIN_LIB "Compiles main library" ON)
option(SEMBA_FDTD_COMPONENTS_LIB "Compiles components library" ON)
option(SEMBA_FDTD_OUTPUTS_LIB "Compiles outputs library" ON)
option(SEMBA_FDTD_MAIN_LIB "Compiles main library" ON)
option(SEMBA_FDTD_COMPONENTS_LIB "Compiles components library" ON)
option(SEMBA_FDTD_OUTPUTS_LIB "Compiles outputs library" ON)

if(SEMBA_FDTD_ENABLE_SMBJSON)
add_definitions(-DCompileWithSMBJSON)
endif()
if (SEMBA_FDTD_ENABLE_MTLN)
add_definitions(-DCompileWithMTLN)
endif()
if (SEMBA_FDTD_ENABLE_DOUBLE_PRECISION)
add_definitions(-DCompileWithReal8)
else()
add_definitions(-DCompileWithReal4)
endif()
add_definitions(
-DCompileWithInt2
-DCompileWithReal4
-DCompileWithOpenMP
)

Expand Down
4 changes: 2 additions & 2 deletions test/smbjson/test_read_dielectricSlab.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function expectedProblemDescription() result (expected)
expected%front%tipoFrontera(F_XU) = F_PEC
expected%front%tipoFrontera(F_YL) = F_PMC
expected%front%tipoFrontera(F_YU) = F_PMC
expected%front%tipoFrontera(F_ZL) = F_PML
expected%front%tipoFrontera(F_ZU) = F_PML
expected%front%tipoFrontera(F_ZL) = F_MUR
expected%front%tipoFrontera(F_ZU) = F_MUR

! Expected sources.
allocate(expected%plnSrc%collection(1))
Expand Down
4 changes: 2 additions & 2 deletions test/smbjson/test_read_thinSlot.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function expectedProblemDescription() result (expected)
expected%front%tipoFrontera(F_XU) = F_PER
expected%front%tipoFrontera(F_YL) = F_PER
expected%front%tipoFrontera(F_YU) = F_PER
expected%front%tipoFrontera(F_ZL) = F_PML
expected%front%tipoFrontera(F_ZU) = F_PML
expected%front%tipoFrontera(F_ZL) = F_MUR
expected%front%tipoFrontera(F_ZU) = F_MUR

! Expected sources.
allocate(expected%plnSrc%collection(1))
Expand Down
4 changes: 2 additions & 2 deletions testData/input_examples/dielectric_slab.fdtd.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"xUpper": {"type": "pec"},
"yLower": {"type": "pmc"},
"yUpper": {"type": "pmc"},
"zLower": {"type": "pml"},
"zUpper": {"type": "pml"}
"zLower": {"type": "mur"},
"zUpper": {"type": "mur"}
},

"mesh": {
Expand Down
4 changes: 2 additions & 2 deletions testData/input_examples/thinSlot.fdtd.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"xUpper": {"type": "periodic"},
"yLower": {"type": "periodic"},
"yUpper": {"type": "periodic"},
"zLower": {"type": "pml"},
"zUpper": {"type": "pml"}
"zLower": {"type": "mur"},
"zUpper": {"type": "mur"}
},

"mesh": {
Expand Down
Loading