Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpi-par
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alesanc
mpi-par
Commits
b052810a
Commit
b052810a
authored
Jun 11, 2024
by
alexgara
Browse files
Options
Downloads
Patches
Plain Diff
finish with comments
parent
a9b3ecb1
Branches
main
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
align_mpi.c
+14
-14
14 additions, 14 deletions
align_mpi.c
with
14 additions
and
14 deletions
align_mpi.c
+
14
−
14
View file @
b052810a
...
...
@@ -432,8 +432,8 @@ int main(int argc, char *argv[]) {
//Envio el parton para que continue el siguente que le toca
MPI_CHECK_FUNCTION
(
MPI_Send
(
envio_array
,
3
,
MPI_UNSIGNED_LONG
,
rank
+
1
,
TAG_NO_COMPLETE
,
MPI_COMM_WORLD
));
printf
(
"
\n
ENVIA(%d) rank=%d a rank+1=%d pat=%lu, START=%lu, LENGHT=%lu
\n
"
,
(
1
),
rank
,
rank
+
1
,
envio_array
[
2
],
envio_array
[
0
],
envio_array
[
1
]);
fflush
(
stdout
);
//
printf("\n ENVIA(%d) rank=%d a rank+1=%d pat=%lu, START=%lu, LENGHT=%lu\n", (1), rank, rank+1, envio_array[2], envio_array[0], envio_array[1]);
//
fflush(stdout);
break
;
}
else
if
(
sequence
[
start
+
ind
]
!=
pattern
[
pat
][
ind
]
)
break
;
...
...
@@ -441,7 +441,7 @@ int main(int argc, char *argv[]) {
/* 5.1.2. Check if the loop ended with a match */
if
(
ind
==
pat_length
[
pat
]
)
{
pat_found
[
pat
]
=
my_begin
+
start
;
printf
(
"RANK(%d) encuentra patrón=%lu
\n
"
,
rank
,
pat
);
//
printf("RANK(%d) encuentra patrón=%lu\n",rank, pat);
break
;
}
}
...
...
@@ -466,13 +466,13 @@ int main(int argc, char *argv[]) {
length_r
=
recibo_array
[
1
];
//Lenght already checked
pat_r
=
recibo_array
[
2
];
//Pattern searching
printf
(
"
\n
RECIBE rank=%d desde rank-1=%d pat=%lu con TAG=%d, START=%lu, LENGHT=%lu
\n
"
,
rank
,
status
.
MPI_SOURCE
,
pat_r
,
status
.
MPI_TAG
,
start_r
,
length_r
);
fflush
(
stdout
);
//
printf("\n RECIBE rank=%d desde rank-1=%d pat=%lu con TAG=%d, START=%lu, LENGHT=%lu\n" ,rank, status.MPI_SOURCE, pat_r, status.MPI_TAG, start_r, length_r);
//
fflush(stdout);
//THEN its end sigal the first so no more thing to do
if
(
pat_r
==
(
unsigned
long
)
END_SIG
){
printf
(
"
\n
GET FIN rank=%d desde rank-1=%d
\n
"
,
rank
,
status
.
MPI_SOURCE
);
fflush
(
stdout
);
//
printf("\n GET FIN rank=%d desde rank-1=%d \n", rank, status.MPI_SOURCE);
//
fflush(stdout);
break
;
}
...
...
@@ -487,8 +487,8 @@ int main(int argc, char *argv[]) {
//Send to the next rank
MPI_CHECK_FUNCTION
(
MPI_Send
(
envio_array
,
3
,
MPI_UNSIGNED_LONG
,
rank
+
1
,
TAG_NO_COMPLETE
,
MPI_COMM_WORLD
));
printf
(
"
\n
ENVIA(%d) rank=%d a rank+1=%d pat=%lu, START=%lu, LENGHT=%lu
\n
"
,
(
2
),
rank
,
rank
+
1
,
envio_array
[
2
],
envio_array
[
0
],
envio_array
[
1
]);
fflush
(
stdout
);
//
printf("\n ENVIA(%d) rank=%d a rank+1=%d pat=%lu, START=%lu, LENGHT=%lu\n", (2), rank, rank+1, envio_array[2], envio_array[0], envio_array[1]);
//
fflush(stdout);
break
;
}
else
if
(
sequence
[
ind
]
!=
pattern
[
pat_r
][
ind
+
length_r
]
)
break
;
...
...
@@ -496,8 +496,7 @@ int main(int argc, char *argv[]) {
// else we have a match
if
(
ind
+
length_r
==
pat_length
[
pat_r
]
)
{
pat_found
[
pat_r
]
=
start_r
;
printf
(
"RANK(%d) encuentra patrón=%lu
\n
"
,
rank
,
pat_r
);
break
;
//printf("RANK(%d) encuentra patrón=%lu\n",rank, pat_r);
}
}
...
...
@@ -506,8 +505,8 @@ int main(int argc, char *argv[]) {
envio_array
[
1
]
=
(
unsigned
long
)
END_SIG
;
envio_array
[
2
]
=
(
unsigned
long
)
END_SIG
;
MPI_CHECK_FUNCTION
(
MPI_Send
(
envio_array
,
3
,
MPI_UNSIGNED_LONG
,
rank
+
1
,
TAG_NO_COMPLETE
,
MPI_COMM_WORLD
));
printf
(
"
\n
ENVIA FIN rank=%d a rank+1=%d
\n
"
,
rank
,
rank
+
1
);
fflush
(
stdout
);
//
printf("\n ENVIA FIN rank=%d a rank+1=%d \n", rank, rank+1);
//
fflush(stdout);
}
//Wait until all the process finish
...
...
@@ -599,6 +598,7 @@ int main(int argc, char *argv[]) {
}
/*
fflush(stdout);
MPI_CHECK_FUNCTION(MPI_Barrier(MPI_COMM_WORLD));
unsigned long ind1;
...
...
@@ -619,7 +619,7 @@ int main(int argc, char *argv[]) {
printf("\n");
fflush(stdout);
}
*/
...
...
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