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
c706c1c8
Commit
c706c1c8
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add option to scale the size of messages, fix bug in tobytes
parent
1aeb25b8
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
+22
-4
22 additions, 4 deletions
swiftmpirdmastepsim.c
with
22 additions
and
4 deletions
swiftmpirdmastepsim.c
+
22
−
4
View file @
c706c1c8
...
@@ -89,6 +89,9 @@ static const size_t HEADER_SIZE = 3;
...
@@ -89,6 +89,9 @@ static const size_t HEADER_SIZE = 3;
/* Are we verbose. */
/* Are we verbose. */
static
int
verbose
=
0
;
static
int
verbose
=
0
;
/* Scale to apply to the size of the messages we send. */
static
double
messagescale
=
1
.
0
;
/* Set a data pattern and check we get this back, slow... */
/* Set a data pattern and check we get this back, slow... */
static
int
datacheck
=
0
;
static
int
datacheck
=
0
;
...
@@ -161,7 +164,7 @@ static int toblocks(BLOCKTYPE nr_bytes) {
...
@@ -161,7 +164,7 @@ static int toblocks(BLOCKTYPE nr_bytes) {
*
*
* @result the number of bytes.
* @result the number of bytes.
*/
*/
static
BLOCKTYPE
tobytes
(
int
nr_blocks
)
{
return
(
nr_blocks
*
BYTESINBLOCK
);
}
static
BLOCKTYPE
tobytes
(
BLOCKTYPE
nr_blocks
)
{
return
(
nr_blocks
*
BYTESINBLOCK
);
}
/**
/**
* @brief fill a data area with our rank.
* @brief fill a data area with our rank.
...
@@ -470,6 +473,9 @@ static void pick_logs() {
...
@@ -470,6 +473,9 @@ static void pick_logs() {
}
else
{
}
else
{
error
(
"task type '%d' is not a known send or recv task"
,
log
->
type
);
error
(
"task type '%d' is not a known send or recv task"
,
log
->
type
);
}
}
/* Scale size. */
log
->
size
*=
messagescale
;
}
}
}
}
}
}
...
@@ -535,7 +541,7 @@ int main(int argc, char *argv[]) {
...
@@ -535,7 +541,7 @@ int main(int argc, char *argv[]) {
/* Handle the command-line, we expect a mpiuse data file to read and various
/* Handle the command-line, we expect a mpiuse data file to read and various
* options. */
* options. */
int
opt
;
int
opt
;
while
((
opt
=
getopt
(
argc
,
argv
,
"vd"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"
f
vd
s:
"
))
!=
-
1
)
{
switch
(
opt
)
{
switch
(
opt
)
{
case
'd'
:
case
'd'
:
datacheck
=
1
;
datacheck
=
1
;
...
@@ -543,6 +549,9 @@ int main(int argc, char *argv[]) {
...
@@ -543,6 +549,9 @@ int main(int argc, char *argv[]) {
case
'v'
:
case
'v'
:
verbose
=
1
;
verbose
=
1
;
break
;
break
;
case
's'
:
messagescale
=
atof
(
optarg
);
break
;
default:
default:
if
(
myrank
==
0
)
usage
(
argv
);
if
(
myrank
==
0
)
usage
(
argv
);
return
1
;
return
1
;
...
@@ -585,8 +594,13 @@ int main(int argc, char *argv[]) {
...
@@ -585,8 +594,13 @@ int main(int argc, char *argv[]) {
MPI_Comm_dup
(
MPI_COMM_WORLD
,
&
subtypeMPI_comms
[
i
]);
MPI_Comm_dup
(
MPI_COMM_WORLD
,
&
subtypeMPI_comms
[
i
]);
size_t
size
=
tobytes
(
ranktag_sizes
[
i
]);
size_t
size
=
tobytes
(
ranktag_sizes
[
i
]);
if
(
size
==
0
)
size
=
BYTESINBLOCK
;
if
(
size
==
0
)
size
=
BYTESINBLOCK
;
MPI_Win_allocate
(
size
,
BYTESINBLOCK
,
MPI_INFO_NULL
,
subtypeMPI_comms
[
i
],
int
ret
=
MPI_Win_allocate
(
size
,
BYTESINBLOCK
,
MPI_INFO_NULL
,
&
mpi_ptr
[
i
],
&
mpi_window
[
i
]);
subtypeMPI_comms
[
i
],
&
mpi_ptr
[
i
],
&
mpi_window
[
i
]);
if
(
ret
!=
MPI_SUCCESS
)
{
message
(
"failed on size %zd"
,
size
);
fflush
(
stdout
);
mpi_error_message
(
ret
,
"MPI_Win_allocate failed"
);
}
memset
(
mpi_ptr
[
i
],
0
,
tobytes
(
ranktag_sizes
[
i
]));
memset
(
mpi_ptr
[
i
],
0
,
tobytes
(
ranktag_sizes
[
i
]));
...
@@ -614,6 +628,10 @@ int main(int argc, char *argv[]) {
...
@@ -614,6 +628,10 @@ int main(int argc, char *argv[]) {
if
(
myrank
==
0
)
{
if
(
myrank
==
0
)
{
message
(
"Start of MPI tests"
);
message
(
"Start of MPI tests"
);
message
(
"=================="
);
message
(
"=================="
);
if
(
messagescale
!=
1
.
0
f
)
{
message
(
" "
);
message
(
" Using message scale of %f"
,
messagescale
);
}
if
(
verbose
)
{
if
(
verbose
)
{
if
(
datacheck
)
if
(
datacheck
)
message
(
"checking data pattern on send and recv completion"
);
message
(
"checking data pattern on send and recv completion"
);
...
...
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