Commit 169ef7a2 authored by iker_martin's avatar iker_martin
Browse files

Fixed minor mem bug and error related to Merge Shrink

parent e466e997
...@@ -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();
} }
......
...@@ -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;
} }
......
...@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment