MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / PrintUsageToStream

Method PrintUsageToStream

Src/Base/AMReX_Arena.cpp:665–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665void
666Arena::PrintUsageToStream (std::ostream& os, std::string const& space)
667{
668#ifdef AMREX_USE_GPU
669 Long megabytes = Gpu::Device::totalGlobalMem() / (1024*1024);
670 os << space << "Total GPU global memory (MB): " << megabytes << "\n";
671
672 megabytes = Gpu::Device::freeMemAvailable() / (1024*1024);
673 os << space << "Free GPU global memory (MB): " << megabytes << "\n";
674#endif
675
676 if (The_Arena()) {
677 auto* p = dynamic_cast<CArena*>(The_Arena());
678 if (p) {
679 p->PrintUsage(os, "The Arena", space);
680 }
681 }
682 if (The_Device_Arena() && The_Device_Arena() != The_Arena()) {
683 auto* p = dynamic_cast<CArena*>(The_Device_Arena());
684 if (p) {
685 p->PrintUsage(os, "The Device Arena", space);
686 }
687 }
688 if (The_Managed_Arena() && The_Managed_Arena() != The_Arena()) {
689 auto* p = dynamic_cast<CArena*>(The_Managed_Arena());
690 if (p) {
691 p->PrintUsage(os, "The Managed Arena", space);
692 }
693 }
694 if (The_Pinned_Arena()) {
695 auto* p = dynamic_cast<CArena*>(The_Pinned_Arena());
696 if (p) {
697 p->PrintUsage(os, "The Pinned Arena", space);
698 }
699 }
700 if (The_Comms_Arena() && The_Comms_Arena() != The_Device_Arena()
701 && The_Comms_Arena() != The_Pinned_Arena()) {
702 auto* p = dynamic_cast<CArena*>(The_Comms_Arena());
703 if (p) {
704 p->PrintUsage(os, "The Comms Arena", space);
705 }
706 }
707}
708
709void
710Arena::PrintUsageToFiles (const std::string& filename, const std::string& message)

Callers

nothing calls this directly

Calls 6

The_ArenaFunction · 0.85
The_Device_ArenaFunction · 0.85
The_Managed_ArenaFunction · 0.85
The_Pinned_ArenaFunction · 0.85
The_Comms_ArenaFunction · 0.85
PrintUsageMethod · 0.45

Tested by

no test coverage detected