Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #200 from Takishipp/clear_fct
[simgrid.git] / src / smpi / SmpiHost.hpp
1 /* Copyright (c) 2017. 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_HOST_HPP_
7 #define SMPI_HOST_HPP_
8
9 #include "src/include/smpi/smpi_utils.hpp"
10
11 #include "simgrid/s4u/Host.hpp"
12 #include <string>
13 #include <vector>
14 #include <xbt/Extendable.hpp>
15 #include <xbt/config.hpp>
16
17 namespace simgrid {
18 namespace smpi {
19
20 void sg_smpi_host_init();
21 static void onHostDestruction(simgrid::s4u::Host& host);
22 static void onCreation(simgrid::s4u::Host& host);
23
24 class SmpiHost {
25
26   private:
27   std::vector<s_smpi_factor_t> orecv_parsed_values;
28   std::vector<s_smpi_factor_t> osend_parsed_values;
29   std::vector<s_smpi_factor_t> oisend_parsed_values;
30   simgrid::s4u::Host *host = nullptr;
31
32   public:
33   static simgrid::xbt::Extension<simgrid::s4u::Host, SmpiHost> EXTENSION_ID;
34
35   explicit SmpiHost(simgrid::s4u::Host *ptr);
36   ~SmpiHost();
37
38   double orecv(size_t size);
39   double osend(size_t size);
40   double oisend(size_t size);
41 };
42
43 }
44 }
45 #endif