Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ALP4-Tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
mactavish96
ALP4-Tutorials
Commits
9eb19503
Commit
9eb19503
authored
2 years ago
by
Chao Zhan
Browse files
Options
Downloads
Patches
Plain Diff
add deadlock solution
parent
6edb7fa1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/pages/recap.md
+32
-1
32 additions, 1 deletion
slides/pages/recap.md
with
32 additions
and
1 deletion
slides/pages/recap.md
+
32
−
1
View file @
9eb19503
...
@@ -301,7 +301,7 @@ The receive buffer must be able to fit the entire message:
...
@@ -301,7 +301,7 @@ The receive buffer must be able to fit the entire message:
The MPI status object holds information about the received message.
The MPI status object holds information about the received message.
**MPI_Status status**
:
**MPI_Status status**
object is a structure in C with freely accessible members
:
```
c
```
c
status
.
MPI_SOURCE
// message source rank
status
.
MPI_SOURCE
// message source rank
...
@@ -440,3 +440,34 @@ This tells us: <span class="text-rose-500 font-bold">Never rely on any implement
...
@@ -440,3 +440,34 @@ This tells us: <span class="text-rose-500 font-bold">Never rely on any implement
</v-click>
</v-click>
---
title: Deadlock III
---
### Another Solution to Deadlock
**Using Combined Send and Receive**
:
```
c
MPI_Sendrecv
(
void
*
senddata
,
int
sendcount
,
MPI_Datatype
sendtype
,
int
dest
,
int
sendtag
,
void
*
recvdata
,
int
recvcount
,
MPI_Datatype
recvtype
,
int
source
,
int
recvtag
,
MPI_Comm
comm
,
MPI_Status
*
status
)
```
Sends one message and receives one message (in any order)
**without deadlocking(unless unmatched)**
<span
class=
"text-rose-500 font-bold"
>
Send and receive buffers must not overlap!
</span>
Don't want two buffers? -> Use
**MPI_Sendrecv_replace**
!
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