Loading [MathJax]/extensions/tex2jax.js
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
All
Functions
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
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
a
c
d
e
f
g
i
l
m
o
p
r
s
t
u
w
~
+
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
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
+
Macros
_
a
c
d
g
i
m
n
r
s
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
MPIRanknD.c
Go to the documentation of this file.
1
5
#include <
mpivars.h
>
6
27
int
MPIRanknD
(
28
int
ndims,
29
int
rank,
30
int
*iproc,
31
int
*ip
32
)
33
{
34
int
i,term = 1;
35
for
(i=0; i<ndims; i++) term *= iproc[i];
36
for
(i=ndims-1; i>=0; i--) {
37
term /= iproc[i];
38
ip[i] = rank/term;
39
rank -= ip[i]*term;
40
}
41
return
(0);
42
}
mpivars.h
MPI related function definitions.
MPIRanknD
int MPIRanknD(int ndims, int rank, int *iproc, int *ip)
Definition:
MPIRanknD.c:27