Commit f1398303 authored by iker_martin's avatar iker_martin
Browse files

Memleak fixed for zombies before suspend/terminate. Makefile now automatically...

Memleak fixed for zombies before suspend/terminate. Makefile now automatically adds -g when using MAM_DEBUG. Found memleak in types, is necessary to decide how to tackle it properly.
parent 6ff12d05
......@@ -483,6 +483,18 @@ void free_zombie_process() {
free_results_data(results, config_file->n_stages);
free(results);
size_t i;
if(config_file->adr && group->async_array != NULL) {
for(i=0; i<group->async_data_groups; i++) {
free(group->async_array[i]);
group->async_array[i] = NULL;
}
free(group->async_qty);
group->async_qty = NULL;
free(group->async_array);
group->async_array = NULL;
}
free_config(config_file);
}
......
......@@ -7,11 +7,15 @@ LD_FLAGS = -lm -pthread
MAM_USE_SLURM ?= 0
MAM_USE_BARRIERS ?= 0
MAM_DEBUG ?= 0
DEF = -DMAM_USE_SLURM=$(MAM_USE_SLURM) -DMAM_USE_BARRIERS=$(MAM_USE_BARRIERS) -DMAM_DEBUG=$(MAM_DEBUG)
ifeq ($(MAM_USE_SLURM),1)
LD_FLAGS += -lslurm
endif
DEF = -DMAM_USE_SLURM=$(MAM_USE_SLURM) -DMAM_USE_BARRIERS=$(MAM_USE_BARRIERS) -DMAM_DEBUG=$(MAM_DEBUG)
ifeq ($(shell test $(MAM_DEBUG) -gt 0; echo $$?),0)
C_FLAGS += -g
endif
# Final binary
BIN = a.out
......
......@@ -102,7 +102,7 @@ void comm_data_info(malleability_data_t *data_struct_rep, malleability_data_t *d
if(is_children_group) {
for(i=0; i < data_struct_rep->entries; i++) {
MPI_Type_size(data_struct_rep->types[i], &type_size);
data_struct_rep->arrays[i] = (void *) malloc(data_struct_rep->qty[i] * type_size);
data_struct_rep->arrays[i] = (void *) malloc(data_struct_rep->qty[i] * type_size); //FIXME This memory is not freed -- How should be done?
data_struct_rep->requests[i] = (MPI_Request *) malloc(data_struct_rep->request_qty[i] * sizeof(MPI_Request));
for(j=0; j < data_struct_rep->request_qty[i]; j++) {
data_struct_rep->requests[i][j] = MPI_REQUEST_NULL;
......
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