Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from Alpine-DAV/fix_mem_leak
Browse files Browse the repository at this point in the history
fix memory leak
  • Loading branch information
mclarsen authored Apr 13, 2021
2 parents 22973a7 + 1e19e50 commit 2da84d7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
19 changes: 17 additions & 2 deletions src/apcomp/internal/DirectSendCompositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,15 @@ DirectSendCompositor::CompositeVolume(apcompdiy::mpi::communicator &diy_comm,
// so we isolate them within separate blocks
//
{
apcompdiy::Master master(diy_comm, num_threads);
apcompdiy::Master master(
diy_comm,
num_threads,
-1, 0,
[](void * b){
MultiImageBlock *block = reinterpret_cast<MultiImageBlock*>(b);
delete block;
});

// create an assigner with one block per rank
apcompdiy::ContiguousAssigner assigner(num_blocks, num_blocks);

Expand All @@ -149,7 +157,14 @@ DirectSendCompositor::CompositeVolume(apcompdiy::mpi::communicator &diy_comm,
}

{
apcompdiy::Master master(diy_comm, num_threads);
apcompdiy::Master master(
diy_comm,
num_threads,
-1, 0,
[](void * b){
ImageBlock<Image> *block = reinterpret_cast<ImageBlock<Image>*>(b);
delete block;
});
apcompdiy::ContiguousAssigner assigner(num_blocks, num_blocks);

const int dims = 2;
Expand Down
9 changes: 8 additions & 1 deletion src/apcomp/internal/RadixKCompositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,14 @@ RadixKCompositor::CompositeImpl(apcompdiy::mpi::communicator &diy_comm, ImageTyp
const int num_blocks = diy_comm.size();
const int magic_k = 8;

apcompdiy::Master master(diy_comm, num_threads);
//apcompdiy::Master master(diy_comm, num_threads);
apcompdiy::Master master(
diy_comm, num_threads,
-1, 0,
[](void * b){
ImageBlock<ImageType> *block = reinterpret_cast<ImageBlock<ImageType>*>(b);
delete block;
});

// create an assigner with one block per rank
apcompdiy::ContiguousAssigner assigner(num_blocks, num_blocks);
Expand Down

0 comments on commit 2da84d7

Please sign in to comment.