Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MSA Hello World
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Herten
MSA Hello World
Commits
42be16a6
Commit
42be16a6
authored
1 year ago
by
Andreas Herten
Browse files
Options
Downloads
Patches
Plain Diff
Implement TODOs
parent
779b2f1e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
02-MSA-hello-world-gpu/hello-world.c
+5
-0
5 additions, 0 deletions
02-MSA-hello-world-gpu/hello-world.c
02-MSA-hello-world-gpu/hello-world.cu
+5
-0
5 additions, 0 deletions
02-MSA-hello-world-gpu/hello-world.cu
with
10 additions
and
0 deletions
02-MSA-hello-world-gpu/hello-world.c
+
5
−
0
View file @
42be16a6
...
@@ -24,8 +24,13 @@ int main(int argc, char** argv){
...
@@ -24,8 +24,13 @@ int main(int argc, char** argv){
const
char
*
payload
=
"world!"
;
const
char
*
payload
=
"world!"
;
// TODO: Implement the MPI_Send call to send the six characters of "payload" to rank 1
if
(
rank
==
0
)
{
if
(
rank
==
0
)
{
#ifdef SOLUTION
MPI_Send
(
payload
,
6
,
MPI_CHAR
,
1
,
tag
,
MPI_COMM_WORLD
);
MPI_Send
(
payload
,
6
,
MPI_CHAR
,
1
,
tag
,
MPI_COMM_WORLD
);
#else
MPI_Send
();
#endif
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
02-MSA-hello-world-gpu/hello-world.cu
+
5
−
0
View file @
42be16a6
...
@@ -51,8 +51,13 @@ int main(int argc, char** argv){
...
@@ -51,8 +51,13 @@ int main(int argc, char** argv){
CUDA_RT_CALL
(
cudaPeekAtLastError
()
);
CUDA_RT_CALL
(
cudaPeekAtLastError
()
);
CUDA_RT_CALL
(
cudaDeviceSynchronize
()
);
CUDA_RT_CALL
(
cudaDeviceSynchronize
()
);
// TODO: Implement the MPI_Recv() call to receive the "payload" from rank 1 using directly "d_payload" as the target buffer on the GPU
if
(
rank
==
1
)
{
if
(
rank
==
1
)
{
#ifdef SOLUTION
MPI_Recv
(
d_payload
,
6
,
MPI_CHAR
,
0
,
tag
,
MPI_COMM_WORLD
,
&
stat
);
MPI_Recv
(
d_payload
,
6
,
MPI_CHAR
,
0
,
tag
,
MPI_COMM_WORLD
,
&
stat
);
#else
MPI_Recv
();
#endif
}
}
hello
<<<
1
,
1
>>>
(
d_payload
);
hello
<<<
1
,
1
>>>
(
d_payload
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment