1 /* Copyright (c) 2009-2019. 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. */
10 #include "simgrid/s4u/Mailbox.hpp"
11 #include "src/instr/instr_smpi.hpp"
12 #include "xbt/synchro.h"
19 double simulated_ = 0 /* Used to time with simulated_start/elapsed */;
20 s4u::Mailbox* mailbox_;
21 s4u::Mailbox* mailbox_small_;
22 s4u::MutexPtr mailboxes_mutex_;
23 xbt_os_timer_t timer_;
24 MPI_Comm comm_self_ = MPI_COMM_NULL;
25 MPI_Comm comm_intra_ = MPI_COMM_NULL;
26 MPI_Comm* comm_world_ = nullptr;
27 SmpiProcessState state_;
28 int sampling_ = 0; /* inside an SMPI_SAMPLE_ block? */
29 std::string instance_id_;
30 bool replaying_ = false; /* is the process replaying a trace */
31 s4u::Barrier* finalization_barrier_;
32 smpi_trace_call_location_t trace_call_loc_;
33 s4u::ActorPtr actor_ = nullptr;
34 smpi_privatization_region_t privatized_region_ = nullptr;
35 int optind = 0; /*for getopt replacement */
36 std::string tracing_category_ = "";
39 /** Contains hardware data as read by PAPI **/
41 papi_counter_t papi_counter_data_;
44 explicit ActorExt(simgrid::s4u::ActorPtr actor, simgrid::s4u::Barrier* barrier);
45 ActorExt(const ActorExt&) = delete;
46 ActorExt& operator=(const ActorExt&) = delete;
48 void set_data(const char* instance_id);
53 void mark_as_initialized();
54 void set_replaying(bool value);
56 void set_tracing_category(const std::string& category) { tracing_category_ = category; }
57 const std::string& get_tracing_category() { return tracing_category_; }
58 smpi_trace_call_location_t* call_location();
59 void set_privatized_region(smpi_privatization_region_t region);
60 smpi_privatization_region_t privatized_region();
61 s4u::Mailbox* mailbox() { return mailbox_; }
62 s4u::Mailbox* mailbox_small() { return mailbox_small_; }
63 s4u::MutexPtr mailboxes_mutex();
66 papi_counter_t& papi_counters();
68 xbt_os_timer_t timer();
69 void simulated_start();
70 double simulated_elapsed();
71 MPI_Comm comm_world();
73 MPI_Comm comm_intra();
74 void set_comm_intra(MPI_Comm comm);
75 void set_sampling(int s);
78 simgrid::s4u::ActorPtr get_actor();
80 void set_optind(int optind);
84 } // namespace simgrid