XBT_PRIVATE void TRACE_smpi_sleeping_init(int rank);
XBT_PRIVATE void TRACE_smpi_sleeping_out(int rank);
XBT_PRIVATE void TRACE_smpi_sleeping_in(int rank, double duration);
-XBT_PRIVATE void TRACE_smpi_release();
XBT_PRIVATE void TRACE_smpi_comm_in(int rank, const char* operation, simgrid::instr::TIData* extra);
XBT_PRIVATE void TRACE_smpi_comm_out(int rank);
XBT_PRIVATE void TRACE_smpi_send(int rank, int src, int dst, int tag, int size);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI");
-static std::unordered_map<std::string, std::deque<std::string>*> keys;
+static std::unordered_map<std::string, std::deque<std::string>> keys;
static std::map<std::string, std::string> smpi_colors = {{"recv", "1 0 0"},
{"irecv", "1 0.52 0.52"},
static std::string TRACE_smpi_put_key(int src, int dst, int tag, int send)
{
- // get the deque for src#dst
- std::string aux =
- std::to_string(src) + "#" + std::to_string(dst) + "#" + std::to_string(tag) + "#" + std::to_string(send);
- auto it = keys.find(aux);
- std::deque<std::string>* d;
-
- if (it == keys.end()) {
- d = new std::deque<std::string>;
- keys[aux] = d;
- } else
- d = it->second;
-
//generate the key
static unsigned long long counter = 0;
counter++;
std::to_string(src) + "_" + std::to_string(dst) + "_" + std::to_string(tag) + "_" + std::to_string(counter);
//push it
- d->push_back(key);
+ std::string aux =
+ std::to_string(src) + "#" + std::to_string(dst) + "#" + std::to_string(tag) + "#" + std::to_string(send);
+ keys[aux].push_back(key);
return key;
}
// first posted
key = TRACE_smpi_put_key(src, dst, tag, send);
} else {
- key = it->second->front();
- it->second->pop_front();
- if (it->second->empty()) {
- delete it->second;
+ key = it->second.front();
+ it->second.pop_front();
+ if (it->second.empty())
keys.erase(it);
- }
}
return key;
}
return (it == process_category.end()) ? nullptr : it->second.c_str();
}
-void TRACE_smpi_release()
-{
- for (auto const& elm : keys)
- delete elm.second;
-}
-
void TRACE_smpi_setup_container(int rank, sg_host_t host)
{
container_t father = simgrid::instr::Container::get_root();