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
a665842f
Commit
a665842f
authored
12 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Make mpi test more flexible for varying the test
parent
ee254c55
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
testsuite/expect/test1.88.prog.c
+17
-5
17 additions, 5 deletions
testsuite/expect/test1.88.prog.c
with
17 additions
and
5 deletions
testsuite/expect/test1.88.prog.c
+
17
−
5
View file @
a665842f
...
@@ -25,11 +25,14 @@
...
@@ -25,11 +25,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\*****************************************************************************/
\*****************************************************************************/
#include
<stdio.h>
#include
<mpi.h>
#include
<mpi.h>
#include
<stdio.h>
#include
<time.h>
#include
<unistd.h>
#include
<sys/utsname.h>
#include
<sys/utsname.h>
#define COMM_TAG 1000
#define COMM_TAG 1000
#define ITERATIONS 1
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
,
const
int
*
buf
)
static
void
pass_its_neighbor
(
const
int
rank
,
const
int
size
,
const
int
*
buf
)
{
{
...
@@ -44,14 +47,15 @@ static void pass_its_neighbor(const int rank, const int size, const int* buf)
...
@@ -44,14 +47,15 @@ static void pass_its_neighbor(const int rank, const int size, const int* buf)
MPI_Waitall
(
2
,
request
,
status
);
MPI_Waitall
(
2
,
request
,
status
);
uname
(
&
uts
);
uname
(
&
uts
);
f
printf
(
stdout
,
"Rank[%d] on %s just received msg from Rank %d
\n
"
,
printf
(
"Rank[%d] on %s just received msg from Rank %d
\n
"
,
rank
,
uts
.
nodename
,
*
buf
);
rank
,
uts
.
nodename
,
*
buf
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
int
i
;
int
i
;
int
size
,
rank
,
buf
;
int
size
,
rank
,
buf
;
time_t
now
;
MPI_Init
(
&
argc
,
&
argv
);
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
size
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
size
);
...
@@ -59,10 +63,18 @@ int main(int argc, char * argv[])
...
@@ -59,10 +63,18 @@ int main(int argc, char * argv[])
buf
=
rank
;
/* we only pass rank */
buf
=
rank
;
/* we only pass rank */
for
(
i
=
0
;
i
<
1
;
i
++
)
{
for
(
i
=
0
;
i
<
ITERATIONS
;
i
++
)
{
if
(
i
)
if
(
i
)
sleep
(
1
);
sleep
(
1
);
pass_its_neighbor
(
rank
,
size
,
&
buf
);
pass_its_neighbor
(
rank
,
size
,
&
buf
);
if
((
ITERATIONS
>
1
)
&&
(
rank
==
0
))
{
static
time_t
last_time
=
0
;
now
=
time
(
NULL
);
printf
(
"Iteration:%d Time:%s"
,
i
,
ctime
(
&
now
));
if
(
last_time
&&
(
last_time
<
(
now
-
2
)))
printf
(
"Woke from suspend
\n
"
);
last_time
=
now
;
}
}
}
MPI_Finalize
();
MPI_Finalize
();
...
...
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