Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
numa_module.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef REALM_NUMA_MODULE_H
19#define REALM_NUMA_MODULE_H
20
21#include "realm/module.h"
22
23namespace Realm {
24
25 class MemoryImpl;
26
27 namespace Numa {
28
30 friend class NumaModule;
31
32 protected:
34
36
37 public:
38 virtual void configure_from_cmdline(std::vector<std::string> &cmdline);
39
40 protected:
44 bool cfg_pin_memory = false;
45 size_t cfg_stack_size = 2 << 20;
46
47 // resources
48 std::vector<size_t> res_numa_mems; // the size of total memory of each numa domain.
49 };
50
51 // our interface to the rest of the runtime
53 protected:
55
56 public:
57 virtual ~NumaModule(void);
58
60
61 static Module *create_module(RuntimeImpl *runtime);
62
63 // do any general initialization - this is called after all configuration is
64 // complete
65 virtual void initialize(RuntimeImpl *runtime);
66
67 // create any memories provided by this module (default == do nothing)
68 // (each new MemoryImpl should use a Memory from RuntimeImpl::next_local_memory_id)
69 virtual void create_memories(RuntimeImpl *runtime);
70
71 // create any processors provided by the module (default == do nothing)
72 // (each new ProcessorImpl should use a Processor from
73 // RuntimeImpl::next_local_processor_id)
74 virtual void create_processors(RuntimeImpl *runtime);
75
76 // create any DMA channels provided by the module (default == do nothing)
77 virtual void create_dma_channels(RuntimeImpl *runtime);
78
79 // create any code translators provided by the module (default == do nothing)
80 virtual void create_code_translators(RuntimeImpl *runtime);
81
82 // clean up any common resources created by the module - this will be called
83 // after all memories/processors/etc. have been shut down and destroyed
84 virtual void cleanup(void);
85
86 public:
88
89 // "global" variables live here too
90 std::map<int, void *> numa_mem_bases;
91 std::map<int, size_t> numa_mem_sizes;
92 std::map<int, int> numa_cpu_counts;
93 std::map<int, MemoryImpl *> memories;
94 };
95
96 }; // namespace Numa
97
98}; // namespace Realm
99
100#endif
Definition module_config.h:32
Definition module.h:42
Definition numa_module.h:29
size_t cfg_stack_size
Definition numa_module.h:45
std::vector< size_t > res_numa_mems
Definition numa_module.h:48
bool cfg_pin_memory
Definition numa_module.h:44
virtual void configure_from_cmdline(std::vector< std::string > &cmdline)
ssize_t cfg_numa_nocpu_mem_size
Definition numa_module.h:42
int cfg_num_numa_cpus
Definition numa_module.h:43
size_t cfg_numa_mem_size
Definition numa_module.h:41
Definition numa_module.h:52
virtual ~NumaModule(void)
virtual void initialize(RuntimeImpl *runtime)
static Module * create_module(RuntimeImpl *runtime)
std::map< int, void * > numa_mem_bases
Definition numa_module.h:90
virtual void create_dma_channels(RuntimeImpl *runtime)
std::map< int, size_t > numa_mem_sizes
Definition numa_module.h:91
std::map< int, int > numa_cpu_counts
Definition numa_module.h:92
virtual void create_memories(RuntimeImpl *runtime)
NumaModuleConfig * config
Definition numa_module.h:87
virtual void create_code_translators(RuntimeImpl *runtime)
virtual void create_processors(RuntimeImpl *runtime)
virtual void cleanup(void)
std::map< int, MemoryImpl * > memories
Definition numa_module.h:93
static ModuleConfig * create_module_config(RuntimeImpl *runtime)
Definition runtime_impl.h:264
#define REALM_INTERNAL_API_EXTERNAL_LINKAGE
Definition compiler_support.h:218
Definition activemsg.h:38