MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / push

Method push

src/sys/msg_stack.cxx:38–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37#if BOUT_USE_MSGSTACK
38int MsgStack::push(std::string message) {
39
40#if BOUT_USE_OPENMP
41 // This is temporary fix: no messages from OMP regions if there's
42 // more than one thread
43 if (omp_get_num_threads() > 1) {
44 return position;
45 }
46#endif
47
48 if (position >= stack.size()) {
49 stack.push_back(std::move(message));
50 } else {
51 stack[position] = message;
52 }
53
54 return position++;
55}
56
57void MsgStack::pop() {
58 if (position <= 0) {

Callers 1

TESTFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64