Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Iker Martín Álvarez
Malleable_CG
Commits
169ef7a2
Commit
169ef7a2
authored
Feb 26, 2024
by
iker_martin
Browse files
Fixed minor mem bug and error related to Merge Shrink
parent
e466e997
Changes
3
Hide whitespace changes
Inline
Side-by-side
Main/ConjugateGradient.c
View file @
169ef7a2
...
@@ -89,7 +89,7 @@ void getIds_intercomm(struct Dist_data dist_data, int numP_other, int *idS);
...
@@ -89,7 +89,7 @@ void getIds_intercomm(struct Dist_data dist_data, int numP_other, int *idS);
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
int
sm
;
int
init_numP
;
int
req
;
int
req
;
Compute_data
computeData
;
Compute_data
computeData
;
user_redist_t
user_data
;
user_redist_t
user_data
;
...
@@ -120,6 +120,7 @@ int main (int argc, char *argv[]) {
...
@@ -120,6 +120,7 @@ int main (int argc, char *argv[]) {
init_app
(
&
computeData
,
&
dist_data
,
argv
);
init_app
(
&
computeData
,
&
dist_data
,
argv
);
originals_set_data
(
&
dist_data
,
&
computeData
,
num_targets
);
originals_set_data
(
&
dist_data
,
&
computeData
,
num_targets
);
init_numP
=
dist_data
.
numP
;
user_data
.
array_vptr
=
computeData
.
subm
.
vptr
;
user_data
.
array_vptr
=
computeData
.
subm
.
vptr
;
user_data
.
array_vpos
=
computeData
.
subm
.
vpos
;
user_data
.
array_vpos
=
computeData
.
subm
.
vpos
;
user_data
.
array_vval
=
computeData
.
subm
.
vval
;
user_data
.
array_vval
=
computeData
.
subm
.
vval
;
...
@@ -140,9 +141,10 @@ int main (int argc, char *argv[]) {
...
@@ -140,9 +141,10 @@ int main (int argc, char *argv[]) {
// End of CG
// End of CG
MAM_Finalize
();
MAM_Finalize
();
free_computeData
(
&
computeData
);
free_computeData
(
&
computeData
);
if
(
dist_data
.
numP
>
num_targets
&&
dist_data
.
myId
==
0
)
{
if
(
init_
numP
>
num_targets
&&
dist_data
.
myId
==
0
)
{
MPI_Abort
(
MPI_COMM_WORLD
,
-
100
);
MPI_Abort
(
MPI_COMM_WORLD
,
-
100
);
}
}
if
(
dist_data
.
comm
!=
MPI_COMM_WORLD
&&
dist_data
.
comm
!=
MPI_COMM_NULL
)
MPI_Comm_free
(
&
dist_data
.
comm
);
MPI_Finalize
();
MPI_Finalize
();
}
}
...
...
malleability/spawn_methods/GenericSpawn.c
View file @
169ef7a2
...
@@ -73,7 +73,7 @@ int init_spawn(MPI_Comm comm, MPI_Comm *child) {
...
@@ -73,7 +73,7 @@ int init_spawn(MPI_Comm comm, MPI_Comm *child) {
allocate_thread_spawn
(
child
);
allocate_thread_spawn
(
child
);
}
}
}
}
return
local_state
;
return
local_state
;
}
}
...
...
malleability/spawn_methods/ProcessDist.c
View file @
169ef7a2
...
@@ -134,7 +134,7 @@ void compact_dist(Spawn_data spawn_data, int *used_nodes, int *procs) {
...
@@ -134,7 +134,7 @@ void compact_dist(Spawn_data spawn_data, int *used_nodes, int *procs) {
int
i
,
asigCores
;
int
i
,
asigCores
;
int
tamBl
,
remainder
;
int
tamBl
,
remainder
;
tamBl
=
mall
->
num_cpus
/
mall
->
num_nodes
;
tamBl
=
mall
->
num_cpus
;
asigCores
=
spawn_data
.
already_created
;
asigCores
=
spawn_data
.
already_created
;
i
=
*
used_nodes
=
spawn_data
.
already_created
/
tamBl
;
i
=
*
used_nodes
=
spawn_data
.
already_created
/
tamBl
;
remainder
=
spawn_data
.
already_created
%
tamBl
;
remainder
=
spawn_data
.
already_created
%
tamBl
;
...
...
Write
Preview
Supports
Markdown
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