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
605773bb
Commit
605773bb
authored
4 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Extra ranktags that are used to speed up lookup, very marginal gains
parent
899d7bc3
No related branches found
No related tags found
1 merge request
!8
Draft: RDMA version with wrapped infinity calls
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swiftmpirdmaonestepsim2.c
+32
-7
32 additions, 7 deletions
swiftmpirdmaonestepsim2.c
with
32 additions
and
7 deletions
swiftmpirdmaonestepsim2.c
+
32
−
7
View file @
605773bb
...
...
@@ -275,6 +275,32 @@ static void *send_thread(void *arg) {
* biggest message. */
auto
*
sendBuffer
=
new
infinity
::
memory
::
Buffer
(
context
,
tobytes
(
max_size
));
/* Extract the offset lists that we use. */
int
nr
=
0
;
int
size
=
(
max_logs
/
16
+
1
);
size_t
*
ranktags
=
(
size_t
*
)
malloc
(
size
*
sizeof
(
size_t
));
size_t
*
offsets
=
(
size_t
*
)
malloc
(
size
*
sizeof
(
size_t
));
/* A tag that will match any subtype or tag with our rank for all the otherranks. */
for
(
int
k
=
0
;
k
<
nr_ranks
;
k
++
)
{
size_t
matchranktag
=
toranktag
(
0
,
myrank
,
k
,
0
);
for
(
size_t
j
=
0
;
j
<
max_logs
;
j
++
)
{
size_t
ranktag
=
ranktag_lists
[
INDEX3
(
nr_ranks
,
nr_ranks
,
myrank
,
k
,
j
)];
if
((
ranktag
&
matchranktag
)
==
matchranktag
)
{
/* Keep this one. */
ranktags
[
nr
]
=
ranktag
;
offsets
[
nr
]
=
ranktag_offsets
[
INDEX3
(
nr_ranks
,
nr_ranks
,
myrank
,
k
,
j
)];
nr
++
;
if
(
nr
>=
size
)
{
size
+=
(
max_logs
/
16
+
1
);
ranktags
=
(
size_t
*
)
realloc
(
ranktags
,
size
*
sizeof
(
size_t
));
offsets
=
(
size_t
*
)
realloc
(
offsets
,
size
*
sizeof
(
size_t
));
}
}
}
}
// Startup complete, so start timing and release the receive thread.
MPI_Barrier
(
MPI_COMM_WORLD
);
// Vital for synchronization.
clocks_set_cpufreq
(
cpufreq
);
...
...
@@ -310,19 +336,18 @@ static void *send_thread(void *arg) {
log
->
offset
=
0
;
int
found
=
0
;
// XXX must be faster way of doing this... Go back to per rank lists.
for
(
size_t
j
=
0
;
j
<
max_logs
;
j
++
)
{
if
(
ranktag_lists
[
INDEX3
(
nr_ranks
,
nr_ranks
,
myrank
,
log
->
otherrank
,
j
)]
==
ranktag
)
{
log
->
offset
=
ranktag_offsets
[
INDEX3
(
nr_ranks
,
nr_ranks
,
myrank
,
log
->
otherrank
,
j
)];
for
(
int
j
=
0
;
j
<
nr
;
j
++
)
{
if
(
ranktags
[
j
]
==
ranktag
)
{
log
->
offset
=
offsets
[
j
];
found
=
1
;
break
;
}
}
if
(
!
found
)
{
error
(
"Failed sending a message of size %zd to %d/%d "
"@ %zd
\n
, no offset found for ranktag %zd"
,
datasize
,
log
->
otherrank
,
log
->
subtype
,
log
->
offset
,
ranktag
);
"Failed sending a message of size %zd to %d/%d "
"@ %zd
\n
, no offset found for ranktag %zd"
,
datasize
,
log
->
otherrank
,
log
->
subtype
,
log
->
offset
,
ranktag
);
}
if
(
verbose
)
...
...
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