Skip to content

Commit

Permalink
expose meminfo
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypanyala committed Oct 18, 2024
1 parent f0e1c18 commit 158476b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/tamm/execution_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ class Distribution_SimpleRoundRobin;
* default to false?
*/
class RuntimeEngine;

struct meminfo {
size_t gpu_mem_per_device; // single gpu mem per rank (GiB)
size_t gpu_mem_per_node; // total gpu mem per node (GiB)
size_t total_gpu_mem; // total gpu mem across all nodes (GiB)
size_t cpu_mem_per_node; // cpu mem on single node (GiB)
size_t total_cpu_mem; // total cpu mem across all nodes (GiB)
std::string cpu_name; // cpu name
std::string gpu_name; // gpu name
};

class ExecutionContext {
public:
ExecutionContext(): ac_{IndexedAC{nullptr, 0}} {
Expand Down Expand Up @@ -322,16 +333,6 @@ class ExecutionContext {
int ppn() const { return ranks_pn_; }
int gpn() const { return gpus_pn_; }

struct meminfo {
size_t gpu_mem_per_device; // single gpu mem per rank (GiB)
size_t gpu_mem_per_node; // total gpu mem per node (GiB)
size_t total_gpu_mem; // total gpu mem across all nodes (GiB)
size_t cpu_mem_per_node; // cpu mem on single node (GiB)
size_t total_cpu_mem; // total cpu mem across all nodes (GiB)
std::string cpu_name; // cpu name
std::string gpu_name; // gpu name
};

meminfo mem_info() const { return minfo_; }

void print_mem_info() {
Expand Down

0 comments on commit 158476b

Please sign in to comment.