Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
c9a9852d
Commit
c9a9852d
authored
7 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Modify MPI tests to log sending hostname
parent
1d7c92ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testsuite/expect/test1.88.prog.c
+25
-15
25 additions, 15 deletions
testsuite/expect/test1.88.prog.c
testsuite/expect/test38.7.prog.c
+25
-15
25 additions, 15 deletions
testsuite/expect/test38.7.prog.c
with
50 additions
and
30 deletions
testsuite/expect/test1.88.prog.c
+
25
−
15
View file @
c9a9852d
...
...
@@ -27,46 +27,57 @@
#include
<mpi.h>
#include
<stdio.h>
#include
<string.h>
#include
<time.h>
#include
<unistd.h>
#include
<sys/utsname.h>
#define BUF_SIZE 64
#define COMM_TAG 1000
#define ITERATIONS 1
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
,
const
int
*
buf
)
typedef
struct
rank_info
{
char
host
[
BUF_SIZE
];
int
rank
;
}
rank_info_t
;
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
)
{
struct
utsname
uts
;
MPI_Request
request
[
2
];
MPI_Status
status
[
2
];
MPI_Irecv
((
void
*
)
buf
,
1
,
MPI_INT
,
((
rank
+
size
-
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
0
]);
MPI_Isend
((
void
*
)
&
rank
,
1
,
MPI_INT
,
((
rank
+
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
1
]);
MPI_Waitall
(
2
,
request
,
status
);
rank_info_t
out_buf
,
in_buf
;
out_buf
.
rank
=
rank
;
uname
(
&
uts
);
printf
(
"Rank[%d] on %s just received msg from Rank %d
\n
"
,
rank
,
uts
.
nodename
,
*
buf
);
strncpy
(
out_buf
.
host
,
uts
.
nodename
,
BUF_SIZE
);
out_buf
.
host
[
BUF_SIZE
-
1
]
=
'\0'
;
MPI_Irecv
((
void
*
)
&
in_buf
,
sizeof
(
rank_info_t
),
MPI_CHAR
,
((
rank
+
size
-
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
0
]);
MPI_Isend
((
void
*
)
&
out_buf
,
sizeof
(
rank_info_t
),
MPI_CHAR
,
((
rank
+
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
1
]);
MPI_Waitall
(
2
,
request
,
MPI_STATUS_IGNORE
);
printf
(
"Rank[%d] on %s just received msg from Rank %d on %s
\n
"
,
rank
,
uts
.
nodename
,
in_buf
.
rank
,
in_buf
.
host
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
;
int
size
,
rank
,
buf
;
int
size
,
rank
;
time_t
now
;
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
size
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
buf
=
rank
;
/* we only pass rank */
for
(
i
=
0
;
i
<
ITERATIONS
;
i
++
)
{
if
(
i
)
sleep
(
1
);
pass_its_neighbor
(
rank
,
size
,
&
buf
);
pass_its_neighbor
(
rank
,
size
);
if
((
ITERATIONS
>
1
)
&&
(
rank
==
0
))
{
static
time_t
last_time
=
0
;
now
=
time
(
NULL
);
...
...
@@ -80,4 +91,3 @@ int main(int argc, char * argv[])
MPI_Finalize
();
return
0
;
}
This diff is collapsed.
Click to expand it.
testsuite/expect/test38.7.prog.c
+
25
−
15
View file @
c9a9852d
...
...
@@ -27,46 +27,57 @@
#include
<mpi.h>
#include
<stdio.h>
#include
<string.h>
#include
<time.h>
#include
<unistd.h>
#include
<sys/utsname.h>
#define BUF_SIZE 64
#define COMM_TAG 1000
#define ITERATIONS 1
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
,
const
int
*
buf
)
typedef
struct
rank_info
{
char
host
[
BUF_SIZE
];
int
rank
;
}
rank_info_t
;
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
)
{
struct
utsname
uts
;
MPI_Request
request
[
2
];
MPI_Status
status
[
2
];
MPI_Irecv
((
void
*
)
buf
,
1
,
MPI_INT
,
((
rank
+
size
-
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
0
]);
MPI_Isend
((
void
*
)
&
rank
,
1
,
MPI_INT
,
((
rank
+
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
1
]);
MPI_Waitall
(
2
,
request
,
status
);
rank_info_t
out_buf
,
in_buf
;
out_buf
.
rank
=
rank
;
uname
(
&
uts
);
printf
(
"Rank[%d] on %s just received msg from Rank %d
\n
"
,
rank
,
uts
.
nodename
,
*
buf
);
strncpy
(
out_buf
.
host
,
uts
.
nodename
,
BUF_SIZE
);
out_buf
.
host
[
BUF_SIZE
-
1
]
=
'\0'
;
MPI_Irecv
((
void
*
)
&
in_buf
,
sizeof
(
rank_info_t
),
MPI_CHAR
,
((
rank
+
size
-
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
0
]);
MPI_Isend
((
void
*
)
&
out_buf
,
sizeof
(
rank_info_t
),
MPI_CHAR
,
((
rank
+
1
)
%
size
),
COMM_TAG
,
MPI_COMM_WORLD
,
&
request
[
1
]);
MPI_Waitall
(
2
,
request
,
MPI_STATUS_IGNORE
);
printf
(
"Rank[%d] on %s just received msg from Rank %d on %s
\n
"
,
rank
,
uts
.
nodename
,
in_buf
.
rank
,
in_buf
.
host
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
;
int
size
,
rank
,
buf
;
int
size
,
rank
;
time_t
now
;
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
size
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
buf
=
rank
;
/* we only pass rank */
for
(
i
=
0
;
i
<
ITERATIONS
;
i
++
)
{
if
(
i
)
sleep
(
1
);
pass_its_neighbor
(
rank
,
size
,
&
buf
);
pass_its_neighbor
(
rank
,
size
);
if
((
ITERATIONS
>
1
)
&&
(
rank
==
0
))
{
static
time_t
last_time
=
0
;
now
=
time
(
NULL
);
...
...
@@ -80,4 +91,3 @@ int main(int argc, char * argv[])
MPI_Finalize
();
return
0
;
}
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