From dea094ebb6bf0b2388db87a6e5640fb14eb8b13e Mon Sep 17 00:00:00 2001 From: Jacob Nelson Date: Tue, 15 Dec 2015 13:28:53 -0800 Subject: [PATCH] enable users to estimate memory that can be allocated in global address space --- system/Grappa.cpp | 4 ++++ system/Grappa.hpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/system/Grappa.cpp b/system/Grappa.cpp index ad89a304e..2edb5e550 100644 --- a/system/Grappa.cpp +++ b/system/Grappa.cpp @@ -756,4 +756,8 @@ namespace Grappa { return Grappa_finish(0); } + size_t symmetric_heap_size() { + return Grappa::impl::global_memory_size_bytes; + } + } // namespace Grappa diff --git a/system/Grappa.hpp b/system/Grappa.hpp index 7f2cdeb5c..992fbc831 100644 --- a/system/Grappa.hpp +++ b/system/Grappa.hpp @@ -78,7 +78,10 @@ namespace Grappa { /// Clean up Grappa. Call in SPMD context after all Grappa code /// finishes. Running Grappa code after calling finalize() is illegal. int finalize(); - + + /// Give users an idea of how much global memory they can allocate + /// on this core. This is not guaranteed to be precise. + size_t symmetric_heap_size(); #ifndef GRAPPA_NO_ABBREV /// Specify non-default behavior: stealable tasks