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
ad9440d5
Commit
ad9440d5
authored
May 10, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some code style issues.
parent
b53d8bf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
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
No files found.
modsim/ass4_sander/part1/main.c
View file @
ad9440d5
...
@@ -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 @
ad9440d5
...
@@ -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
);
...
...
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