Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
MPI_HW
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
hasan.bahjat
MPI_HW
Commits
6282a299
Commit
6282a299
authored
Nov 19, 2024
by
hasan.bahjat
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Issues in wanring
parent
18d79ec1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
MPI_Allrduce.c
MPI_Allrduce.c
+4
-4
RingAllreduce.c
RingAllreduce.c
+0
-2
No files found.
MPI_Allrduce.c
View file @
6282a299
...
...
@@ -115,7 +115,7 @@ int main(int argc, char** argv) {
srand
(
time
(
0
)
+
rank
);
// Random integer between 0 and 99 (this is first simple intutyion in the next stage i will replace it with array )
int
localValue
=
rand
()
%
100
;
//
int localValue = rand() % 100;
const
int
ARRAY_SIZE
=
5
;
// Length of each process's array
vector
<
int
>
localArray
(
ARRAY_SIZE
);
...
...
@@ -135,7 +135,7 @@ int main(int argc, char** argv) {
//[1] Use the naive implementation of MPI_Allreduce
int
globalValue
=
0
;
//
int globalValue = 0;
// Start timing
double
start_time_naive
=
MPI_Wtime
();
...
...
@@ -166,14 +166,14 @@ int main(int argc, char** argv) {
print
(
globalArrayNaive
,
rank
,
message
);
// [2] Use the built-in MPI_Allreduce for comparison
int
globalValueBuiltIn
=
0
;
//
int globalValueBuiltIn = 0;
// Start timing
double
start_time_builtin
=
MPI_Wtime
();
// Mpi Alllreduce buld in
// MPI_Allreduce(
// &localValue,
// &global
ValueBuiltI
n,
// &global
ArrayBuilti
n,
// 1, MPI_INT,
// MPI_SUM,
// MPI_COMM_WORLD
...
...
RingAllreduce.c
View file @
6282a299
...
...
@@ -133,8 +133,6 @@ int main(int argc, char** argv) {
// seed with time and rank for unique values
srand
(
time
(
0
)
+
rank
);
// random integer between 0 and 99 (this is first simple intutyion in the next stage i will replace it with array )
int
localValue
=
rand
()
%
100
;
// define a :
// local array for the local reduction
...
...
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