/* #include */ #include #include "memoryusage.h" #include "common_c.h" #include "mpi.h" #ifdef __bgp__ // For Intrepid/Challenger #include #elif __bgq__ // For Mira/Cetus #include #endif void initmemstat( void) { memstats.rheap = 0.0; memstats.rheapavail = 0.0; memstats.rstack = 0.0; memstats.rstackavail = 0.0; memstats.rshared = 0.0; memstats.rpersist = 0.0; memstats.rguard = 0.0; memstats.rmmap = 0.0; } void printmeminfo( const char *msg) { #ifdef __bgp__ unsigned int heapnew, heapavailnew, stacknew, stackavailnew; // unsigned int sharednew, persistnew, guardnew, mmapnew; #elif __bgq__ uint64_t heapnew, heapavailnew, stacknew, stackavailnew; // uint64_t sharednew, persistnew, guardnew, mmapnew; #endif #ifdef __bgp__ // copy the same lines #elif __bgq__ // Print info for the following ranks if (workfc.myrank == 0 || workfc.myrank == (workfc.numpe/2) || workfc.myrank == (workfc.numpe-1) ) { //for (int irank=0 ; irank numpe } // if irank == chosen ranks #endif }