-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfort.F90
68 lines (54 loc) · 2.08 KB
/
fort.F90
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
subroutine mpi_init_thread(required, provided, ierror)
implicit none
integer, intent(in) :: required
integer, intent(out) :: provided, ierror
provided = required
call mpi_init(ierror)
return
end subroutine mpi_init_thread
subroutine mpi_init(ierror)
implicit none
include "mpif.h"
integer fint(2)
logical flog(2)
real freal(2)
double precision fdub(2)
complex fcomp(2)
integer status(MPI_STATUS_SIZE)
integer ierror
!!
!! Pass values from mpif.h to the C side
!! to check for consistency mpi.h and hardware sizes.
!!
call mpi_init_fort( MPI_COMM_WORLD, &
MPI_ANY_SOURCE, MPI_ANY_TAG, &
MPI_PROC_NULL, MPI_ROOT, &
MPI_COMM_NULL, MPI_REQUEST_NULL, &
MPI_GROUP_NULL, MPI_GROUP_EMPTY, &
MPI_UNDEFINED, &
MPI_MAX_ERROR_STRING, &
MPI_MAX_PROCESSOR_NAME, &
MPI_STATUS_SIZE, &
MPI_SOURCE, MPI_TAG, MPI_ERROR, &
status, status(MPI_SOURCE), &
status(MPI_TAG), status(MPI_ERROR), &
MPI_INTEGER, fint(1), fint(2), &
MPI_LOGICAL, flog(1), flog(2), &
MPI_REAL, freal(1), freal(2), &
MPI_DOUBLE_PRECISION, fdub(1), fdub(2), &
MPI_COMPLEX, fcomp(1), fcomp(2), &
IERROR )
return
end
!
! mpi_get_fort_pointers
!
! In Fortran, various values e.g. MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE,
! and MPI_IN_PLACE are in a COMMON block and not accessible by C code.
! This routine calls back a C routine to store the addresses.
!
subroutine mpi_get_fort_pointers
implicit none
include "mpif.h"
call mpi_save_fort_pointers(MPI_STATUS_IGNORE,MPI_STATUSES_IGNORE,MPI_IN_PLACE)
end subroutine mpi_get_fort_pointers