fixed some memory leaks and removed unnecessary operations
This commit is contained in:
parent
beadcda7c4
commit
ab52798ed5
@ -270,6 +270,7 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
}
|
||||
if (S)
|
||||
hypre_ParCSRMatrixDestroy(S);
|
||||
hypre_TFree(coarse_pnts_global);
|
||||
if (level > 0)
|
||||
{
|
||||
/* note special case treatment of CF_marker is necessary
|
||||
|
||||
@ -127,6 +127,8 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
MPI_Comm_size(comm, &num_procs);
|
||||
MPI_Comm_rank(comm,&my_id);
|
||||
num_threads = hypre_NumThreads();
|
||||
my_first_cpt = num_cpts_global[my_id];
|
||||
total_global_cpts = num_cpts_global[num_procs];
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
* Get the CF_marker data for the off-processor columns
|
||||
@ -212,7 +214,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
* Determine the number of C-pts on each processor, broadcast,
|
||||
* the first C-pt on each processor, and the total number of C-pts
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
if (debug_flag==4) wall_time = time_getWallclockSeconds();
|
||||
|
||||
num_cpts_global = hypre_CTAlloc(int, num_procs+1);
|
||||
@ -253,7 +255,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
{
|
||||
num_cpts_global[i] = num_cpts_global[i+1] - num_cpts_global[i];
|
||||
}
|
||||
|
||||
*/
|
||||
/*-----------------------------------------------------------------------
|
||||
* First Pass: Determine size of P and fill in fine_to_coarse mapping.
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
@ -185,10 +185,10 @@ hypre_BoomerAMGCreateS(hypre_ParCSRMatrix *A,
|
||||
}
|
||||
|
||||
num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg);
|
||||
int_buf_data = hypre_CTAlloc(int, hypre_ParCSRCommPkgSendMapStart(comm_pkg,
|
||||
num_sends));
|
||||
if (num_functions > 1)
|
||||
{
|
||||
int_buf_data = hypre_CTAlloc(int,hypre_ParCSRCommPkgSendMapStart(comm_pkg,
|
||||
num_sends));
|
||||
index = 0;
|
||||
for (i = 0; i < num_sends; i++)
|
||||
{
|
||||
@ -202,6 +202,7 @@ hypre_BoomerAMGCreateS(hypre_ParCSRMatrix *A,
|
||||
dof_func_offd);
|
||||
|
||||
hypre_ParCSRCommHandleDestroy(comm_handle);
|
||||
hypre_TFree(int_buf_data);
|
||||
}
|
||||
|
||||
/* give S same nonzero structure as A */
|
||||
|
||||
@ -270,6 +270,7 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
}
|
||||
if (S)
|
||||
hypre_ParCSRMatrixDestroy(S);
|
||||
hypre_TFree(coarse_pnts_global);
|
||||
if (level > 0)
|
||||
{
|
||||
/* note special case treatment of CF_marker is necessary
|
||||
|
||||
@ -127,6 +127,8 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
MPI_Comm_size(comm, &num_procs);
|
||||
MPI_Comm_rank(comm,&my_id);
|
||||
num_threads = hypre_NumThreads();
|
||||
my_first_cpt = num_cpts_global[my_id];
|
||||
total_global_cpts = num_cpts_global[num_procs];
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
* Get the CF_marker data for the off-processor columns
|
||||
@ -212,7 +214,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
* Determine the number of C-pts on each processor, broadcast,
|
||||
* the first C-pt on each processor, and the total number of C-pts
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
if (debug_flag==4) wall_time = time_getWallclockSeconds();
|
||||
|
||||
num_cpts_global = hypre_CTAlloc(int, num_procs+1);
|
||||
@ -253,7 +255,7 @@ hypre_BoomerAMGBuildInterp( hypre_ParCSRMatrix *A,
|
||||
{
|
||||
num_cpts_global[i] = num_cpts_global[i+1] - num_cpts_global[i];
|
||||
}
|
||||
|
||||
*/
|
||||
/*-----------------------------------------------------------------------
|
||||
* First Pass: Determine size of P and fill in fine_to_coarse mapping.
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
@ -185,10 +185,10 @@ hypre_BoomerAMGCreateS(hypre_ParCSRMatrix *A,
|
||||
}
|
||||
|
||||
num_sends = hypre_ParCSRCommPkgNumSends(comm_pkg);
|
||||
int_buf_data = hypre_CTAlloc(int, hypre_ParCSRCommPkgSendMapStart(comm_pkg,
|
||||
num_sends));
|
||||
if (num_functions > 1)
|
||||
{
|
||||
int_buf_data = hypre_CTAlloc(int,hypre_ParCSRCommPkgSendMapStart(comm_pkg,
|
||||
num_sends));
|
||||
index = 0;
|
||||
for (i = 0; i < num_sends; i++)
|
||||
{
|
||||
@ -202,6 +202,7 @@ hypre_BoomerAMGCreateS(hypre_ParCSRMatrix *A,
|
||||
dof_func_offd);
|
||||
|
||||
hypre_ParCSRCommHandleDestroy(comm_handle);
|
||||
hypre_TFree(int_buf_data);
|
||||
}
|
||||
|
||||
/* give S same nonzero structure as A */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user