-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththread_testing.F90
More file actions
41 lines (33 loc) · 1.33 KB
/
Copy paththread_testing.F90
File metadata and controls
41 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
program main
USE mpi
implicit none
integer :: ierror
integer :: provided
integer, parameter :: required_level = MPI_THREAD_SERIALIZED
!integer, parameter :: required_level = MPI_THREAD_MULTIPLE
character(len=:), allocatable :: required_level_string
select case (required_level)
case (MPI_THREAD_SINGLE)
required_level_string = 'MPI_THREAD_SINGLE'
case (MPI_THREAD_FUNNELED)
required_level_string = 'MPI_THREAD_FUNNELED'
case (MPI_THREAD_SERIALIZED)
required_level_string = 'MPI_THREAD_SERIALIZED'
case (MPI_THREAD_MULTIPLE)
required_level_string = 'MPI_THREAD_MULTIPLE'
case default
required_level_string = 'Unknown'
end select
! Initilialise MPI and ask for thread support
write (*,*) 'Initialising MPI with required threading support level: ', trim(required_level_string)
call MPI_Init_thread(required_level, provided, ierror)
write (*,*) 'MPI_Init_thread returned with provided threading support level: ', provided
if (provided < required_level) then
write(*,'(A)') 'The threading support level is lesser than that demanded.'
call MPI_Abort(MPI_COMM_WORLD, -1, ierror)
else
write(*,'(A)') 'The threading support level is greater than or equal to that demanded.'
end IF
! Tell MPI to shut down.
call MPI_Finalize(ierror)
end program main