Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
pi
Commits
50ed58e8
Commit
50ed58e8
authored
Jul 22, 2019
by
Neil Gershenfeld
Browse files
wip
parent
08739f7e
Pipeline
#3945
passed with stage
in 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
MPI/mpipi.c
View file @
50ed58e8
...
...
@@ -8,7 +8,7 @@
#include <mpi.h>
#include <sys/time.h>
#define NPTS 1000000000
#define NPTS 1000000000
0
void
main
(
int
argc
,
char
**
argv
)
{
int
rank
,
nproc
,
i
,
istart
,
iend
;
...
...
@@ -31,7 +31,7 @@ void main(int argc, char** argv) {
start_time
=
start
.
tv_sec
*
1e6
+
start
.
tv_usec
;
end_time
=
end
.
tv_sec
*
1e6
+
end
.
tv_usec
;
mflops
=
NPTS
*
(
5
.
0
/
(
end_time
-
start_time
));
printf
(
"processes = %d, NPTS = %d, pi = %f
\n
"
,
nproc
,
NPTS
,
pi
);
printf
(
"processes = %d, NPTS = %
l
d, pi = %f
\n
"
,
nproc
,
NPTS
,
pi
);
printf
(
"time = %f, estimated MFlops = %f
\n
"
,(
end_time
-
start_time
)
/
1.0e6
,
mflops
);
}
else
{
...
...
MPI/mpipi2.c
View file @
50ed58e8
...
...
@@ -10,7 +10,7 @@
#include <sys/time.h>
#include <stdint.h>
#define NPTS 100000000
#define NPTS 100000000
00
#define NLOOP 10
void
main
(
int
argc
,
char
**
argv
)
{
...
...
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