Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions coreneuron/mpi/nrnmpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ static MPI_Group grp_net;

extern void nrnmpi_spike_initialize();

#define nrnmpidebugleak 0
#if nrnmpidebugleak
extern void nrnmpi_checkbufleak();
#endif

static int nrnmpi_under_nrncontrol_;

void nrnmpi_init(int nrnmpi_under_nrncontrol, int* pargc, char*** pargv) {
Expand Down Expand Up @@ -117,10 +112,6 @@ void nrnmpi_init(int nrnmpi_under_nrncontrol, int* pargc, char*** pargv) {
nrnmpi_numprocs = nrnmpi_numprocs_bbs = nrnmpi_numprocs_world;
nrnmpi_myid = nrnmpi_myid_bbs = nrnmpi_myid_world;
nrnmpi_spike_initialize();
/*begin instrumentation*/
#if USE_HPM
hpmInit(nrnmpi_myid_world, "mpineuron");
#endif

if (nrnmpi_myid == 0) {
#if defined(_OPENMP)
Expand All @@ -147,16 +138,10 @@ void nrnmpi_finalize(void) {

void nrnmpi_terminate() {
if (nrnmpi_use) {
#if USE_HPM
hpmTerminate(nrnmpi_myid_world);
#endif
if (nrnmpi_under_nrncontrol_) {
MPI_Finalize();
}
nrnmpi_use = false;
#if nrnmpidebugleak
nrnmpi_checkbufleak();
#endif
}
}

Expand Down
11 changes: 2 additions & 9 deletions coreneuron/utils/memory_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
#include "coreneuron/utils/memory_utils.h"
#include "coreneuron/mpi/nrnmpi.h"

#ifdef HAVE_MEMORY_H
#include <spi/include/kernel/memory.h>
#elif defined(__APPLE__) && defined(__MACH__)
#if defined(__APPLE__) && defined(__MACH__)
#include <mach/mach.h>
#elif defined HAVE_MALLOC_H
#include <malloc.h>
Expand All @@ -61,13 +59,8 @@ double nrn_mallinfo(void) {
// -ve mem usage for non-supported platforms
double mbs = -1.0;

// on bg-q use kernel/memory.h to get heap statistics
#ifdef HAVE_MEMORY_H
uint64_t heap = 0;
Kernel_GetMemorySize(KERNEL_MEMSIZE_HEAP, &heap);
mbs = heap / (1024.0 * 1024.0);
// on os x returns the current resident set size (physical memory in use)
#elif defined(__APPLE__) && defined(__MACH__)
#if defined(__APPLE__) && defined(__MACH__)
struct mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info, &infoCount) !=
Expand Down