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
MPIPartition1D.c
Go to the documentation of this file.
1
6
#include <stdio.h>
7
#include <
mpivars.h
>
8
14
int
MPIPartition1D
(
15
int
nglobal,
16
int
nproc,
17
int
rank
18
)
19
{
20
int
nlocal;
21
if
(nglobal%nproc == 0) nlocal = nglobal/nproc;
22
else
{
23
if
(rank == nproc-1) nlocal = nglobal/nproc + nglobal%nproc;
24
else
nlocal = nglobal/nproc;
25
}
26
return
(nlocal);
27
}
mpivars.h
MPI related function definitions.
MPIPartition1D
int MPIPartition1D(int nglobal, int nproc, int rank)
Definition:
MPIPartition1D.c:14