Skip to content

Commit

Permalink
Merge pull request #60 from ORNL-Fusion/fix-method-crash
Browse files Browse the repository at this point in the history
Fix crash that happens on M1 processors
  • Loading branch information
cianciosa authored Sep 9, 2024
2 parents b0c3a7c + b00a0c8 commit 07e3043
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
if: ${{matrix.os == 'macos-latest'}}
shell: bash
working-directory: ${{runner.workspace}}/Stellarator-Tools/build
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.mode}} -DCMAKE_Fortran_COMPILER=gfortran-11 -DBUILD_BOOZ_XFORM=ON -DBUILD_V3FIT=ON -DBUILD_V3RFUN=ON -DBUILD_SIESTA=ON -DBUILD_LGRID=ON -DBUILD_SURFACE=ON -DBUILD_BMW=ON -DBUILD_PARVMEC=ON -DBUILD_DESCUR=ON -DBUILD_TAG_BOOZ_XFORM=master_dev -DBUILD_TAG_V3FIT=master_dev -DBUILD_TAG_V3RFUN=master_dev -DBUILD_TAG_SIESTA=master_dev -DBUILD_TAG_LGRID=master_dev -DBUILD_TAG_SURFACE=master_dev -DBUILD_TAG_BMW=master_dev -DBUILD_TAG_LIBSTELL=${{github.ref_name}} -DBUILD_TAG_MAKEGRID=master_dev -DBUILD_TAG_PARVMEC=master_dev -DBUILD_TAG_DESCUR=master_dev -DUSE_FAST_COPY=ON -DUSE_PROFILER=ON ${{runner.workspace}}/Stellarator-Tools/
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.mode}} -DCMAKE_Fortran_COMPILER=gfortran-14 -DBUILD_BOOZ_XFORM=ON -DBUILD_V3FIT=ON -DBUILD_V3RFUN=ON -DBUILD_SIESTA=ON -DBUILD_LGRID=ON -DBUILD_SURFACE=ON -DBUILD_BMW=ON -DBUILD_PARVMEC=ON -DBUILD_DESCUR=ON -DBUILD_TAG_BOOZ_XFORM=master_dev -DBUILD_TAG_V3FIT=master_dev -DBUILD_TAG_V3RFUN=master_dev -DBUILD_TAG_SIESTA=master_dev -DBUILD_TAG_LGRID=master_dev -DBUILD_TAG_SURFACE=master_dev -DBUILD_TAG_BMW=master_dev -DBUILD_TAG_LIBSTELL=${{github.ref_name}} -DBUILD_TAG_MAKEGRID=master_dev -DBUILD_TAG_PARVMEC=master_dev -DBUILD_TAG_DESCUR=master_dev -DUSE_FAST_COPY=ON -DUSE_PROFILER=ON ${{runner.workspace}}/Stellarator-Tools/
- name: Configure CMake Linux
if: ${{matrix.os == 'ubuntu-latest'}}
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
if: ${{matrix.os == 'macos-latest'}}
shell: bash
working-directory: ${{runner.workspace}}/Stellarator-Tools/build
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.mode}} -DCMAKE_Fortran_COMPILER=gfortran-11 -DBUILD_BOOZ_XFORM=ON -DBUILD_V3FIT=ON -DBUILD_V3RFUN=ON -DBUILD_SIESTA=ON -DBUILD_LGRID=ON -DBUILD_SURFACE=ON -DBUILD_BMW=ON -DBUILD_PARVMEC=ON -DBUILD_DESCUR=ON -DBUILD_TAG_LIBSTELL=${{github.ref_name}} -DUSE_FAST_COPY=ON -DUSE_PROFILER=ON ${{runner.workspace}}/Stellarator-Tools/
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.mode}} -DCMAKE_Fortran_COMPILER=gfortran-14 -DBUILD_BOOZ_XFORM=ON -DBUILD_V3FIT=ON -DBUILD_V3RFUN=ON -DBUILD_SIESTA=ON -DBUILD_LGRID=ON -DBUILD_SURFACE=ON -DBUILD_BMW=ON -DBUILD_PARVMEC=ON -DBUILD_DESCUR=ON -DBUILD_TAG_LIBSTELL=${{github.ref_name}} -DUSE_FAST_COPY=ON -DUSE_PROFILER=ON ${{runner.workspace}}/Stellarator-Tools/
- name: Configure CMake Linux
if: ${{matrix.os == 'ubuntu-latest'}}
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ target_link_libraries (stell
$<$<AND:$<BOOL:${LAPACK_FOUND}>,$<VERSION_GREATER_EQUAL:${CMAKE_VERSION},3.18>>:LAPACK::LAPACK>
$<$<AND:$<BOOL:${BLAS_FOUND}>,$<VERSION_LESS:${CMAKE_VERSION},3.18>>:${BLAS_LIBRARIES}>
$<$<AND:$<BOOL:${LAPACK_FOUND}>,$<VERSION_LESS:${CMAKE_VERSION},3.18>>:${LAPACK_LIBRARIES}>
# sanitizer
# traps
# checks
)
target_include_directories (stell

Expand Down
2 changes: 1 addition & 1 deletion Sources/Miscel/line_segment.f
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ PURE FUNCTION y_value_int(x0, x1, yy, xx, ilow, ihigh)
y_value_int = 0.0
ELSE
y_value_int = slope(yy, xx, ilow, ihigh) &
& / 2.0*(x1**2.0 - x0**2.0) &
& / 2.0*(x1*x1 - x0*x0) &
& + offset(yy, xx, ilow, ihigh)*(x1 - x0)
END IF

Expand Down
15 changes: 7 additions & 8 deletions Sources/Modules/integration_path.f
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ MODULE integration_path
!> @param[in] length Length of the interval.
!> @returns A pointer to a constructed @ref integration_path_class object.
!-------------------------------------------------------------------------------
FUNCTION make_integrator(method, npoints, length)
FUNCTION make_integrator(method, npoints, length) RESULT(res)

IMPLICIT NONE

! Declare Arguments
CLASS (integration_path_class), POINTER :: make_integrator
CLASS (integration_path_class), POINTER :: res
CHARACTER (len=*), INTENT(in) :: method
INTEGER, INTENT(in) :: npoints
REAL (rprec), INTENT(in) :: length
Expand All @@ -179,14 +179,13 @@ FUNCTION make_integrator(method, npoints, length)
SELECT CASE (method)

CASE ('add')
make_integrator => integration_path_class()
res => integration_path_class()

CASE ('gleg')
make_integrator => integration_path_gleg_class(npoints)
res => integration_path_gleg_class(npoints)

CASE ('hp_gleg')
make_integrator => integration_path_hp_glep_class(npoints, &
& length)
res => integration_path_hp_glep_class(npoints, length)

END SELECT

Expand Down Expand Up @@ -442,8 +441,8 @@ RECURSIVE FUNCTION integration_path_integrate_paths(this, path, &
start_time = profiler_get_start_time()

IF (ASSOCIATED(path%next)) THEN
total = this%integrate(path%next, context)
total = this%integrate(context, path, path%next)
total = this%integrate_paths(path%next, context) &
& + this%integrate_path(context, path, path%next)
ELSE
total = 0.0
END IF
Expand Down

0 comments on commit 07e3043

Please sign in to comment.