Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pp-heatmap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Björn Fischer
pp-heatmap
Commits
a75d9e78
Commit
a75d9e78
authored
Jan 04, 2016
by
Björn Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parallize outer loop
parent
2799f3eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
jacobi.c
jacobi.c
+6
-9
makefile
makefile
+2
-2
No files found.
jacobi.c
View file @
a75d9e78
...
@@ -67,16 +67,15 @@ int Jacobi_Iterate(int neighbor_dim0_left, int neighbor_dim0_right, int neighbor
...
@@ -67,16 +67,15 @@ int Jacobi_Iterate(int neighbor_dim0_left, int neighbor_dim0_right, int neighbor
double
delta_a
;
double
delta_a
;
double
**
swap
;
double
**
swap
;
double
maxdiff
=
0
;
double
maxdiff
=
0
;
double
inner_maxdiff
;
int
i
,
j
;
#pragma omp parallel for private(delta_a, j, i) reduction(max: maxdiff) schedule(dynamic, 1) default(shared)
for
(
for
(
i
nt
i
=
(
neighbor_dim0_left
==
MPI_PROC_NULL
)
?
2
:
1
;
// catch edges
i
=
(
neighbor_dim0_left
==
MPI_PROC_NULL
)
?
2
:
1
;
// catch edges
i
<
pi
.
end_m
-
pi
.
start_m
+
((
neighbor_dim0_right
==
MPI_PROC_NULL
)
?
1
:
2
);
i
<
pi
.
end_m
-
pi
.
start_m
+
((
neighbor_dim0_right
==
MPI_PROC_NULL
)
?
1
:
2
);
i
++
i
++
)
{
)
{
inner_maxdiff
=
0
;
#pragma omp parallel for private(delta_a) reduction(max: inner_maxdiff) schedule(dynamic, 512) default(shared) num_threads(48)
for
(
for
(
int
j
=
(
neighbor_dim1_left
==
MPI_PROC_NULL
)
?
2
:
1
;
// catch edges
j
=
(
neighbor_dim1_left
==
MPI_PROC_NULL
)
?
2
:
1
;
// catch edges
j
<
pi
.
end_n
-
pi
.
start_n
+
((
neighbor_dim1_right
==
MPI_PROC_NULL
)
?
1
:
2
);
j
<
pi
.
end_n
-
pi
.
start_n
+
((
neighbor_dim1_right
==
MPI_PROC_NULL
)
?
1
:
2
);
j
++
j
++
)
{
)
{
...
@@ -87,11 +86,9 @@ int Jacobi_Iterate(int neighbor_dim0_left, int neighbor_dim0_right, int neighbor
...
@@ -87,11 +86,9 @@ int Jacobi_Iterate(int neighbor_dim0_left, int neighbor_dim0_right, int neighbor
delta_a
=
delta_a
*
delta_t
;
delta_a
=
delta_a
*
delta_t
;
(
*
partial_field_clipboard
)[
i
][
j
]
=
(
*
partial_field
)[
i
][
j
]
+
delta_a
;
(
*
partial_field_clipboard
)[
i
][
j
]
=
(
*
partial_field
)[
i
][
j
]
+
delta_a
;
if
(
delta_a
>
inner_
maxdiff
)
if
(
delta_a
>
maxdiff
)
inner_
maxdiff
=
delta_a
;
maxdiff
=
delta_a
;
}
}
if
(
inner_maxdiff
>
maxdiff
)
maxdiff
=
inner_maxdiff
;
}
}
swap
=
*
partial_field_clipboard
;
swap
=
*
partial_field_clipboard
;
*
partial_field_clipboard
=
*
partial_field
;
*
partial_field_clipboard
=
*
partial_field
;
...
...
makefile
View file @
a75d9e78
all
:
main
all
:
main
main
:
matrix.c main.c args.c pid0.c pi.c cart.c mpi_util.c
main
:
matrix.c main.c args.c pid0.c pi.c cart.c mpi_util.c
mpicc matrix.c main.c args.c pid0.c pi.c cart.c mpi_util.c jacobi.c
-std
=
c99
-lm
-o
main
mpicc matrix.c main.c args.c pid0.c pi.c cart.c mpi_util.c jacobi.c
-
fopenmp
-
std
=
c99
-lm
-o
main
ViewMatrix.class
:
ViewMatrix.java
ViewMatrix.class
:
ViewMatrix.java
javac ViewMatrix.java
javac ViewMatrix.java
...
@@ -9,4 +9,4 @@ ViewMatrix.class: ViewMatrix.java
...
@@ -9,4 +9,4 @@ ViewMatrix.class: ViewMatrix.java
clean
:
clean
:
rm
-f
*
.o
*
.c~ heat Matrix.txt
rm
-f
*
.o
*
.c~ heat Matrix.txt
rm
-f
ViewMatrix.class
rm
-f
ViewMatrix.class
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment