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
b4e3cde3
Commit
b4e3cde3
authored
Apr 26, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed all INT constants to DOUBLE.
parent
0cf49f2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
modsim/ass4_sander/part1/master.c
modsim/ass4_sander/part1/master.c
+3
-3
modsim/ass4_sander/part1/slave.c
modsim/ass4_sander/part1/slave.c
+1
-1
No files found.
modsim/ass4_sander/part1/master.c
View file @
b4e3cde3
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
// Send it to each rank
// Send it to each rank
MPI_Send
(
work
,
// message buffer
MPI_Send
(
work
,
// message buffer
items_per_task
,
// size of data array
items_per_task
,
// size of data array
MPI_
INT
,
// data item is an integer
MPI_
DOUBLE
,
// data item is an integer
rank
,
// destination process rank
rank
,
// destination process rank
WORK_TAG
,
// user chosen message tag
WORK_TAG
,
// user chosen message tag
MPI_COMM_WORLD
);
// default communicator
MPI_COMM_WORLD
);
// default communicator
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
// Send the slave a new work unit
// Send the slave a new work unit
MPI_Send
(
work
,
// message buffer
MPI_Send
(
work
,
// message buffer
items_per_task
,
// size of data array
items_per_task
,
// size of data array
MPI_
INT
,
// data item is an integer
MPI_
DOUBLE
,
// data item is an integer
status
.
MPI_SOURCE
,
// to who we just received from
status
.
MPI_SOURCE
,
// to who we just received from
WORK_TAG
,
// user chosen message tag
WORK_TAG
,
// user chosen message tag
MPI_COMM_WORLD
);
// default communicator
MPI_COMM_WORLD
);
// default communicator
...
@@ -60,6 +60,6 @@
...
@@ -60,6 +60,6 @@
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_
INT
,
rank
,
DIE_TAG
,
MPI_COMM_WORLD
);
MPI_Send
(
0
,
0
,
MPI_
DOUBLE
,
rank
,
DIE_TAG
,
MPI_COMM_WORLD
);
}
}
}
}
modsim/ass4_sander/part1/slave.c
View file @
b4e3cde3
...
@@ -8,7 +8,7 @@ void slave(int items_per_task) {
...
@@ -8,7 +8,7 @@ void slave(int items_per_task) {
MPI_Status
status
;
MPI_Status
status
;
/* Receive a message from the master */
/* Receive a message from the master */
MPI_Recv
(
&
work
,
items_per_task
,
MPI_
INT
,
0
,
MPI_ANY_TAG
,
MPI_Recv
(
&
work
,
items_per_task
,
MPI_
DOUBLE
,
0
,
MPI_ANY_TAG
,
MPI_COMM_WORLD
,
&
status
);
MPI_COMM_WORLD
,
&
status
);
/* Check the tag of the received message. */
/* Check the tag of the received message. */
...
...
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