Skip to content

Commit

Permalink
Merge pull request #479 from galacticusorg/noninstantFix
Browse files Browse the repository at this point in the history
Copy element index in to OpenMP parallel region
  • Loading branch information
abensonca authored Sep 26, 2023
2 parents 7929a8e + 7655711 commit 54c7f91
Show file tree
Hide file tree
Showing 5 changed files with 560 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6745,6 +6745,44 @@ jobs:
./test-mass-host-maximum.pl 2>&1 | tee test.log
! grep -q FAIL test.log
- run: echo "This job's status is ${{ job.status }}."
Test-Noninstantaneous-Recycling:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
needs: Build-Executable-Linux
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository datasets
uses: actions/checkout@v4
with:
repository: galacticusorg/datasets
path: datasets
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- name: "Set environmental variables"
run: |
echo "GALACTICUS_EXEC_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "GALACTICUS_DATA_PATH=$GITHUB_WORKSPACE/datasets" >> $GITHUB_ENV
echo "GALACTICUS_ANALYSIS_PERL_PATH=$GITHUB_WORKSPACE/analysis-perl" >> $GITHUB_ENV
- name: Download executables
uses: actions/download-artifact@v3
with:
name: galacticus-exec
- name: Create test suite output directory
run: mkdir -p $GALACTICUS_EXEC_PATH/testSuite/outputs
- name: Run test
run: |
cd $GALACTICUS_EXEC_PATH
git config --global --add safe.directory $GALACTICUS_EXEC_PATH
chmod u=wrx ./Galacticus.exe
cd testSuite
chmod u=wrx ./test-noninstantaneous-recycling.pl
set -o pipefail
./test-noninstantaneous-recycling.pl 2>&1 | tee test.log
! grep -q FAIL test.log
- run: echo "This job's status is ${{ job.status }}."
Test-Satellite-Distance-Minimum:
runs-on: ubuntu-latest
container: ghcr.io/galacticusorg/buildenv:latest
Expand Down Expand Up @@ -10405,6 +10443,7 @@ jobs:
Test-Inactive-Luminosities,
Test-Interoutput-Star-Formation-Rate,
Test-Mass-Host-Maximum,
Test-Noninstantaneous-Recycling,
Test-Satellite-Distance-Minimum,
Test-Tree-Filter-Labels,
Test-Constrained-Merger-Trees,
Expand Down
2 changes: 1 addition & 1 deletion source/stellar_astrophysics.tracks.file.F90
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ subroutine fileInterpolationCompute(self,initialMass,metallicity,age,interpolati
interpolationFactorsMass(iMetallicity,:)=[0.0d0,1.0d0]
massOutOfRange=.true.
else
call self%interpolatorMass(iMetallicity)%linearFactors(initialMass,interpolationIndicesMass(iMetallicity,1),interpolationFactorsMass(iMetallicity,:))
call self%interpolatorMass(jMetallicity)%linearFactors(initialMass,interpolationIndicesMass(iMetallicity,1),interpolationFactorsMass(iMetallicity,:))
interpolationIndicesMass(iMetallicity,2)=interpolationIndicesMass(iMetallicity,1)+1
end if
! Loop over masses.
Expand Down
5 changes: 3 additions & 2 deletions source/stellar_populations.standard.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function standardConstructorParameters(parameters) result(self)
<source>parameters</source>
</inputParameter>
<inputParameter>

<name>metalYield</name>
<defaultValue>0.0d0</defaultValue>
<description>The metal yield to use in the instantaneous stellar evolution approximation. (If not specified it will be computed internally.)</description>
Expand Down Expand Up @@ -376,7 +377,7 @@ double precision function standardInterpolate(self,abundances_,ageMinimum,ageMax
type (integratorCompositeGaussKronrod1D) :: integrator_
integer :: fileFormat , iAge , &
& iMetallicity , loopCount , &
& loopCountTotal , i
& loopCountTotal , i
double precision :: maximumMass , minimumMass , &
& metallicity
type (hdf5Object ) :: file , dataset
Expand Down Expand Up @@ -450,7 +451,7 @@ double precision function standardInterpolate(self,abundances_,ageMinimum,ageMax
& *tableAgeCount
loopCount = 0
self_ => self
!$omp parallel private (iAge,iMetallicity,progressMessage,minimumMass,maximumMass,integrator_) copyin(self_)
!$omp parallel private (iAge,iMetallicity,progressMessage,minimumMass,maximumMass,integrator_) copyin(self_,indexElement_)
allocate(stellarAstrophysics_,mold=self%stellarAstrophysics_)
allocate(initialMassFunction_,mold=self%initialMassFunction_)
allocate(stellarFeedback_ ,mold=self%stellarFeedback_ )
Expand Down
Loading

0 comments on commit 54c7f91

Please sign in to comment.