1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "smpi_f2c.hpp"
8 #include "src/smpi/include/smpi_actor.hpp"
12 int mpi_status_ignore_;
13 int mpi_statuses_ignore_;
18 std::unordered_map<unsigned int, F2C*>* F2C::f2c_lookup_ = nullptr;
20 std::unordered_map<unsigned int, F2C*>::size_type F2C::num_default_handles_ = 0;
22 // Keep it non trivially-constructible, or it will break MC+smpi on FreeBSD with Clang (don't ask why)
27 if (f2c_lookup_ == nullptr)
28 f2c_lookup_ = new std::unordered_map<unsigned int, F2C*>();
30 my_f2c_id_ = f2c_id();
31 (*f2c_lookup_)[my_f2c_id_] = this;
38 if (f2c_lookup_ == nullptr) {
39 f2c_lookup_ = new std::unordered_map<unsigned int, F2C*>();
43 /* this function wasn't found, add it */
51 if (f2c_lookup_ == nullptr)
52 f2c_lookup_ = new std::unordered_map<unsigned int, F2C*>();
55 auto comm = f2c_lookup_->find(id);
56 return comm == f2c_lookup_->end() ? nullptr : comm->second;