]> AND Public Git Repository - simgrid.git/blob - src/smpi/smpi_process.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further empty smpi/private.h
[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
11 #include <xbt/base.h>
12 #include "src/instr/instr_smpi.h"
13 #include "private.h"
14 #include "simgrid/s4u/Mailbox.hpp"
15 #include "xbt/synchro.h"
16
17 namespace simgrid{
18 namespace smpi{
19
20 class Process {
21   private:
22     double simulated_ = 0 /* Used to time with simulated_start/elapsed */;
23     int* argc_        = nullptr;
24     char*** argv_     = nullptr;
25     simgrid::s4u::MailboxPtr mailbox_;
26     simgrid::s4u::MailboxPtr mailbox_small_;
27     xbt_mutex_t mailboxes_mutex_;
28     xbt_os_timer_t timer_;
29     MPI_Comm comm_self_   = MPI_COMM_NULL;
30     MPI_Comm comm_intra_  = MPI_COMM_NULL;
31     MPI_Comm* comm_world_ = nullptr;
32     void* data_           = nullptr; /* user data */
33     int index_            = MPI_UNDEFINED;
34     char state_;
35     int sampling_                   = 0; /* inside an SMPI_SAMPLE_ block? */
36     char* instance_id_              = nullptr;
37     bool replaying_                 = false; /* is the process replaying a trace */
38     msg_bar_t finalization_barrier_;
39     int return_value_ = 0;
40     smpi_trace_call_location_t trace_call_loc_;
41     smx_actor_t process_ = nullptr;
42 #if HAVE_PAPI
43   /** Contains hardware data as read by PAPI **/
44     int papi_event_set_;
45     papi_counter_t papi_counter_data_;
46 #endif
47   public:
48     explicit Process(int index, msg_bar_t barrier);
49     void set_data(int index, int* argc, char*** argv);
50     void finalize();
51     int finalized();
52     int initialized();
53     void mark_as_initialized();
54     void set_replaying(bool value);
55     bool replaying();
56     void set_user_data(void *data);
57     void *get_user_data();
58     smpi_trace_call_location_t* call_location();
59     int index();
60     MPI_Comm comm_world();
61     smx_mailbox_t mailbox();
62     smx_mailbox_t mailbox_small();
63     xbt_mutex_t mailboxes_mutex();
64 #if HAVE_PAPI
65     int papi_event_set(void);
66     papi_counter_t& papi_counters(void);
67 #endif
68     xbt_os_timer_t timer();
69     void simulated_start();
70     double simulated_elapsed();
71     MPI_Comm comm_self();
72     MPI_Comm comm_intra();
73     void set_comm_intra(MPI_Comm comm);
74     void set_sampling(int s);
75     int sampling();
76     msg_bar_t finalization_barrier();
77     int return_value();
78     void set_return_value(int val);
79     static void init(int *argc, char ***argv);
80     smx_actor_t process();
81 };
82
83
84 }
85 }
86
87 #endif