Skip to content

Commit

Permalink
Added option for mpi.h
Browse files Browse the repository at this point in the history
  • Loading branch information
william-dawson committed Aug 30, 2018
1 parent 396ef91 commit 613dbe1
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 27 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ else()
endif()

################################################################################
# Other optional parameters.
option(USE_MPIH OFF)
if(USE_MPIH)
add_definitions(-DUSE_MPIH)
endif()

################################################################################
# Handle the Debug/Release choices.
set(CMAKE_Fortran_FLAGS_DEBUG ${F_TOOLCHAINFLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_DEBUG ${CXX_TOOLCHAINFLAGS_DEBUG})
set(CMAKE_Fortran_FLAGS_RELEASE ${F_TOOLCHAINFLAGS_RELEASE})
Expand Down
1 change: 1 addition & 0 deletions Source/Fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(Fsrc
MatrixMarketModule.f90
MatrixMemoryPoolModule.f90
MinimizerSolversModule.f90
NTMPIModule.f90
ParameterConverterModule.f90
PermutationModule.f90
PolynomialSolversModule.f90
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/ChebyshevSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MODULE ChebyshevSolversModule
& EnterSubLog, ExitSubLog
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/DataTypesModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MODULE DataTypesModule
USE ErrorModule, ONLY : CheckMPIError, Error_t
USE ISO_C_BINDING
USE ISO_FORTRAN_ENV
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/DensityMatrixSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MODULE DensityMatrixSolversModule
& WriteHeader, WriteListElement, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/DistributedSparseMatrixAlgebraModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MODULE DistributedSparseMatrixAlgebraModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE TripletListModule, ONLY : TripletList_t, DestructTripletList
USE ISO_C_BINDING
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/DistributedSparseMatrixModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MODULE DistributedSparseMatrixModule
& SymmetrizeTripletList, GetTripletAt, RedistributeTripletLists, &
& ShiftTripletList
USE iso_c_binding
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/EigenBoundsModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODULE EigenBoundsModule
USE TripletListModule, ONLY : TripletList_t, AppendToTripletList, &
& ConstructTripletList, DestructTripletList
USE TripletModule, ONLY : Triplet_t
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
6 changes: 3 additions & 3 deletions Source/Fortran/ErrorModule.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> A (under development) module to do handle error passing.
MODULE ErrorModule
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -173,8 +173,8 @@ RECURSIVE SUBROUTINE PrintError(this)
WRITE(*,*) this%alloc_error
ELSE IF (this%mpi_error_set) THEN
WRITE(*,*) "Of type: mpi error."
CALL MPI_Error_String(this%mpi_error,error_string,error_string_len, &
& error_string_error)
CALL MPI_Error_String(this%mpi_error, error_string, &
& error_string_len, error_string_error)
WRITE(*,*) error_string
ELSE
WRITE(*,*) "Of type: generic error."
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/ExponentialSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MODULE ExponentialSolversModule
USE RootSolversModule, ONLY : ComputeRoot
USE SquareRootSolversModule, ONLY : SquareRoot
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/GeometryOptimizationModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MODULE GeometryOptimizationModule
USE ProcessGridModule
USE SquareRootSolversModule, ONLY : InverseSquareRoot, SquareRoot
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/HermiteSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODULE HermiteSolversModule
& WriteListElement, WriteHeader
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/InverseSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODULE InverseSolversModule
& WriteElement, WriteListElement, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE mpi
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/MatrixGatherModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MODULE MatrixGatherModule
USE SparseMatrixAlgebraModule, ONLY : IncrementSparseMatrix
USE SparseMatrixModule, ONLY : SparseMatrix_t, ConstructEmptySparseMatrix, &
& DestructSparseMatrix
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/MinimizerSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODULE MinimizerSolversModule
& WriteListElement, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
12 changes: 12 additions & 0 deletions Source/Fortran/NTMPIModule.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> This module wraps the MPI include statement because on certain platforms
!! just writing "USE MPI" does not work.
MODULE NTMPIModule
#if USE_MPIF08
USE MPI_F08
#elif USE_MPIH
include "mpif.h"
#else
USE MPI
#endif
END MODULE
2 changes: 1 addition & 1 deletion Source/Fortran/PolynomialSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MODULE PolynomialSolversModule
& WriteHeader, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/ProcessGridModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MODULE ProcessGridModule
USE DataTypesModule, ONLY : MPITypeInfoInit
USE LoggingModule, ONLY : ActivateLogger, EnterSubLog, ExitSubLog, &
& WriteHeader, WriteListElement
USE MPI
USE NTMPIModule
USE ISO_C_BINDING, ONLY : c_int, c_bool
#ifdef _OPENMP
USE omp_lib, ONLY : omp_get_num_threads
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/RootSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MODULE RootSolversModule
& SetCoefficient
USE SquareRootSolversModule, ONLY : SquareRoot, InverseSquareRoot
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/SignSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MODULE SignSolversModule
& WriteListElement, WriteHeader, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/SparseMatrixModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MODULE SparseMatrixModule
& ConstructTripletList, DestructTripletList, SetTripletAt, &
& AppendToTripletList, SymmetrizeTripletList
USE TripletModule, ONLY : Triplet_t
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
4 changes: 1 addition & 3 deletions Source/Fortran/SquareRootSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MODULE SquareRootSolversModule
& WriteHeader, WriteListElement, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand All @@ -40,7 +40,6 @@ SUBROUTINE SquareRoot(InputMat, OutputMat, solver_parameters_in, order_in)
INTEGER, INTENT(IN), OPTIONAL :: order_in
!! Local Variables
TYPE(IterativeSolverParameters_t) :: solver_parameters
INTEGER :: order

IF (PRESENT(solver_parameters_in)) THEN
solver_parameters = solver_parameters_in
Expand Down Expand Up @@ -71,7 +70,6 @@ SUBROUTINE InverseSquareRoot(InputMat, OutputMat, solver_parameters_in, &
INTEGER, INTENT(IN), OPTIONAL :: order_in
!! Local Variables
TYPE(IterativeSolverParameters_t) :: solver_parameters
INTEGER :: order

IF (PRESENT(solver_parameters_in)) THEN
solver_parameters = solver_parameters_in
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/TimerModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MODULE TimerModule
USE LoggingModule, ONLY : EnterSubLog, ExitSubLog, WriteElement, &
& WriteHeader
USE ProcessGridModule
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
LOGICAL :: is_initialized = .FALSE.
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/TrigonometrySolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MODULE TrigonometrySolversModule
WriteHeader, WriteListElement, WriteCitation
USE ProcessGridModule
USE TimerModule, ONLY : StartTimer, StopTimer
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/TripletListModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MODULE TripletListModule
USE MatrixMarketModule, ONLY : MM_SYMMETRIC, MM_SKEW_SYMMETRIC
USE TripletModule, ONLY : Triplet_t, CompareTriplets
USE ISO_C_BINDING, ONLY : c_int
USE MPI
USE NTMPIModule
IMPLICIT NONE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> A data type for a list of triplets.
Expand Down
2 changes: 1 addition & 1 deletion Source/Fortran/TripletModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MODULE TripletModule
USE DataTypesModule, ONLY: NTREAL, MPINTREAL
USE ISO_C_BINDING, ONLY : c_int
USE MPI
USE NTMPIModule
IMPLICIT NONE
PRIVATE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down

0 comments on commit 613dbe1

Please sign in to comment.