Commit 59b6b5bc authored by incardon's avatar incardon

Fixing several memory leak

parent 21227cad
Pipeline #2094 passed with stages
in 20 minutes and 35 seconds
......@@ -36,6 +36,7 @@ set(PARMETIS_DIR ${PARMETIS_ROOT})
set(OPENBLAS_ROOT CACHE PATH "Root path for blas library")
set(SuiteSparse_ROOT ${SUITESPARSE_ROOT})
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
......
......@@ -119,6 +119,7 @@ with_petsc
with_eigen
with_vcdevel
enable_gpu
enable_asan
'
rm -rf build
......@@ -246,6 +247,9 @@ do
fi
conf_options="$conf_options -DENABLE_GPU=ON"
;;
asan)
conf_options="$conf_options -DENABLE_ASAN=ON"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', '
;;
......
......@@ -50,6 +50,12 @@ if ( CMAKE_COMPILER_IS_GNUCC )
endif()
endif()
if (ENABLE_ASAN)
target_compile_options(pdata PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g" >)
target_compile_options(pdata PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g >)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
endif()
add_library(ofpm_pdata STATIC lib/pdata.cpp)
add_test(NAME pdata_3_proc COMMAND mpirun -np 3 ./pdata)
......
......@@ -327,6 +327,21 @@ public:
delete[] Mg.wgtflag;
}
if (Mg.itr != NULL)
{
delete[] Mg.itr;
}
if (Mg.vsize != NULL)
{
delete[] Mg.vsize;
}
if (Mg.objval != NULL)
{
delete[] Mg.objval;
}
if (is_openfpm_init() == true)
{MPI_Comm_free(&comm);}
}
......@@ -354,8 +369,6 @@ public:
// construct the adjacency list
constructAdjList(g, m2g);
//reset(g, vtxdist, m2g, w);
}
/*! \brief Decompose the graph
......@@ -446,6 +459,66 @@ public:
delete[] Mg.part;
}
if (Mg.vsize != NULL)
{
delete[] Mg.vsize;
}
if (Mg.options != NULL)
{
delete[] Mg.options;
}
if (Mg.ncon != NULL)
{
delete[] Mg.ncon;
}
if (Mg.edgecut != NULL)
{
delete[] Mg.edgecut;
}
if (Mg.wgtflag != NULL)
{
delete[] Mg.wgtflag;
}
if (Mg.numflag != NULL)
{
delete[] Mg.numflag;
}
if (Mg.nparts != NULL)
{
delete[] Mg.nparts;
}
if (Mg.nvtxs != NULL)
{
delete[] Mg.nvtxs;
}
if (Mg.objval != NULL)
{
delete[] Mg.objval;
}
if (Mg.ubvec != NULL)
{
delete[] Mg.ubvec;
}
if(Mg.itr != NULL)
{
delete[] Mg.itr;
}
if (Mg.tpwgts != NULL)
{
delete[] Mg.tpwgts;
}
setDefaultParameters(vgw);
// construct the adjacency list
......
Markdown is supported
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