Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
M
MPI_ArrayTask
Project
Project
Details
Activity
Releases
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
tammam.alsoleman
MPI_ArrayTask
Commits
82c6984c
Commit
82c6984c
authored
Dec 25, 2025
by
tammam.alsoleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD calculating run time (Tcomm + Tcomp)
parent
28e3521b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
MPI_AVG.java
src/main/java/org/example/MPI_AVG.java
+12
-0
No files found.
src/main/java/org/example/MPI_AVG.java
View file @
82c6984c
...
...
@@ -7,6 +7,10 @@ public class MPI_AVG {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
MPI
.
Init
(
args
);
// Ensure all processes are ready before starting the clock
MPI
.
COMM_WORLD
.
Barrier
();
long
startTime
=
System
.
nanoTime
();
int
rank
=
MPI
.
COMM_WORLD
.
Rank
();
int
size
=
MPI
.
COMM_WORLD
.
Size
();
...
...
@@ -76,6 +80,14 @@ public class MPI_AVG {
System
.
out
.
println
(
"========================================\n"
);
}
MPI
.
COMM_WORLD
.
Barrier
();
long
endTime
=
System
.
nanoTime
();
if
(
rank
==
0
)
{
double
duration
=
(
endTime
-
startTime
)
/
1_000_000.0
;
System
.
out
.
println
(
"Execution Time for "
+
size
+
" processes: "
+
duration
+
" ms"
);
}
MPI
.
Finalize
();
}
}
\ No newline at end of file
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