Skip to content

Commit

Permalink
Merge branch 'main' into mpi
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriaRaffuzzi authored Dec 23, 2024
2 parents 3fb146e + 4a28285 commit 35fff13
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
build-and-test:
strategy:
matrix:
compiler: [gfortran9, gfortran10]
#compiler: [gfortran8, gfortran9, gfortran10]
compiler: [gfortran10, gfortran11, gfortran12]
runs-on: ubuntu-20.04
container:
image: mikolajkowalski/scone-test:${{matrix.compiler}}_pfu4
Expand All @@ -29,7 +28,7 @@ jobs:
build-and-test-debug:
runs-on: ubuntu-20.04
container:
image: mikolajkowalski/scone-test:gfortran10_pfu4
image: mikolajkowalski/scone-test:gfortran12_pfu4
options: --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
steps:
- uses: actions/checkout@v3
Expand All @@ -44,7 +43,7 @@ jobs:
build-and-test-no-openmp:
runs-on: ubuntu-20.04
container:
image: mikolajkowalski/scone-test:gfortran10_pfu4
image: mikolajkowalski/scone-test:gfortran12_pfu4
options: --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
steps:
- uses: actions/checkout@v3
Expand All @@ -59,7 +58,7 @@ jobs:
build-and-test-no-mpi:
runs-on: ubuntu-20.04
container:
image: mikolajkowalski/scone-test:gfortran10_pfu4
image: mikolajkowalski/scone-test:gfortran12_pfu4
steps:
- uses: actions/checkout@v3
- name: CompileAndTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module baseMgNeutronDatabase_iTest
use dictionary_class, only : dictionary
use dictParser_func, only : charToDict
use particle_class, only : particle
use RNG_class, only : RNG

! Nuclear Data Objects & Interfaces
use baseMgNeutronDatabase_class, only : baseMgNeutronDatabase, baseMgNeutronDatabase_CptrCast, &
Expand Down Expand Up @@ -59,12 +60,12 @@ subroutine testBaseMgNeutronDatabaseWithP0()
type(dictionary) :: matMenuDict
type(particle) :: p
type(neutronMacroXSs) :: xss
type(RNG), target :: pRNG
type(baseMgNeutronMaterial),pointer :: mat
class(baseMgNeutronMaterial),pointer :: matClass
class(reactionHandle), pointer :: reac
real(defReal),parameter :: TOL = 1.0E-6_defReal


data_ptr => database

! Load materialMenu
Expand All @@ -81,6 +82,8 @@ subroutine testBaseMgNeutronDatabaseWithP0()
@assertEqual(4, database % nGroups())

! Test getting Transport XS
! Associate pointer to pass tests in debug mode
p % pRNG => pRNG
p % G = 1
@assertEqual(2.1_defReal, database % getTrackingXS(p, 1, MATERIAL_XS), TOL)

Expand Down Expand Up @@ -185,12 +188,12 @@ subroutine testBaseMgNeutronDatabaseWithP1()
type(dictionary) :: matMenuDict
type(particle) :: p
type(neutronMacroXSs) :: xss
type(RNG), target :: pRNG
type(baseMgNeutronMaterial),pointer :: mat
class(baseMgNeutronMaterial),pointer :: matClass
class(reactionHandle), pointer :: reac
real(defReal),parameter :: TOL = 1.0E-6_defReal


data_ptr => database

! Load materialMenu
Expand All @@ -207,6 +210,8 @@ subroutine testBaseMgNeutronDatabaseWithP1()
@assertEqual(4, database % nGroups())

! Test getting Transport XS
! Associate pointer to pass tests in debug mode
p % pRNG => pRNG
p % G = 1
@assertEqual(2.1_defReal, database % getTrackingXS(p, 1, MATERIAL_XS), TOL)

Expand Down
6 changes: 5 additions & 1 deletion NuclearData/mgNeutronData/mgNeutronMaterial_inter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ subroutine getMacroXSs_byP(self, xss, p)
class(mgNeutronMaterial), intent(in) :: self
type(neutronMacroXSs), intent(out) :: xss
class(particle), intent(in) :: p
integer(shortInt) :: matIdx
character(100), parameter :: Here = 'getMacroXSs_byP (mgNeutronMateerial_inter.f90)'

if (.not. p % isMG) call fatalError(Here, 'CE particle was given to MG data')

associate (matCache => cache_materialCache(p % matIdx()))
! Store p % matIdx() in a dedicated variable to avoid compilation errors with gfortran >= 13.2
matIdx = p % matIdx()

associate (matCache => cache_materialCache(matIdx))

if (matCache % G_tail /= p % G) then
! Get cross sections
Expand Down

0 comments on commit 35fff13

Please sign in to comment.