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

Method PrintUsage

Src/Base/AMReX_Arena.cpp:602–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void
603Arena::PrintUsage (bool print_max_usage)
604{
605#ifdef AMREX_USE_GPU
606 const int IOProc = ParallelDescriptor::IOProcessorNumber();
607 {
608 Long min_megabytes = Gpu::Device::totalGlobalMem() / (1024*1024);
609 Long max_megabytes = min_megabytes;
610 ParallelDescriptor::ReduceLongMin(min_megabytes, IOProc);
611 ParallelDescriptor::ReduceLongMax(max_megabytes, IOProc);
612#ifdef AMREX_USE_MPI
613 amrex::Print() << "Total GPU global memory (MB) spread across MPI: ["
614 << min_megabytes << " ... " << max_megabytes << "]\n";
615#else
616 amrex::Print() << "Total GPU global memory (MB): " << min_megabytes << "\n";
617#endif
618 }
619 {
620 Long min_megabytes = Gpu::Device::freeMemAvailable() / (1024*1024);
621 Long max_megabytes = min_megabytes;
622 ParallelDescriptor::ReduceLongMin(min_megabytes, IOProc);
623 ParallelDescriptor::ReduceLongMax(max_megabytes, IOProc);
624#ifdef AMREX_USE_MPI
625 amrex::Print() << "Free GPU global memory (MB) spread across MPI: ["
626 << min_megabytes << " ... " << max_megabytes << "]\n";
627#else
628 amrex::Print() << "Free GPU global memory (MB): " << min_megabytes << "\n";
629#endif
630 }
631#endif
632 if (The_Arena()) {
633 auto* p = dynamic_cast<CArena*>(The_Arena());
634 if (p) {
635 p->PrintUsage("The Arena", print_max_usage);
636 }
637 }
638 if (The_Device_Arena() && The_Device_Arena() != The_Arena()) {
639 auto* p = dynamic_cast<CArena*>(The_Device_Arena());
640 if (p) {
641 p->PrintUsage("The Device Arena", print_max_usage);
642 }
643 }
644 if (The_Managed_Arena() && The_Managed_Arena() != The_Arena()) {
645 auto* p = dynamic_cast<CArena*>(The_Managed_Arena());
646 if (p) {
647 p->PrintUsage("The Managed Arena", print_max_usage);
648 }
649 }
650 if (The_Pinned_Arena()) {
651 auto* p = dynamic_cast<CArena*>(The_Pinned_Arena());
652 if (p) {
653 p->PrintUsage("The Pinned Arena", print_max_usage);
654 }
655 }
656 if (The_Comms_Arena() && The_Comms_Arena() != The_Device_Arena()
657 && The_Comms_Arena() != The_Pinned_Arena()) {
658 auto* p = dynamic_cast<CArena*>(The_Comms_Arena());
659 if (p) {

Callers 1

PrintUsageToStreamMethod · 0.45

Calls 9

IOProcessorNumberFunction · 0.85
ReduceLongMinFunction · 0.85
ReduceLongMaxFunction · 0.85
PrintClass · 0.85
The_ArenaFunction · 0.85
The_Device_ArenaFunction · 0.85
The_Managed_ArenaFunction · 0.85
The_Pinned_ArenaFunction · 0.85
The_Comms_ArenaFunction · 0.85

Tested by

no test coverage detected