ALP User Documentation 0.7.0
Algebraic Programming User Documentation
spmd.hpp
Go to the documentation of this file.
1
2/*
3 * Copyright 2021 Huawei Technologies Co., Ltd.
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
27#ifndef _H_GRB_BASE_SPMD
28#define _H_GRB_BASE_SPMD
29
30#include <cstddef> //size_t
31
32#include <stdint.h> // SIZE_MAX
33
35#include <graphblas/rc.hpp>
36
37#include "config.hpp"
38
39
40namespace grb {
41
50 template< Backend implementation >
51 class spmd {
52
53 public:
54
56 static inline size_t nprocs() noexcept {
57 return 0;
58 }
59
61 static inline size_t pid() noexcept {
62 return SIZE_MAX;
63 }
64
91 static enum RC sync( const size_t msgs_in = 0, const size_t msgs_out = 0 ) noexcept {
92 (void) msgs_in;
93 (void) msgs_out;
94 return PANIC;
95 }
96
97 }; // end class ``spmd''
98
99} // namespace grb
100
101#endif // end _H_GRB_BASE_SPMD
102
This file contains a register of all backends that are either implemented, under implementation,...
For backends that support multiple user processes this class defines some basic primitives to support...
Definition: spmd.hpp:51
static size_t pid() noexcept
Definition: spmd.hpp:61
static size_t nprocs() noexcept
Definition: spmd.hpp:56
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:452
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ PANIC
Generic fatal error code.
Definition: rc.hpp:68
Defines the ALP error codes.
Contains the configuration parameters for the reference and reference_omp backends.