X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7e3052a90110227b0628cfde015552c1dd154563..HEAD:/src/smpi/include/smpi_actor.hpp diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index f68549e6fe..cb097d26c3 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,10 +9,10 @@ #include "private.hpp" #include "simgrid/s4u/Mailbox.hpp" #include "src/instr/instr_smpi.hpp" -#include "xbt/synchro.h" +#include "xbt/xbt_os_time.h" +#include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { class ActorExt { double simulated_ = 0 /* Used to time with simulated_start/elapsed */; @@ -28,7 +28,7 @@ class ActorExt { std::string instance_id_; bool replaying_ = false; /* is the process replaying a trace */ smpi_trace_call_location_t trace_call_loc_; - s4u::ActorPtr actor_ = nullptr; + s4u::Actor* actor_ = nullptr; smpi_privatization_region_t privatized_region_ = nullptr; #ifdef __linux__ int optind_ = 0; /*for getopt replacement */ @@ -37,55 +37,63 @@ class ActorExt { #endif std::string tracing_category_ = ""; MPI_Info info_env_; + void* bsend_buffer_ = nullptr; + int bsend_buffer_size_ = 0; #if HAVE_PAPI /** Contains hardware data as read by PAPI **/ int papi_event_set_; papi_counter_t papi_counter_data_; #endif + public: static simgrid::xbt::Extension EXTENSION_ID; - explicit ActorExt(s4u::ActorPtr actor); + explicit ActorExt(s4u::Actor* actor); ActorExt(const ActorExt&) = delete; ActorExt& operator=(const ActorExt&) = delete; ~ActorExt(); void finalize(); - int finalized(); - int initializing(); - int initialized(); + int finalized() const; + int initializing() const; + int initialized() const; + int finalizing() const; void mark_as_initialized(); + void mark_as_finalizing(); void set_replaying(bool value); - bool replaying(); - void set_tracing_category(const std::string& category) { tracing_category_ = category; } - const std::string& get_tracing_category() { return tracing_category_; } + bool replaying() const; + std::string get_instance_id() const { return instance_id_;} + void set_tracing_category(std::string_view category) { tracing_category_ = category; } + const std::string& get_tracing_category() const { return tracing_category_; } smpi_trace_call_location_t* call_location(); void set_privatized_region(smpi_privatization_region_t region); - smpi_privatization_region_t privatized_region(); - s4u::Mailbox* mailbox() { return mailbox_; } - s4u::Mailbox* mailbox_small() { return mailbox_small_; } - s4u::MutexPtr mailboxes_mutex(); + smpi_privatization_region_t privatized_region() const; + s4u::Mailbox* mailbox(); + s4u::Mailbox* mailbox_small(); + s4u::MutexPtr mailboxes_mutex() const; #if HAVE_PAPI - int papi_event_set(); + int papi_event_set() const; papi_counter_t& papi_counters(); #endif xbt_os_timer_t timer(); void simulated_start(); - double simulated_elapsed(); - MPI_Comm comm_world(); + double simulated_elapsed() const; + MPI_Comm comm_world() const; + bool comm_self_is_set() const { return (comm_self_ != MPI_COMM_NULL); }; MPI_Comm comm_self(); MPI_Comm comm_intra(); void set_comm_intra(MPI_Comm comm); void set_sampling(int s); - int sampling(); + int sampling() const; static void init(); s4u::ActorPtr get_actor(); - int get_optind(); + int get_optind() const; void set_optind(int optind); MPI_Info info_env(); + void bsend_buffer(void** buf, int* size); + int set_bsend_buffer(void* buf, int size); }; -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi #endif