Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
swiftmpistepsim
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
Container registry
Model registry
Operate
Environments
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
SWIFT
swiftmpistepsim
Commits
1aeb25b8
Commit
1aeb25b8
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add timers for the communications, still no stats
parent
4dd00bfc
No related branches found
No related tags found
1 merge request
!11
Draft: Fast one-sided MPI version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swiftmpirdmastepsim.c
+12
-5
12 additions, 5 deletions
swiftmpirdmastepsim.c
with
12 additions
and
5 deletions
swiftmpirdmastepsim.c
+
12
−
5
View file @
1aeb25b8
...
...
@@ -32,13 +32,10 @@
// buffer is determined by the send and receive rank and the tag, which gives
// us a list of offsets into the buffer mapped by the ranktag, which we need
// to share with any rank that is expected to send us data. We'll send this
// data using normal MPI (could be done either as another extension into the
// window, which we get, but we'd need to synchronize that across all ranks,
// or we could use the global communicator to share this in a similar
// fashion).
// data using normal MPI.
//
// This variation splits the accumulate and the local flush into requestable
// parts, more like SWIFT, and uses three threads.
//
asynchronous
parts, more like SWIFT, and uses three threads.
#include
<limits.h>
#include
<mpi.h>
...
...
@@ -217,7 +214,10 @@ static void *send_thread(void *arg) {
/* Data has the actual data and room for the header. */
BLOCKTYPE
datasize
=
toblocks
(
log
->
size
)
+
HEADER_SIZE
;
BLOCKTYPE
*
dataptr
=
calloc
(
datasize
,
BYTESINBLOCK
);
/* Update the log for the initiation of this message. */
log
->
data
=
dataptr
;
log
->
injtic
=
getticks
();
/* Fill data with pattern. */
if
(
datacheck
)
datacheck_fill
(
datasize
,
dataptr
);
...
...
@@ -321,6 +321,7 @@ static void *req_thread(void *arg) {
/* Done. */
log
->
done
=
1
;
log
->
endtic
=
getticks
();
free
(
log
->
data
);
atomic_dec
(
&
todo_req
);
}
...
...
@@ -355,6 +356,9 @@ static void *recv_thread(void *arg) {
struct
mpiuse_log_entry
*
log
=
recv_queue
[
k
];
if
(
log
!=
NULL
&&
!
log
->
done
)
{
/* On the first attempt we start listening for this receive. */
if
(
log
->
injtic
==
0
)
log
->
injtic
=
getticks
();
/* Get offset into subtype for this message. */
size_t
offset
=
log
->
offset
;
...
...
@@ -376,6 +380,7 @@ static void *recv_thread(void *arg) {
/* Done, clean up. */
log
->
done
=
1
;
log
->
endtic
=
getticks
();
atomic_dec
(
&
todo_recv
);
if
(
todo_recv
==
0
)
break
;
...
...
@@ -452,6 +457,8 @@ static void pick_logs() {
if
(
log
->
activation
)
{
if
(
log
->
rank
==
myrank
)
{
log
->
done
=
0
;
log
->
injtic
=
0
;
log
->
endtic
=
0
;
log
->
data
=
NULL
;
log
->
ranktag
=
toranktag
(
log
->
otherrank
,
log
->
rank
,
log
->
tag
);
if
(
log
->
type
==
task_type_send
)
{
...
...
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