Skip to content

Commit

Permalink
Use cudaMallocManaged by default
Browse files Browse the repository at this point in the history
We should use system malloc by default for large allocations so that we
can get the CUDA memory management. The removes the VALGRIND flag.
mymalloc calls now use the cuda allocation, but tamalloc continue to use
a private cpu heap.
  • Loading branch information
sbird committed Oct 18, 2024
1 parent 77b4618 commit ee60387
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions libgadget/utils/mymalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Allocator A_MAIN[1];
* */
Allocator A_TEMP[1];

#ifdef VALGRIND
#define allocator_init allocator_malloc_init
#endif

void
tamalloc_init(void)
{
Expand Down Expand Up @@ -64,7 +60,7 @@ mymalloc_init(double MaxMemSizePerNode)
endrun(2, "Mem too small! MB/node=%g, nodespercpu = %g NTask = %d\n", MaxMemSizePerNode, nodespercpu, NTask);


if (MPIU_Any(ALLOC_ENOMEMORY == allocator_init(A_MAIN, "MAIN", n, 1, NULL), MPI_COMM_WORLD)) {
if (MPIU_Any(ALLOC_ENOMEMORY == allocator_malloc_init(A_MAIN, "MAIN", n, 1, NULL), MPI_COMM_WORLD)) {
endrun(0, "Insufficient memory for the MAIN allocator on at least one nodes."
"Requestion %td bytes. Try reducing MaxMemSizePerNode. Also check the node health status.\n", n);
}
Expand Down

0 comments on commit ee60387

Please sign in to comment.