Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
c741fc1d
Commit
c741fc1d
authored
May 12, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://vo20.nl/home/git/repos/uva
parents
0a09169c
3bc5644d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
154 additions
and
15 deletions
+154
-15
modsim/ass4_sander/part1/main.c
modsim/ass4_sander/part1/main.c
+1
-2
modsim/ass4_sander/part1/master.c
modsim/ass4_sander/part1/master.c
+4
-4
modsim/ass4_sander/part1/start.sh
modsim/ass4_sander/part1/start.sh
+1
-1
modsim/ass4_sander/part2/.gitignore
modsim/ass4_sander/part2/.gitignore
+1
-0
modsim/ass4_sander/part2/Makefile
modsim/ass4_sander/part2/Makefile
+14
-0
modsim/ass4_sander/part2/main.c
modsim/ass4_sander/part2/main.c
+89
-0
modsim/ass4_sander/part2/plot.py
modsim/ass4_sander/part2/plot.py
+2
-0
portfolio/tracing/presentation.tex
portfolio/tracing/presentation.tex
+42
-8
No files found.
modsim/ass4_sander/part1/main.c
View file @
c741fc1d
...
@@ -11,8 +11,7 @@ int test_stride = 1; // Items per task
...
@@ -11,8 +11,7 @@ int test_stride = 1; // Items per task
int
test_current_item
=
0
;
// Position in item list
int
test_current_item
=
0
;
// Position in item list
double
test_list
[
LIST_SIZE
];
// List containing all test items
double
test_list
[
LIST_SIZE
];
// List containing all test items
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
int
role
;
int
role
;
// Create list of zero values.
// Create list of zero values.
...
...
modsim/ass4_sander/part1/master.c
View file @
c741fc1d
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#include "main.h"
#include "main.h"
#include "master.h"
#include "master.h"
int
master_init
(
void
)
{
int
master_init
(
void
)
{
// Find out how many processes there are in the default communicator
// Find out how many processes there are in the default communicator
int
ntasks
;
int
ntasks
;
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
ntasks
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
ntasks
);
return
ntasks
;
return
ntasks
;
}
}
void
master_run
(
int
ntasks
,
int
items_per_task
)
{
void
master_run
(
int
ntasks
,
int
items_per_task
)
{
int
rank
;
int
rank
;
unit_work_t
*
work
;
unit_work_t
*
work
;
unit_result_t
result
;
unit_result_t
result
;
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
}
}
}
}
void
master_destroy
(
int
ntasks
)
{
void
master_destroy
(
int
ntasks
)
{
// Tell all slaves to exit by sending an empty message with the DIE_TAG.
// Tell all slaves to exit by sending an empty message with the DIE_TAG.
for
(
int
rank
=
1
;
rank
<
ntasks
;
++
rank
)
{
for
(
int
rank
=
1
;
rank
<
ntasks
;
++
rank
)
{
MPI_Send
(
0
,
0
,
MPI_DOUBLE
,
rank
,
DIE_TAG
,
MPI_COMM_WORLD
);
MPI_Send
(
0
,
0
,
MPI_DOUBLE
,
rank
,
DIE_TAG
,
MPI_COMM_WORLD
);
...
...
modsim/ass4_sander/part1/start.sh
View file @
c741fc1d
#!/bin/sh
#!/bin/sh
NUM_PROCESSES
=
4
NUM_PROCESSES
=
4
HOSTS
=
localhost
HOSTS
=
ow130,ow131
PROGRAM_EXEC
=
main
PROGRAM_EXEC
=
main
mpirun
-np
$NUM_PROCESSES
-H
$HOSTS
$PROGRAM_EXEC
mpirun
-np
$NUM_PROCESSES
-H
$HOSTS
$PROGRAM_EXEC
modsim/ass4_sander/part2/.gitignore
0 → 100644
View file @
c741fc1d
main
modsim/ass4_sander/part2/Makefile
0 → 100644
View file @
c741fc1d
CFLAGS
+=
-std
=
c99
-Wall
-Wextra
-g
-O2
-pthread
LDFLAGS
+=
-pthread
-lmpi
-lopen-rte
-lopen-pal
-ldl
-Wl
,--export-dynamic
\
-lnsl
-lutil
-lm
-ldl
MAIN
=
main
OFILES
=
$
(
$(
wildcard
*
.c
)
:.c
=
.o
)
$(MAIN)
:
$(OFILES)
clean
:
rm
-vf
$(MAIN)
$(OFILES)
check-syntax
:
$(CXX)
$(CXXFLAGS)
-fsyntax-only
${CHK_SOURCES}
modsim/ass4_sander/part2/main.c
0 → 100644
View file @
c741fc1d
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#define GRID_LENGTH 64
double
Y
[
GRID_LENGTH
][
3
];
int
t_next
,
t_prev
,
t_cur
;
void
init_sinus
(
char
**
argv
)
{
double
amp
;
int
h_phases
;
sscanf
(
argv
[
2
],
"%lf"
,
&
amp
);
sscanf
(
argv
[
3
],
"%i"
,
&
h_phases
);
for
(
int
i
=
0
;
i
<
GRID_LENGTH
;
i
++
)
{
Y
[
i
][
t
]
=
amp
*
sin
(
M_PI
*
(
i
(
double
)
/
(
double
)
GRID_LENGTH
)
*
h_phases
);
}
}
void
init_pluck
(
char
**
argv
)
{
double
amp
,
position
;
int
ipos
,
i
;
sscanf
(
argv
[
2
],
"%lf"
,
&
amp
);
sscanf
(
argv
[
3
],
"%i"
,
&
position
);
ipos
=
position
/
dx
*
GRID_LENGTH
;
for
(
i
=
0
;
i
<
ipos
;
i
++
)
{
Y
[
i
][
t
]
=
i
*
dx
/
position
*
amp
;
}
for
(;
i
<
GRID_LENGTH
;
i
++
)
{
Y
[
i
][
t
]
=
((
GRID_LENGTH
-
i
)
*
dx
)
/
(
GRID_LENGTH
-
ipos
)
*
amp
;
}
}
void
iterate
(
double
C
,
int
t_prev
,
int
t_cur
,
int
t_next
)
{
for
(
int
i
=
1
;
i
<
GRID_LENGTH
;
i
++
)
{
Y
[
i
][
t_next
]
=
C
*
(
Y
[
i
-
1
][
t_cur
]
-
2
*
Y
[
i
][
t_cur
]
+
Y
[
i
+
1
][
t_cur
])
-
Y
[
i
][
t_prev
]
+
2
*
Y
[
i
][
t_cur
];
}
}
#define SWAP(a, b) \
a ^= b; \
b ^= a; \
a ^= b;
void
plot
(
int
col
)
{
printf
(
"%f"
,
Y
[
0
][
col
]);
for
(
int
i
=
1
;
i
<
GRID_LENGTH
;
i
++
)
printf
(
",%f"
,
Y
[
i
][
col
]);
printf
(
"
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
4
)
{
fprintf
(
stderr
,
"Usage: %s <p amplitude position |s amplitude phases"
,
argv
[
0
]);
return
1
;
}
switch
(
*
argv
[
1
])
{
case
'p'
:
init_pluck
(
argv
);
break
;
case
's'
:
init_sinus
(
argv
);
break
;
default:
fprintf
(
stderr
,
"Does this look like a 'p' or 's' to you?
\n
"
);
return
1
;
}
double
c
=
.
04
,
dt
=
.
1
,
dx
=
.
02
,
C
=
c
*
c
*
(
dt
/
dx
)
*
(
dt
/
dx
);
// TODO: implement iterations
int
t_prev
=
0
,
t_cur
=
1
,
t_next
=
2
,
T
=
10
;
for
(
int
i
=
0
;
i
<
T
;
i
++
)
{
iterate
(
C
,
t_prev
,
t_cur
,
t_next
);
SWAP
(
t_cur
,
t_next
);
SWAP
(
t_prev
,
t_next
);
plot
(
t_cur
);
}
return
0
;
}
modsim/ass4_sander/part2/plot.py
0 → 100644
View file @
c741fc1d
from
pyplot
import
show
,
fig
portfolio/tracing/presentation.tex
View file @
c741fc1d
...
@@ -230,6 +230,10 @@
...
@@ -230,6 +230,10 @@
\frame
{
\frametitle
{
Eerdere trace uitbreiden met nieuw pad
}
\frame
{
\frametitle
{
Eerdere trace uitbreiden met nieuw pad
}
\begin{columns}
[t]
\column
{
.6
\textwidth
}
\begin{itemize}
\begin{itemize}
\item
Afwijking trace
$
\rightarrow
$
start interpreter.
\item
Afwijking trace
$
\rightarrow
$
start interpreter.
\item
Indien pad in loop, compile nieuw pad.
\item
Indien pad in loop, compile nieuw pad.
...
@@ -237,6 +241,10 @@
...
@@ -237,6 +241,10 @@
\includegraphics
[width=6cm]
{
images/trace-expansion.pdf
}
\includegraphics
[width=6cm]
{
images/trace-expansion.pdf
}
\end{itemize}
\end{itemize}
\column
{
.4
\textwidth
}
\end{columns}
}
}
\frame
{
\frametitle
{
Eerdere trace uitbreiden met nieuw pad
}
\frame
{
\frametitle
{
Eerdere trace uitbreiden met nieuw pad
}
...
@@ -280,14 +288,19 @@
...
@@ -280,14 +288,19 @@
\subsection
{
Toekomst van trace trees
}
\subsection
{
Toekomst van trace trees
}
\frame
{
\frametitle
{
Toekomst: Static single assignment en traces
}
\frame
[containsverbatim]
{
\frametitle
{
Toekomst: Static single assignment en traces
}
\emph
{
Hier komt
voorbeeld van SSA.
}
\emph
{
Een
voorbeeld van SSA.
}
\vskip
6em
\begin{verbatim}
y := 1 y
_
1 := 1
y := 2 => y
_
2 := 2
x := y x
_
1 := y
\end{verbatim}
\begin{itemize}
\begin{itemize}
\item
Zorgt voor meer/betere mogelijkheden tot optimalisaties:
\item
Reaching definition analysis.
\item
Enabling optimalisatie:
\begin{itemize}
\begin{itemize}
\item
Constant propagation.
\item
Constant propagation.
\item
Dead code elimination.
\item
Dead code elimination.
...
@@ -300,9 +313,30 @@
...
@@ -300,9 +313,30 @@
\section
{
Conclusie
}
\section
{
Conclusie
}
\frame
{
\frametitle
{
Conclusie en benchmarks
}
\frame
[containsverbatim]
{
\frametitle
{
Conclusie en benchmarks
}
\textbf
{
Benchmarks
}
\begin{verbatim}
$
.
/
js sunspider
/
3
d
-
morph.js
243
$
./js -m sunspider/3d-morph.js
57
$
.
/
js
-
j sunspider
/
3
d
-
morph.js
38
$
./js -jm sunspider/3d-morph.js
37
$
.
/
shell sunspider
/
3
d
-
morph.js # v
8
64
\end
{
verbatim
}
\emph
{
TODO
}
\textbf
{
Conclusie
}
\begin
{
itemize
}
\item
Trace compilation zorgt voor betere runtime performance.
\item
Incremental recompilation zorgt snellere compilation.
\item
Runtime is namelijk afhankelijk van execution
-
en compilation time.
\end
{
itemize
}
}
}
...
...
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