17#ifndef B2COMM_SERIAL_H_
18#define B2COMM_SERIAL_H_
30#include "b2ppconfig.h"
31#include "utils/b2comm.H"
33#define B2_NOCOMM -987654
42class B2serial :
public Communicator {
44 static constexpr bool supported =
true;
48 B2serial(
int argc,
char* argv[]) : rank_(0), size_(1) {
52 explicit B2serial() =
default;
54 ~B2serial()
override{};
57 int rank()
const override {
return rank_; }
60 int NumRanks()
const override {
return size_; }
63 bool IsRoot()
const override {
return (0 == rank_); }
66 void CmdOpts(cmdline::CmdLine& cmdline)
override {
74 int GetFcomm()
const override {
return B2_NOCOMM; }
77 void Abort(
int errorcode)
override {
82 void Barrier()
override {
87 void Recv(
char buffer[], uint64_t length,
int source,
int tag)
override {
88 buffer =
static_cast<char*
>(buffers_[tag].ptr);
92 void Send(
char buffer[], uint64_t length,
int target,
int tag)
override {
93 buffers_[tag].ptr =
static_cast<void*
>(buffer);
94 buffers_[tag].num_bytes = length *
sizeof buffer[0];
99 void Bcast(uint64_t buffer[], uint64_t length,
int root = 0)
override {}
100 void Bcast(
int buffer[], uint64_t length,
int root = 0)
override {}
101 void Bcast(
double buffer[], uint64_t length,
int root = 0)
override {}
105 uint64_t ProbeByteCount(
int source,
int tag)
override {
106 return static_cast<uint64_t
>(buffers_[tag].num_bytes);
115 std::map<int, buffer_t> buffers_;
Contains the base classes for implementing Finite Elements.
Definition b2boundary_condition.H:32