Skip to content

Commit

Permalink
Address Sanitizer found issues with egyro_test
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Hahn <hahnse@ornl.gov>
  • Loading branch information
quantumsteve committed Feb 28, 2024
1 parent 864ff17 commit 6e95bd9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ target_link_libraries (korc_depends
INTERFACE

sanitizer
$<$<BOOL:${OpenMP_Fortran_FOUND}>:OpenMP::OpenMP_Fortran>
$<$<BOOL:${OpenMP_Fortran_FOUND}>:OpenMP::OpenMP_Fortran>
$<$<BOOL:${MPI_Fortran_FOUND}>:MPI::MPI_Fortran>
$<$<BOOL:${HDF5_FOUND}>:hdf5::hdf5_fortran>
$<$<BOOL:${USE_FIO}>:${FIO_LIBRARIES}>
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmake -DCMAKE_BUILD_TYPE:String=$BUILD_TYPE \
-DCMAKE_Fortran_FLAGS="-DHDF5_DOUBLE_PRESICION -malign-double -fconvert='big-endian'" \
-DCMAKE_C_FLAGS="-malign-double" \
-DCMAKE_CXX_FLAGS="-malign-double" \
-DCMAKE_Fortran_FLAGS_DEBUG="-ffpe-trap=zero,overflow -fbacktrace -Werror" \
-DCMAKE_Fortran_FLAGS_DEBUG="-g3 -ffpe-trap=zero,overflow -fbacktrace" \
-DCMAKE_C_FLAGS_DEBUG="-g3" \
-DCMAKE_CXX_FLAGS_DEBUG="-g3" ../

Expand Down
4 changes: 2 additions & 2 deletions src/korc_hpc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function get_max_threads()

integer :: get_max_threads
#if defined(_OPENMP)
get_max_threads = OMP_GET_NUM_THREADS()
get_max_threads = OMP_GET_MAX_THREADS()
#else
get_max_threads = 1
#endif
Expand All @@ -382,7 +382,7 @@ function get_thread_number()
integer :: get_thread_number

#if defined(_OPENMP)
get_thread_number = OMP_GET_NUM_PROCS()
get_thread_number = OMP_GET_THREAD_NUM()
#else
get_thread_number = 0
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/korc_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ subroutine read_namelist(params,infile,echo_in,outdir)
!write(6,*) TRIM(magnetic_field_filename),len(TRIM(magnetic_field_filename))

tmp=len(TRIM(magnetic_field_filename))
if (magnetic_field_filename(tmp-2:tmp).ne.'.h5'.and. &
magnetic_field_filename(tmp-5:tmp-5).ne.'.') then
if (magnetic_field_filename(tmp-2:tmp).ne.'.h5') then
if(params%mpi_params%rank.eq.0) then
write(6,*) &
'Check that enough characters are allocated for&
Expand Down

0 comments on commit 6e95bd9

Please sign in to comment.