Loading [MathJax]/extensions/tex2jax.js
ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
Toggle main menu visibility
Main Page
Related Pages
Modules
Modules List
Module Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions/Subroutines
d
f
g
i
r
s
t
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Data Types List
Data Types List
Data Types
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Functions/Subroutines
a
b
c
d
e
f
g
r
s
t
w
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Files
File List
File Members
All
Functions/Subroutines
GitHub
C
latest
2
C++
latest
2
Fortran
latest
2
Generic
latest
2
1
MATLAB
latest
3
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
xgetImageStatMPI.F90
Go to the documentation of this file.
1
48
program
xgetImageStatMPI
49
use
mpi
!mpi_f08, only : mpi_initialized, mpi_comm_world, mpi_comm_size, mpi_init
50
implicit none
51
logical
:: isinit
52
logical
:: isfinit
53
integer
:: ierrMPI
54
integer
:: imageRank
=
-
1
55
integer
:: imageCount
=
0
56
imageCountMPI_block:
block
57
call
mpi_finalized
(isfinit, ierrMPI)
58
if
(isfinit)
error stop
"@xgetImageStatMPI(): Error occurred. A finalized MPI library cannot be reinitialized."
59
call
mpi_initialized
(isinit, ierrMPI)
60
if
(ierrMPI
/
=
0
)
exit
imageCountMPI_block
61
if
(
.not.
isinit)
then
62
call
mpi_init
(ierrMPI)
63
if
(ierrMPI
/
=
0
)
exit
imageCountMPI_block
64
end if
65
call
mpi_comm_size
(
mpi_comm_world
, imageCount, ierrMPI)
66
if
(ierrMPI
/
=
0
) imageCount
=
0
67
call
mpi_comm_rank
(
mpi_comm_world
, imageRank, ierrMPI)
68
if
(ierrMPI
/
=
0
) imageRank
=
-
1
69
imageRank
=
imageRank
+
1
70
end block
imageCountMPI_block
71
! All images report their rank and the MPI image count.
72
! The current bash process is responsible for capturing it.
73
write
(
*
,
"(*(g0))"
)
"imageCountRank"
, imageCount,
"imageCountRank"
, imageRank,
"imageCountRank"
74
!call mpi_finalize(ierrMPI)
75
end program
xgetImageStatMPI
xgetImageStatMPI
program xgetImageStatMPI
This program contains instructions to determine the number of MPI-parallel processes and MPI image ra...
Definition:
xgetImageStatMPI.F90:48
src
fortran
main
xgetImageStatMPI.F90
Generated on Tue Dec 24 2024 15:17:34 for ParaMonte Fortran 2.0.0 by
1.9.3