Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this writeActions stuff was never used
[simgrid.git] / src / smpi / smpi_process.hpp
1 /* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SMPI_PROCESS_HPP
8 #define SMPI_PROCESS_HPP
9
10 #include "src/instr/instr_smpi.h"
11 #include "simgrid/s4u/Mailbox.hpp"
12 #include "xbt/synchro.h"
13
14 namespace simgrid{
15 namespace smpi{
16
17 class Process {
18   private:
19     double simulated_ = 0 /* Used to time with simulated_start/elapsed */;
20     int* argc_        = nullptr;
21     char*** argv_     = nullptr;
22     simgrid::s4u::MailboxPtr mailbox_;
23     simgrid::s4u::MailboxPtr mailbox_small_;
24     xbt_mutex_t mailboxes_mutex_;
25     xbt_os_timer_t timer_;
26     MPI_Comm comm_self_   = MPI_COMM_NULL;
27     MPI_Comm comm_intra_  = MPI_COMM_NULL;
28     MPI_Comm* comm_world_ = nullptr;
29     void* data_           = nullptr; /* user data */
30     int index_            = MPI_UNDEFINED;
31     char state_;
32     int sampling_                   = 0; /* inside an SMPI_SAMPLE_ block? */
33     char* instance_id_              = nullptr;
34     bool replaying_                 = false; /* is the process replaying a trace */
35     msg_bar_t finalization_barrier_;
36     int return_value_ = 0;
37     smpi_trace_call_location_t trace_call_loc_;
38     smx_actor_t process_ = nullptr;
39 #if HAVE_PAPI
40   /** Contains hardware data as read by PAPI **/
41     int papi_event_set_;
42     papi_counter_t papi_counter_data_;
43 #endif
44   public:
45     explicit Process(int index, msg_bar_t barrier);
46     void set_data(int index, int* argc, char*** argv);
47     void finalize();
48     int finalized();
49     int initialized();
50     void mark_as_initialized();
51     void set_replaying(bool value);
52     bool replaying();
53     void set_user_data(void *data);
54     void *get_user_data();
55     smpi_trace_call_location_t* call_location();
56     int index();
57     MPI_Comm comm_world();
58     smx_mailbox_t mailbox();
59     smx_mailbox_t mailbox_small();
60     xbt_mutex_t mailboxes_mutex();
61 #if HAVE_PAPI
62     int papi_event_set();
63     papi_counter_t& papi_counters();
64 #endif
65     xbt_os_timer_t timer();
66     void simulated_start();
67     double simulated_elapsed();
68     MPI_Comm comm_self();
69     MPI_Comm comm_intra();
70     void set_comm_intra(MPI_Comm comm);
71     void set_sampling(int s);
72     int sampling();
73     msg_bar_t finalization_barrier();
74     int return_value();
75     void set_return_value(int val);
76     static void init(int *argc, char ***argv);
77     smx_actor_t process();
78 };
79
80
81 }
82 }
83
84 #endif