Skip to content

Commit

Permalink
Fix some warnings detected by -Wextra (#214)
Browse files Browse the repository at this point in the history
* Fix some warnings detected by -Wextra

* lint

* Bug fix
  • Loading branch information
william-dawson authored Jul 20, 2023
1 parent 4ad7c50 commit 0bcea2f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Source/Fortran/PSMatrixModule.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,9 @@ FUNCTION IsIdentity_psc(this) RESULT(is_identity)
TYPE(TripletList_c) :: tlist
TYPE(Triplet_c) :: trip

#define ISCOMPLEX
#include "distributed_includes/IsIdentity.f90"
#undef ISCOMPLEX
END FUNCTION IsIdentity_psc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END MODULE PSMatrixModule
2 changes: 0 additions & 2 deletions Source/Fortran/RootSolversModule.F90
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ SUBROUTINE ComputeInverseRootImplemention(InputMat, OutputMat, root, params)
INTEGER, INTENT(IN) :: root
!> Parameters for the solver.
TYPE(SolverParameters_t), INTENT(IN) :: params
!! Constants.
REAL(NTREAL), PARAMETER :: NEGATIVE_ONE = -1.0
!! Local Matrices
TYPE(Matrix_ps) :: SqrtMat, FthrtMat
TYPE(Matrix_ps) :: IdentityMat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
!$OMP END PARALLEL

!! Copy to output matrix.
IF (beta .EQ. 0.0) THEN
IF (ABS(beta) .LT. TINY(beta)) THEN
CALL CopyMatrix(matAB, matC)
ELSE
CALL ScaleMatrix(MatC, beta)
Expand Down
8 changes: 7 additions & 1 deletion Source/Fortran/distributed_includes/IsIdentity.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
IF (trip%index_row .NE. trip%index_column) THEN
is_identity = .FALSE.
EXIT
ELSE IF (trip%point_value .NE. 1.0_NTREAL) THEN
#ifdef ISCOMPLEX
ELSE IF (ABS(trip%point_value - 1.0_NTCOMPLEX) &
& .GT. TINY(1.0_NTREAL)) THEN
#else
ELSE IF (ABS(trip%point_value - 1.0_NTREAL) &
& .GT. TINY(1.0_NTREAL)) THEN
#endif
is_identity = .FALSE.
ELSE
diag_count = diag_count + 1
Expand Down
1 change: 0 additions & 1 deletion Source/Wrapper/EigenSolversModule_wrp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ SUBROUTINE EstimateGap_wrp(ih_H, ih_K, chemical_potential, gap, &
REAL(NTREAL), INTENT(INOUT) :: gap
INTEGER(KIND=C_INT), INTENT(IN) :: ih_solver_parameters(SIZE_wrp)
TYPE(Matrix_ps_wrp) :: h_H
TYPE(Matrix_ps_wrp) :: h_ISQ
TYPE(Matrix_ps_wrp) :: h_K
TYPE(SolverParameters_wrp) :: h_solver_parameters

Expand Down
4 changes: 2 additions & 2 deletions Targets/Mac-conda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(Python_FIND_STRATEGY LOCATION)

# Library Files
set(TOOLCHAIN_LIBS "-framework Accelerate -lgomp \
-L/usr/local/Cellar/scalapack/2.2.0/lib/ -lscalapack")
-L/usr/local/Cellar/scalapack/2.2.0_1/lib/ -lscalapack")

# Release Suggestions
set(CXX_TOOLCHAINFLAGS_RELEASE "-O3 -openmp")
Expand All @@ -19,4 +19,4 @@ set(F_TOOLCHAINFLAGS_RELEASE "-O3 -cpp -fopenmp -Wall")
# Debug suggestions
set(CXX_TOOLCHAINFLAGS_DEBUG "-O0")
set(F_TOOLCHAINFLAGS_DEBUG
"-fcheck=all -O0 -fexternal-blas -g -cpp -Wall -DPURE=")
"-fcheck=all -O0 -fexternal-blas -g -cpp -Wall -DPURE= -Wextra")

0 comments on commit 0bcea2f

Please sign in to comment.