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
bec906fd
Commit
bec906fd
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add the correct global communicators
parent
4de7da6b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpistalls.c
+14
-6
14 additions, 6 deletions
mpistalls.c
with
14 additions
and
6 deletions
mpistalls.c
+
14
−
6
View file @
bec906fd
...
@@ -15,12 +15,16 @@
...
@@ -15,12 +15,16 @@
#include
"error.h"
#include
"error.h"
#include
"mpiuse.h"
#include
"mpiuse.h"
/* Global: Our rank for all to see. */
int
myrank
=
-
1
;
/* Integer types of send and recv tasks, must match log. */
/* Integer types of send and recv tasks, must match log. */
static
int
task_type_send
=
22
;
static
const
int
task_type_send
=
22
;
static
int
task_type_recv
=
23
;
static
const
int
task_type_recv
=
23
;
/* Our rank for all to see. */
/* Global communicators for each of the subtypes. */
int
myrank
=
-
1
;
static
const
int
task_subtype_count
=
30
;
// Just some upper limit on subtype.
static
MPI_Comm
subtypeMPI_comms
[
30
];
/* The local queues. */
/* The local queues. */
static
struct
mpiuse_log_entry
**
volatile
reqs_queue
;
static
struct
mpiuse_log_entry
**
volatile
reqs_queue
;
...
@@ -53,7 +57,7 @@ static void *inject_thread(void *arg) {
...
@@ -53,7 +57,7 @@ static void *inject_thread(void *arg) {
int
err
=
0
;
int
err
=
0
;
if
(
log
->
type
==
task_type_send
)
{
if
(
log
->
type
==
task_type_send
)
{
err
=
MPI_Isend
(
log
->
data
,
log
->
size
,
MPI_BYTE
,
log
->
otherrank
,
err
=
MPI_Isend
(
log
->
data
,
log
->
size
,
MPI_BYTE
,
log
->
otherrank
,
log
->
tag
,
MPI_COMM_WORLD
,
&
log
->
req
);
log
->
tag
,
subtypeMPI_comms
[
log
->
subtype
]
,
&
log
->
req
);
/* Add a new send request. */
/* Add a new send request. */
int
ind
=
atomic_inc
(
&
nr_sends
);
int
ind
=
atomic_inc
(
&
nr_sends
);
...
@@ -62,7 +66,7 @@ static void *inject_thread(void *arg) {
...
@@ -62,7 +66,7 @@ static void *inject_thread(void *arg) {
}
else
{
}
else
{
err
=
MPI_Irecv
(
log
->
data
,
log
->
size
,
MPI_BYTE
,
log
->
rank
,
err
=
MPI_Irecv
(
log
->
data
,
log
->
size
,
MPI_BYTE
,
log
->
rank
,
log
->
tag
,
MPI_COMM_WORLD
,
&
log
->
req
);
log
->
tag
,
subtypeMPI_comms
[
log
->
subtype
]
,
&
log
->
req
);
/* Add a new recv request. */
/* Add a new recv request. */
int
ind
=
atomic_inc
(
&
nr_recvs
);
int
ind
=
atomic_inc
(
&
nr_recvs
);
...
@@ -223,6 +227,10 @@ int main(int argc, char *argv[]) {
...
@@ -223,6 +227,10 @@ int main(int argc, char *argv[]) {
if
(
res
!=
MPI_SUCCESS
)
if
(
res
!=
MPI_SUCCESS
)
error
(
"Call to MPI_Comm_rank failed with error %i."
,
res
);
error
(
"Call to MPI_Comm_rank failed with error %i."
,
res
);
/* Create communicators for each subtype of the tasks. */
for
(
int
i
=
0
;
i
<
task_subtype_count
;
i
++
)
{
MPI_Comm_dup
(
MPI_COMM_WORLD
,
&
subtypeMPI_comms
[
i
]);
}
message
(
"Starts"
);
message
(
"Starts"
);
/* Each rank requires its own queue, so extract them. */
/* Each rank requires its own queue, so extract them. */
...
...
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