Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
supercomputer_lab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
supercomputer_lab
Commits
d2aa6af4
Commit
d2aa6af4
authored
May 18, 2012
by
Gaurav Kukreja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solved minor bug in ping-pong.c
* Gaurav Signed-off-by:
Gaurav Kukreja
<
mailme.gaurav@gmail.com
>
parent
3e829627
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
ping-pong.c
mpi-assign3/ping-pong.c
+3
-4
No files found.
mpi-assign3/ping-pong.c
View file @
d2aa6af4
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
#include <stdlib.h>
#include <stdlib.h>
#include "result.h"
#include "result.h"
#define PING_PONG_LIMIT 5
#define FNAME_CMDARG 1
#define FNAME_CMDARG 1
struct
data_latency
data_l
;
struct
data_latency
data_l
;
...
@@ -11,7 +13,6 @@ char *filename;
...
@@ -11,7 +13,6 @@ char *filename;
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
int
PING_PONG_LIMIT
=
5
;
int
my_rank
,
partner_rank
,
i
,
j
,
nprocs
;
int
my_rank
,
partner_rank
,
i
,
j
,
nprocs
;
int
tag
=
10
;
int
tag
=
10
;
char
a
,
b
;
char
a
,
b
;
...
@@ -60,10 +61,8 @@ int main (int argc, char **argv)
...
@@ -60,10 +61,8 @@ int main (int argc, char **argv)
if
(
my_rank
==
0
){
if
(
my_rank
==
0
){
data_l
.
source_thread
=
0
;
data_l
.
source_thread
=
0
;
data_l
.
dest_thread
=
partner_rank
;
data_l
.
dest_thread
=
partner_rank
;
data_l
.
latency
=
(
tend
-
tstart
)
/
10
;
data_l
.
latency
=
(
tend
-
tstart
)
/
(
2
*
PING_PONG_LIMIT
)
;
submit_latency_data
(
data_l
);
submit_latency_data
(
data_l
);
printf
(
"Latency for process %d = %lf
\n
"
,
partner_rank
,
(
tend
-
tstart
)
/
10
);
}
}
}
}
MPI_Finalize
();
MPI_Finalize
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment