25 #define allocator_init allocator_malloc_init
31 int Nt = omp_get_max_threads();
33 MPI_Comm_size(MPI_COMM_WORLD, &
NTask);
36 size_t n = 4096 * 1024 + 128 *
NTask + 128 * Nt *
NTask + 512 * Nt;
38 message(0,
"Reserving %td bytes per rank for TEMP memory allocator. \n", n);
41 endrun(0,
"Insufficient memory for the TEMP allocator on at least one nodes."
42 "Requestion %td bytes. Try reducing MaxMemSizePerNode. Also check the node health status.\n", n);
53 MPI_Comm comm = MPI_COMM_WORLD;
57 MPI_Comm_size(comm, &
NTask);
59 double nodespercpu = (1.0 * Nhost) / (1.0 *
NTask);
60 size_t n = 1.0 * MaxMemSizePerNode * nodespercpu * 1024. * 1024.;
61 message(0,
"Nhost = %d\n", Nhost);
62 message(0,
"Reserving %td bytes per rank for MAIN memory allocator. \n", n);
64 endrun(2,
"Mem too small! MB/node=%g, nodespercpu = %g NTask = %d\n", MaxMemSizePerNode, nodespercpu,
NTask);
68 endrun(0,
"Insufficient memory for the MAIN allocator on at least one nodes."
69 "Requestion %td bytes. Try reducing MaxMemSizePerNode. Also check the node health status.\n", n);
81 MPI_Comm comm = MPI_COMM_WORLD;
85 MPI_Comm_size(comm, &
NTask);
100 message(1,
"Peak Memory usage induced by %s\n", buf);
void message(int where, const char *fmt,...)
void endrun(int where, const char *fmt,...)
int allocator_init(Allocator *alloc, const char *name, const size_t request_size, const int zero, Allocator *parent)
void allocator_print(Allocator *alloc)
size_t allocator_get_used_size(Allocator *alloc, int dir)
static size_t highest_memory_usage
void report_detailed_memory_usage(const char *label, const char *fmt,...)
void mymalloc_init(double MaxMemSizePerNode)
char * fastpm_strdup_vprintf(const char *fmt, va_list va)
int cluster_get_num_hosts(void)
int MPIU_Any(int condition, MPI_Comm comm)