std::map<simgrid::s4u::Host*, int> host_list;
public:
- explicit FrequencyChanged(simgrid::s4u::Engine& e)
+ explicit FrequencyChanged(const simgrid::s4u::Engine& e)
{
std::vector<simgrid::s4u::Host*> list = e.get_all_hosts();
for (auto& host : list) {
XBT_PUBLIC sg_size_t sg_file_write(sg_file_t fd, sg_size_t size);
XBT_PUBLIC void sg_file_close(const_sg_file_t fd);
-XBT_PUBLIC const char* sg_file_get_name(sg_file_t fd);
-XBT_PUBLIC sg_size_t sg_file_get_size(sg_file_t fd);
+XBT_PUBLIC const char* sg_file_get_name(const_sg_file_t fd);
+XBT_PUBLIC sg_size_t sg_file_get_size(const_sg_file_t fd);
XBT_PUBLIC void sg_file_dump(sg_file_t fd);
XBT_PUBLIC void* sg_file_get_data(const_sg_file_t fd);
XBT_PUBLIC void sg_file_set_data(sg_file_t fd, void* data);
XBT_PUBLIC void sg_file_seek(sg_file_t fd, sg_offset_t offset, int origin);
-XBT_PUBLIC sg_size_t sg_file_tell(sg_file_t fd);
-XBT_PUBLIC void sg_file_move(sg_file_t fd, const char* fullpath);
+XBT_PUBLIC sg_size_t sg_file_tell(const_sg_file_t fd);
+XBT_PUBLIC void sg_file_move(const_sg_file_t fd, const char* fullpath);
XBT_PUBLIC void sg_file_unlink(sg_file_t fd);
XBT_PUBLIC int sg_file_rcopy(sg_file_t file, sg_host_t host, const char* fullpath);
XBT_PUBLIC int sg_file_rmove(sg_file_t file, sg_host_t host, const char* fullpath);
xbt::signal<void(StateEvent&)> StateEvent::on_destruction;
xbt::signal<void(EntityValue&)> EntityValue::on_creation;
-static void on_container_creation_paje(Container& c)
+static void on_container_creation_paje(const Container& c)
{
double timestamp = SIMIX_get_clock();
std::stringstream stream;
tracing_file << stream.str() << std::endl;
}
-static void on_container_destruction_paje(Container& c)
+static void on_container_destruction_paje(const Container& c)
{
// trace my destruction, but not if user requests so or if the container is root
if (not trace_disable_destroy && &c != Container::get_root()) {
tracing_file << event.stream_.str() << std::endl;
}
-static void on_state_event_destruction(StateEvent& event)
+static void on_state_event_destruction(const StateEvent& event)
{
if (event.has_extra())
*tracing_files.at(event.get_container()) << event.stream_.str() << std::endl;
}
-static void on_type_creation(Type& type, e_event_type event_type)
+static void on_type_creation(const Type& type, e_event_type event_type)
{
if (event_type == PAJE_DefineLinkType)
return; // this kind of type has to be handled differently
tracing_file << stream.str() << std::endl;
}
-static void on_link_type_creation(Type& type, Type& source, Type& dest)
+static void on_link_type_creation(const Type& type, const Type& source, const Type& dest)
{
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, PAJE_DefineLinkType, trace_precision, 0.);
}
ActorImplPtr ActorImpl::create(const std::string& name, const ActorCode& code, void* data, s4u::Host* host,
- const std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor)
+ const std::unordered_map<std::string, std::string>* properties,
+ const ActorImpl* parent_actor)
{
XBT_DEBUG("Start actor %s@'%s'", name.c_str(), host->get_cname());
ActorImpl* start(const ActorCode& code);
static ActorImplPtr create(const std::string& name, const ActorCode& code, void* data, s4u::Host* host,
- const std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor);
+ const std::unordered_map<std::string, std::string>* properties,
+ const ActorImpl* parent_actor);
static ActorImplPtr attach(const std::string& name, void* data, s4u::Host* host,
const std::unordered_map<std::string, std::string>* properties);
static void detach();
/** Retrieves the path to the file
* @ingroup plugin_filesystem
*/
-const char* sg_file_get_name(sg_file_t fd)
+const char* sg_file_get_name(const_sg_file_t fd)
{
xbt_assert((fd != nullptr), "Invalid file descriptor");
return fd->get_path();
/** Retrieves the size of the file
* @ingroup plugin_filesystem
*/
-sg_size_t sg_file_get_size(sg_file_t fd)
+sg_size_t sg_file_get_size(const_sg_file_t fd)
{
return fd->size();
}
fd->seek(offset, origin);
}
-sg_size_t sg_file_tell(sg_file_t fd)
+sg_size_t sg_file_tell(const_sg_file_t fd)
{
return fd->tell();
}
-void sg_file_move(sg_file_t fd, const char* fullpath)
+void sg_file_move(const_sg_file_t fd, const char* fullpath)
{
fd->move(fullpath);
}
int get_view(MPI_Offset* disp, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep) const;
MPI_Info info();
void set_info( MPI_Info info);
- static int read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- static int read_shared(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- static int read_ordered(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- static int write(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- static int write_shared(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- static int write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
- template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)> int op_all(void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+ static int read(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ static int read_shared(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ static int read_ordered(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ static int write(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ static int write_shared(MPI_File fh, const void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ static int write_ordered(MPI_File fh, const void* buf, int count, const Datatype* datatype, MPI_Status* status);
+ template <int (*T)(MPI_File, void*, int, const Datatype*, MPI_Status*)>
+ int op_all(void* buf, int count, const Datatype* datatype, MPI_Status* status);
static int close(MPI_File *fh);
static int del(const char* filename, const Info* info);
MPI_Errhandler errhandler();
/* issue_date = {Winter 1996},*/
/* pages = {301--317},*/
/* }*/
- template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)>
- int File::op_all(void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+ template <int (*T)(MPI_File, void*, int, const Datatype*, MPI_Status*)>
+ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* status)
+ {
//get min and max offsets from everyone.
int size = comm_->size();
int rank = comm_-> rank();
public:
Group() = default;
explicit Group(int size) : size_(size), rank_to_actor_map_(size, nullptr), index_to_rank_map_(size, MPI_UNDEFINED) {}
- explicit Group(Group* origin);
+ explicit Group(const Group* origin);
void set_mapping(s4u::Actor* actor, int rank);
int rank(int index);
static int cancelled (const MPI_Status * status);
static void set_cancelled (MPI_Status * status, int flag);
static void set_elements(MPI_Status* status, const Datatype*, int count);
-static int get_count(const MPI_Status * status, MPI_Datatype datatype);
+static int get_count(const MPI_Status* status, const Datatype* datatype);
};
return (it == store.end()) ? MPI_REQUEST_NULL : it->second;
}
- void remove(MPI_Request req)
+ void remove(const Request* req)
{
if (req == MPI_REQUEST_NULL) return;
return MPI_SUCCESS;
}
- int File::read(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status)
+ int File::read(MPI_File fh, void* /*buf*/, int count, const Datatype* datatype, MPI_Status* status)
{
//get position first as we may be doing non contiguous reads and it will probably be updated badly
MPI_Offset position = fh->file_->tell();
/* address="Berlin, Heidelberg",*/
/* pages="84--93"*/
/* }*/
- int File::read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+ int File::read_shared(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status)
+ {
fh->shared_mutex_->lock();
fh->seek(*(fh->shared_file_pointer_),MPI_SEEK_SET);
read(fh, buf, count, datatype, status);
return MPI_SUCCESS;
}
- int File::read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+ int File::read_ordered(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status)
+ {
//0 needs to get the shared pointer value
MPI_Offset val;
if(fh->comm_->rank()==0){
return ret;
}
- int File::write(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status)
+ int File::write(MPI_File fh, void* /*buf*/, int count, const Datatype* datatype, MPI_Status* status)
{
//get position first as we may be doing non contiguous reads and it will probably be updated badly
MPI_Offset position = fh->file_->tell();
return MPI_SUCCESS;
}
- int File::write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+ int File::write_shared(MPI_File fh, const void* buf, int count, const Datatype* datatype, MPI_Status* status)
+ {
fh->shared_mutex_->lock();
XBT_DEBUG("Write shared on %s - Shared ptr before : %lld",fh->file_->get_path(), *(fh->shared_file_pointer_));
fh->seek(*(fh->shared_file_pointer_),MPI_SEEK_SET);
return MPI_SUCCESS;
}
- int File::write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+ int File::write_ordered(MPI_File fh, const void* buf, int count, const Datatype* datatype, MPI_Status* status)
+ {
//0 needs to get the shared pointer value
MPI_Offset val;
if(fh->comm_->rank()==0){
namespace simgrid{
namespace smpi{
-Group::Group(Group* origin)
+Group::Group(const Group* origin)
{
if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
size_ = origin->size();
return index;
}
-static int sort_accumulates(MPI_Request a, MPI_Request b)
+static int sort_accumulates(const Request* a, const Request* b)
{
return (a->tag() > b->tag());
}
status->count=count;
}
-int Status::get_count(const MPI_Status * status, MPI_Datatype datatype)
+int Status::get_count(const MPI_Status* status, const Datatype* datatype)
{
return status->count / datatype->size();
}
}
/** Kill all actors hosted here */
-void HostImpl::turn_off(kernel::actor::ActorImpl* issuer)
+void HostImpl::turn_off(const kernel::actor::ActorImpl* issuer)
{
for (auto& actor : actor_list_) {
XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
s4u::Host* get_iface() { return piface_; }
void turn_on() const;
- void turn_off(kernel::actor::ActorImpl* issuer);
+ void turn_off(const kernel::actor::ActorImpl* issuer);
std::vector<s4u::ActorPtr> get_all_actors();
size_t get_actor_count() const;
void add_actor(kernel::actor::ActorImpl* actor) { actor_list_.push_back(*actor); }