Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the option to print origin of a failing handle.
[simgrid.git] / src / smpi / include / smpi_utils.hpp
1 /* Copyright (c) 2016-2021. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SMPI_UTILS_HPP
7 #define SMPI_UTILS_HPP
8 #include "xbt/base.h"
9 #include <cstddef>
10 #include <string>
11 #include <vector>
12 #include "smpi_f2c.hpp"
13
14 // Methods used to parse and store the values for timing injections in smpi
15 struct s_smpi_factor_t {
16   size_t factor = 0;
17   std::vector<double> values;
18 };
19
20
21 namespace simgrid {
22 namespace smpi {
23 namespace utils {
24   extern F2C* current_handle;
25   XBT_PUBLIC std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string);
26   XBT_PUBLIC void add_benched_time(double time);
27   XBT_PUBLIC void account_malloc_size(size_t size, const char* file, int line);
28   XBT_PUBLIC void account_shared_size(size_t size);
29   XBT_PUBLIC void print_time_analysis(double time);
30   XBT_PUBLIC void print_memory_analysis();
31   XBT_PUBLIC void print_current_handle();
32   static void set_current_handle(F2C* handle){current_handle=handle;}
33
34 }
35 }
36 }
37
38 #endif