Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
openmp_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_OPENMP_MODULE_H
19#define REALM_OPENMP_MODULE_H
20
21#include "realm/module.h"
22
23namespace Realm {
24
25 namespace OpenMP {
26
28 friend class OpenMPModule;
29
30 protected:
32
33 public:
34 virtual void configure_from_cmdline(std::vector<std::string> &cmdline);
35
36 protected:
39 bool cfg_use_numa = true;
40 bool cfg_fake_cpukind = false;
41 size_t cfg_stack_size = 2 << 20;
42 };
43
44 // our interface to the rest of the runtime
45 class OpenMPModule : public Module {
46 protected:
48
49 public:
50 virtual ~OpenMPModule(void);
51
53
54 static Module *create_module(RuntimeImpl *runtime);
55
56 // do any general initialization - this is called after all configuration is
57 // complete
58 virtual void initialize(RuntimeImpl *runtime);
59
60 // create any memories provided by this module (default == do nothing)
61 // (each new MemoryImpl should use a Memory from RuntimeImpl::next_local_memory_id)
62 // virtual void create_memories(RuntimeImpl *runtime);
63
64 // create any processors provided by the module (default == do nothing)
65 // (each new ProcessorImpl should use a Processor from
66 // RuntimeImpl::next_local_processor_id)
67 virtual void create_processors(RuntimeImpl *runtime);
68
69 // create any DMA channels provided by the module (default == do nothing)
70 // virtual void create_dma_channels(RuntimeImpl *runtime);
71
72 // create any code translators provided by the module (default == do nothing)
73 // virtual void create_code_translators(RuntimeImpl *runtime);
74
75 // clean up any common resources created by the module - this will be called
76 // after all memories/processors/etc. have been shut down and destroyed
77 virtual void cleanup(void);
78
79 public:
80 std::vector<int> active_numa_domains;
81
82 protected:
84 };
85
86 }; // namespace OpenMP
87
88}; // namespace Realm
89
90#endif
Definition module_config.h:32
Definition module.h:42
Definition openmp_module.h:27
virtual void configure_from_cmdline(std::vector< std::string > &cmdline)
int cfg_num_openmp_cpus
Definition openmp_module.h:37
size_t cfg_stack_size
Definition openmp_module.h:41
bool cfg_use_numa
Definition openmp_module.h:39
int cfg_num_threads_per_cpu
Definition openmp_module.h:38
bool cfg_fake_cpukind
Definition openmp_module.h:40
Definition openmp_module.h:45
virtual void create_processors(RuntimeImpl *runtime)
virtual void initialize(RuntimeImpl *runtime)
virtual void cleanup(void)
static ModuleConfig * create_module_config(RuntimeImpl *runtime)
static Module * create_module(RuntimeImpl *runtime)
OpenMPModuleConfig * config
Definition openmp_module.h:83
std::vector< int > active_numa_domains
Definition openmp_module.h:80
Definition runtime_impl.h:264
Definition activemsg.h:38