1 /* Copyright (c) 2009-2010, 2012-2014. 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
12 #include "src/instr/instr_smpi.h"
14 #include "simgrid/s4u/Mailbox.hpp"
24 simgrid::s4u::MailboxPtr mailbox_;
25 simgrid::s4u::MailboxPtr mailbox_small_;
26 xbt_mutex_t mailboxes_mutex_;
27 xbt_os_timer_t timer_;
30 MPI_Comm* comm_world_;
31 void *data_; /* user data */
34 int sampling_; /* inside an SMPI_SAMPLE_ block? */
36 bool replaying_; /* is the process replaying a trace */
37 msg_bar_t finalization_barrier_;
39 smpi_trace_call_location_t trace_call_loc_;
41 /** Contains hardware data as read by PAPI **/
43 papi_counter_t papi_counter_data_;
46 explicit Process(int index);
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();
59 MPI_Comm comm_world();
60 smx_mailbox_t mailbox();
61 smx_mailbox_t mailbox_small();
62 xbt_mutex_t mailboxes_mutex();
64 int papi_event_set(void);
65 papi_counter_t& papi_counters(void);
67 xbt_os_timer_t timer();
68 void simulated_start();
69 double simulated_elapsed();
71 MPI_Comm comm_intra();
72 void set_comm_intra(MPI_Comm comm);
73 void set_sampling(int s);
75 msg_bar_t finalization_barrier();
76 void set_finalization_barrier(msg_bar_t bar);
78 void set_return_value(int val);
79 static void init(int *argc, char ***argv);