1 /* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef SMPI_PROCESS_HPP
8 #define SMPI_PROCESS_HPP
10 #include "private.hpp"
11 #include "simgrid/s4u/Mailbox.hpp"
12 #include "src/instr/instr_smpi.hpp"
13 #include "xbt/synchro.h"
20 double simulated_ = 0 /* Used to time with simulated_start/elapsed */;
22 char*** argv_ = nullptr;
23 simgrid::s4u::MailboxPtr mailbox_;
24 simgrid::s4u::MailboxPtr mailbox_small_;
25 xbt_mutex_t mailboxes_mutex_;
26 xbt_os_timer_t timer_;
27 MPI_Comm comm_self_ = MPI_COMM_NULL;
28 MPI_Comm comm_intra_ = MPI_COMM_NULL;
29 MPI_Comm* comm_world_ = nullptr;
30 void* data_ = nullptr; /* user data */
31 int index_ = MPI_UNDEFINED;
33 int sampling_ = 0; /* inside an SMPI_SAMPLE_ block? */
34 char* instance_id_ = nullptr;
35 bool replaying_ = false; /* is the process replaying a trace */
36 msg_bar_t finalization_barrier_;
37 int return_value_ = 0;
38 smpi_trace_call_location_t trace_call_loc_;
39 smx_actor_t process_ = nullptr;
40 smpi_privatization_region_t privatized_region_;
42 /** Contains hardware data as read by PAPI **/
44 papi_counter_t papi_counter_data_;
47 explicit Process(int index, msg_bar_t barrier);
48 void set_data(int index, int* argc, char*** argv);
52 void mark_as_initialized();
53 void set_replaying(bool value);
55 void set_user_data(void *data);
56 void *get_user_data();
57 smpi_trace_call_location_t* call_location();
58 void set_privatized_region(smpi_privatization_region_t region);
59 smpi_privatization_region_t privatized_region();
61 smx_mailbox_t mailbox();
62 smx_mailbox_t mailbox_small();
63 xbt_mutex_t 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);
77 msg_bar_t finalization_barrier();
79 void set_return_value(int val);
80 static void init(int *argc, char ***argv);
81 smx_actor_t process();