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