Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
openmp_internal.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_INTERNAL_H
19#define REALM_OPENMP_INTERNAL_H
20
21#include "realm/realm_config.h"
22#include "realm/proc_impl.h"
23#include "realm/tasks.h"
24
25#include <vector>
26
27namespace Realm {
28
29#ifndef REALM_OPENMP_SYSTEM_RUNTIME
30 class ThreadPool;
31#endif
32
33 // this is nearly identical to a LocalCPUProcessor, but it asks for its thread(s)
34 // to run on the specified numa domain
35
37 public:
38 LocalOpenMPProcessor(RuntimeImpl *runtime_impl, Processor _me, int _numa_node,
39 int _num_threads, bool _fake_cpukind, CoreReservationSet &crs,
40 size_t _stack_size, bool _force_kthreads);
41 virtual ~LocalOpenMPProcessor(void);
42
43 virtual void shutdown(void);
44
45 protected:
47 public:
49
50 void lazy_init_affinity() const;
51
52 void *create_context(InternalTask *task) const override;
53 void *create_context(Task *task) const override;
54 void destroy_context(Task *task, void *context) const override;
55 void destroy_context(InternalTask *task, void *context) const override;
56
57 protected:
59 };
60
65#ifdef REALM_OPENMP_SYSTEM_RUNTIME
66 bool omp_threads_mapped;
67#else
69#endif
70 };
71
72}; // namespace Realm
73
74#endif
Definition threads.h:382
Definition threads.h:342
Definition tasks.h:181
void destroy_context(InternalTask *task, void *context) const override
void * create_context(Task *task) const override
void * create_context(InternalTask *task) const override
void destroy_context(Task *task, void *context) const override
OpenMPContextManager(LocalOpenMPProcessor *_proc)
LocalOpenMPProcessor * proc
Definition openmp_internal.h:58
Definition openmp_internal.h:36
int num_threads
Definition openmp_internal.h:62
ThreadPool * pool
Definition openmp_internal.h:68
int numa_node
Definition openmp_internal.h:61
virtual void shutdown(void)
virtual ~LocalOpenMPProcessor(void)
CoreReservation * core_rsrv
Definition openmp_internal.h:63
LocalOpenMPProcessor(RuntimeImpl *runtime_impl, Processor _me, int _numa_node, int _num_threads, bool _fake_cpukind, CoreReservationSet &crs, size_t _stack_size, bool _force_kthreads)
OpenMPContextManager ctxmgr
Definition openmp_internal.h:64
Definition proc_impl.h:141
Definition processor.h:37
Definition runtime_impl.h:264
Definition tasks.h:199
Definition tasks.h:41
Definition openmp_threadpool.h:66
Definition activemsg.h:38