From: SUTER Frederic Date: Fri, 3 Sep 2021 08:48:17 +0000 (+0200) Subject: chain reaction when solving implicit cast smells X-Git-Tag: v3.29~112 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2fa31273f15799271677dad1a964997bc5a057f9 chain reaction when solving implicit cast smells --- diff --git a/examples/c/exec-dvfs/exec-dvfs.c b/examples/c/exec-dvfs/exec-dvfs.c index 405d494cbb..afe68b174c 100644 --- a/examples/c/exec-dvfs/exec-dvfs.c +++ b/examples/c/exec-dvfs/exec-dvfs.c @@ -17,8 +17,8 @@ static void dvfs(int argc, char* argv[]) { sg_host_t host = sg_host_self(); - int nb = sg_host_get_nb_pstates(host); - XBT_INFO("Count of Processor states=%d", nb); + unsigned long nb = sg_host_get_nb_pstates(host); + XBT_INFO("Count of Processor states=%lu", nb); double current_peak = sg_host_get_speed(host); XBT_INFO("Current power peak=%f", current_peak); @@ -29,12 +29,12 @@ static void dvfs(int argc, char* argv[]) XBT_INFO("Task1 simulation time: %e", task_time); // Change power peak - int new_pstate = 2; - xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %d because it only provides %d pstates.", + unsigned long new_pstate = 2; + xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %lu because it only provides %lu pstates.", sg_host_get_name(host), new_pstate, nb); double peak_at = sg_host_get_pstate_speed(host, new_pstate); - XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_pstate); + XBT_INFO("Changing power peak value to %f (at index %lu)", peak_at, new_pstate); sg_host_set_pstate(host, new_pstate); @@ -48,8 +48,8 @@ static void dvfs(int argc, char* argv[]) // Verify the default pstate is set to 0 host = sg_host_by_name("MyHost2"); - int nb2 = sg_host_get_nb_pstates(host); - XBT_INFO("Count of Processor states=%d", nb2); + unsigned long nb2 = sg_host_get_nb_pstates(host); + XBT_INFO("Count of Processor states=%lu", nb2); double current_peak2 = sg_host_get_speed(host); XBT_INFO("Current power peak=%f", current_peak2); diff --git a/examples/cpp/exec-dvfs/s4u-exec-dvfs.cpp b/examples/cpp/exec-dvfs/s4u-exec-dvfs.cpp index 1f4e28be35..7df0140720 100644 --- a/examples/cpp/exec-dvfs/s4u-exec-dvfs.cpp +++ b/examples/cpp/exec-dvfs/s4u-exec-dvfs.cpp @@ -24,9 +24,9 @@ static int dvfs() XBT_INFO("Computation1 duration: %.2f", exec_time); // Change power peak - int new_pstate = 2; + unsigned long new_pstate = 2; - XBT_INFO("Changing power peak value to %f (at index %d)", host->get_pstate_speed(new_pstate), new_pstate); + XBT_INFO("Changing power peak value to %f (at index %lu)", host->get_pstate_speed(new_pstate), new_pstate); host->set_pstate(new_pstate); diff --git a/examples/smpi/energy/energy.c b/examples/smpi/energy/energy.c index 6126811d47..9a733c9669 100644 --- a/examples/smpi/energy/energy.c +++ b/examples/smpi/energy/energy.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) { int rank; - int i; + unsigned long i; char buf[1024]; int err = MPI_Init(&argc, &argv); @@ -31,13 +31,12 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - int pstates = sg_host_get_nb_pstates(sg_host_self()); + unsigned long pstates = sg_host_get_nb_pstates(sg_host_self()); char *s = buf; size_t sz = sizeof buf; - size_t x = snprintf(s, sz, - "[%.6f] [rank %d] Pstates: %d; Powers: %.0f", - MPI_Wtime(), rank, pstates, sg_host_get_pstate_speed(sg_host_self(), 0)); + size_t x = snprintf(s, sz, "[%.6f] [rank %d] Pstates: %lu; Powers: %.0f", MPI_Wtime(), rank, pstates, + sg_host_get_pstate_speed(sg_host_self(), 0)); if (x < sz) { s += x; sz -= x; @@ -55,7 +54,7 @@ int main(int argc, char *argv[]) for (i = 0; i < pstates; i++) { sg_host_set_pstate(sg_host_self(), i); - fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n", MPI_Wtime(), rank, i, + fprintf(stderr, "[%.6f] [rank %d] Current pstate: %lu; Current power: %.0f\n", MPI_Wtime(), rank, i, sg_host_get_speed(sg_host_self())); SMPI_SAMPLE_FLOPS(1e9) { diff --git a/include/simgrid/host.h b/include/simgrid/host.h index bb73630c0b..77d361712f 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -91,8 +91,8 @@ XBT_PUBLIC const char* sg_host_self_get_name(); */ XBT_PUBLIC unsigned long sg_host_get_nb_pstates(const_sg_host_t host); -XBT_PUBLIC int sg_host_get_pstate(const_sg_host_t host); -XBT_PUBLIC void sg_host_set_pstate(sg_host_t host, int pstate); +XBT_PUBLIC unsigned long sg_host_get_pstate(const_sg_host_t host); +XBT_PUBLIC void sg_host_set_pstate(sg_host_t host, unsigned long pstate); XBT_PUBLIC void sg_host_turn_on(sg_host_t host); XBT_PUBLIC void sg_host_turn_off(sg_host_t host); diff --git a/include/simgrid/kernel/routing/ClusterZone.hpp b/include/simgrid/kernel/routing/ClusterZone.hpp index 489a91ad0b..86ac407989 100644 --- a/include/simgrid/kernel/routing/ClusterZone.hpp +++ b/include/simgrid/kernel/routing/ClusterZone.hpp @@ -104,8 +104,8 @@ class XBT_PRIVATE ClusterBase : public ClusterZone { protected: using ClusterZone::ClusterZone; void set_num_links_per_node(unsigned long num) { num_links_per_node_ = num; } - resource::LinkImpl* get_uplink_from(unsigned int position) const { return private_links_.at(position).first; } - resource::LinkImpl* get_downlink_to(unsigned int position) const { return private_links_.at(position).second; } + resource::LinkImpl* get_uplink_from(unsigned long position) const { return private_links_.at(position).first; } + resource::LinkImpl* get_downlink_to(unsigned long position) const { return private_links_.at(position).second; } double get_link_latency() const { return link_lat_; } double get_link_bandwidth() const { return link_bw_; } diff --git a/include/simgrid/kernel/routing/NetPoint.hpp b/include/simgrid/kernel/routing/NetPoint.hpp index 5afa2eb364..5375856c6d 100644 --- a/include/simgrid/kernel/routing/NetPoint.hpp +++ b/include/simgrid/kernel/routing/NetPoint.hpp @@ -31,7 +31,7 @@ public: NetPoint(const std::string& name, NetPoint::Type component_type); // Our rank in the vertices_ array of the netzone that contains us. - unsigned int id() const { return id_; } + unsigned long id() const { return id_; } const std::string& get_name() const { return name_; } const char* get_cname() const { return name_.c_str(); } /** @brief the NetZone in which this NetPoint is included */ @@ -49,7 +49,7 @@ public: bool operator<(const NetPoint& rhs) const { return name_ < rhs.name_; } private: - unsigned int id_ = -1; + unsigned long id_ = -1; std::string name_; NetPoint::Type component_type_; NetZoneImpl* englobing_zone_ = nullptr; diff --git a/include/simgrid/s4u/Host.hpp b/include/simgrid/s4u/Host.hpp index 5ca3ce37b8..cd0797a68a 100644 --- a/include/simgrid/s4u/Host.hpp +++ b/include/simgrid/s4u/Host.hpp @@ -189,8 +189,8 @@ public: unsigned long get_pstate_count() const; int get_pstate() const; - double get_pstate_speed(int pstate_index) const; - Host* set_pstate(int pstate_index); + double get_pstate_speed(unsigned long pstate_index) const; + Host* set_pstate(unsigned long pstate_index); Host* set_coordinates(const std::string& coords); std::vector get_disks() const; diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index d2d706e79f..c9625fad9c 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -69,7 +69,7 @@ public: std::map>* edges); /* Add content to the netzone, at parsing time. It should be sealed afterward. */ - int add_component(kernel::routing::NetPoint* elm); /* A host, a router or a netzone, whatever */ + unsigned long add_component(kernel::routing::NetPoint* elm); /* A host, a router or a netzone, whatever */ /** * @brief Add a route between 2 netpoints diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index d096c421aa..de15eee6c6 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -113,7 +113,7 @@ static void linkContainers(simgrid::instr::Container* src, simgrid::instr::Conta XBT_DEBUG(" linkContainers %s <-> %s", src->get_cname(), dst->get_cname()); } -static void recursiveGraphExtraction(const simgrid::s4u::NetZone* netzone, simgrid::instr::Container* container, +static void recursiveGraphExtraction(const simgrid::s4u::NetZone* netzone, const simgrid::instr::Container* container, std::set>* filter) { if (not TRACE_platform_topology()) { diff --git a/src/kernel/activity/MailboxImpl.hpp b/src/kernel/activity/MailboxImpl.hpp index 2ae26317a3..61bbb4dd64 100644 --- a/src/kernel/activity/MailboxImpl.hpp +++ b/src/kernel/activity/MailboxImpl.hpp @@ -53,7 +53,7 @@ public: CommImplPtr find_matching_comm(CommImpl::Type type, bool (*match_fun)(void*, void*, CommImpl*), void* this_user_data, const CommImplPtr& my_synchro, bool done, bool remove_matching); bool is_permanent() const { return permanent_receiver_ != nullptr; } - actor::ActorImplPtr get_permanent_receiver() { return permanent_receiver_; } + actor::ActorImplPtr get_permanent_receiver() const { return permanent_receiver_; } bool empty() const { return comm_queue_.empty(); } size_t size() const { return comm_queue_.size(); } CommImplPtr front() const { return comm_queue_.front(); } diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index e7b9d2c25d..740b69af56 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -87,8 +87,8 @@ xbt_node_t DijkstraZone::node_map_search(int id) void DijkstraZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* route, double* lat) { get_route_check_params(src, dst); - int src_id = src->id(); - int dst_id = dst->id(); + unsigned long src_id = src->id(); + unsigned long dst_id = dst->id(); const_xbt_dynar_t nodes = xbt_graph_get_nodes(route_graph_.get()); diff --git a/src/kernel/routing/DragonflyZone.cpp b/src/kernel/routing/DragonflyZone.cpp index e75ea57fa2..54970fe6ef 100644 --- a/src/kernel/routing/DragonflyZone.cpp +++ b/src/kernel/routing/DragonflyZone.cpp @@ -284,7 +284,7 @@ void DragonflyZone::get_local_route(const NetPoint* src, const NetPoint* dst, Ro if (dst->is_router() || src->is_router()) return; - XBT_VERB("dragonfly getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), + XBT_VERB("dragonfly getLocalRoute from '%s'[%lu] to '%s'[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); if ((src->id() == dst->id()) && has_loopback()) { diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 27665e6623..8642501116 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -50,16 +50,16 @@ void FatTreeZone::get_local_route(const NetPoint* src, const NetPoint* dst, Rout /* Let's find the source and the destination in our internal structure */ auto searchedNode = this->compute_nodes_.find(src->id()); - xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the source %s [%u] in the fat tree", + xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the source %s [%lu] in the fat tree", src->get_cname(), src->id()); const FatTreeNode* source = searchedNode->second.get(); searchedNode = this->compute_nodes_.find(dst->id()); - xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the destination %s [%u] in the fat tree", + xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the destination %s [%lu] in the fat tree", dst->get_cname(), dst->id()); const FatTreeNode* destination = searchedNode->second.get(); - XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->get_cname(), src->id(), + XBT_VERB("Get route and latency from '%s' [%lu] to '%s' [%lu] in a fat tree", src->get_cname(), src->id(), dst->get_cname(), dst->id()); /* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */ diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 6674f5bbbf..feda4acfb5 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -39,7 +39,7 @@ void FloydZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* /* create a result route */ std::vector route_stack; - unsigned int cur = dst->id(); + unsigned long cur = dst->id(); do { int pred = predecessor_table_[src->id()][cur]; if (pred == -1) diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index dcbf949906..6ec3408a1e 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -43,7 +43,7 @@ void FullZone::do_seal() void FullZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* res, double* lat) { - XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); + XBT_DEBUG("full getLocalRoute from %s[%lu] to %s[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); const auto& e_route = routing_table_[src->id()][dst->id()]; diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index b803a4c24b..bd320c88b7 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -94,7 +94,7 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name) xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), "Refusing to create a second NetZone called '%s'.", get_cname()); netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone); - XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id()); + XBT_DEBUG("NetZone '%s' created with the id '%lu'", get_cname(), netpoint_->id()); _sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent * any further config now that we created some real content */ simgrid::s4u::NetZone::on_creation(piface_); // notify the signal diff --git a/src/kernel/routing/StarZone.cpp b/src/kernel/routing/StarZone.cpp index dad133fa9c..c30a6388d2 100644 --- a/src/kernel/routing/StarZone.cpp +++ b/src/kernel/routing/StarZone.cpp @@ -29,7 +29,7 @@ void StarZone::add_links_to_route(const std::vector& links, void StarZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* route, double* latency) { - XBT_VERB("StarZone getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), + XBT_VERB("StarZone getLocalRoute from '%s'[%lu] to '%s'[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); const auto& src_route = routes_.at(src->id()); diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index f17a7d3a8f..033df68114 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -79,7 +79,7 @@ void TorusZone::set_topology(const std::vector& dimensions) void TorusZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* route, double* lat) { - XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); + XBT_VERB("torus getLocalRoute from '%s'[%lu] to '%s'[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); if (dst->is_router() || src->is_router()) return; diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index 295660cb19..d15f52164d 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -72,7 +72,7 @@ void VivaldiZone::set_peer_link(NetPoint* netpoint, double bw_in, double bw_out) void VivaldiZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* route, double* lat) { - XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); + XBT_DEBUG("vivaldi getLocalRoute from '%s'[%lu] '%s'[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); if (src->is_netzone()) { std::string srcName = "router_" + src->get_name(); diff --git a/src/kernel/routing/WifiZone.cpp b/src/kernel/routing/WifiZone.cpp index 26df5ebc1d..2acdb0e6ce 100644 --- a/src/kernel/routing/WifiZone.cpp +++ b/src/kernel/routing/WifiZone.cpp @@ -30,7 +30,7 @@ void WifiZone::do_seal() void WifiZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* res, double* lat) { - XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); + XBT_DEBUG("full getLocalRoute from %s[%lu] to %s[%lu]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); if (wifi_link_ != nullptr) { // If src and dst are nodes, not access_point, we need to traverse the link twice diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index 9ab9a25765..cd54f15831 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -103,8 +103,8 @@ public: virtual ~Governor() = default; virtual std::string get_name() const = 0; simgrid::s4u::Host* get_host() const { return host_; } - int get_min_pstate() const { return min_pstate; } - int get_max_pstate() const { return max_pstate; } + unsigned long get_min_pstate() const { return min_pstate; } + unsigned long get_max_pstate() const { return max_pstate; } void init() { @@ -194,7 +194,7 @@ public: if (load > freq_up_threshold_) { get_host()->set_pstate(get_min_pstate()); /* Run at max. performance! */ - XBT_INFO("Load: %f > threshold: %f --> changed to pstate %i", load, freq_up_threshold_, get_min_pstate()); + XBT_INFO("Load: %f > threshold: %f --> changed to pstate %lu", load, freq_up_threshold_, get_min_pstate()); } else { /* The actual implementation uses a formula here: (See Kernel file cpufreq_ondemand.c:158) * @@ -205,12 +205,12 @@ public: */ // Load is now < freq_up_threshold; exclude pstate 0 (the fastest) // because pstate 0 can only be selected if load > freq_up_threshold_ - int new_pstate = static_cast(get_max_pstate() - load * (get_max_pstate() + 1)); + unsigned long new_pstate = static_cast(get_max_pstate() - load * (get_max_pstate() + 1)); if (new_pstate < get_min_pstate()) new_pstate = get_min_pstate(); get_host()->set_pstate(new_pstate); - XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %i", load, freq_up_threshold_, new_pstate); + XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %lu", load, freq_up_threshold_, new_pstate); } } }; @@ -238,24 +238,24 @@ public: void update() override { double load = get_host()->get_core_count() * sg_host_get_avg_load(get_host()); - int pstate = get_host()->get_pstate(); + unsigned long pstate = get_host()->get_pstate(); sg_host_load_reset(get_host()); // Only consider the period between two calls to this method! if (load > freq_up_threshold_) { if (pstate != get_min_pstate()) { get_host()->set_pstate(pstate - 1); - XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold_, + XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %lu", load, freq_up_threshold_, pstate - 1); } else { - XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load, + XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %lu", load, freq_up_threshold_, pstate); } } else if (load < freq_down_threshold_) { if (pstate != get_max_pstate()) { // Are we in the slowest pstate already? get_host()->set_pstate(pstate + 1); - XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold_, pstate + 1); + XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %lu", load, freq_down_threshold_, pstate + 1); } else { - XBT_DEBUG("Load: %f < threshold: %f -> cannot slow down even more, already in slowest pstate %d", load, + XBT_DEBUG("Load: %f < threshold: %f -> cannot slow down even more, already in slowest pstate %lu", load, freq_down_threshold_, pstate); } } @@ -345,7 +345,7 @@ public: } } - for (int pstate = get_host()->get_pstate_count() - 1; pstate >= 0; pstate--) { + for (unsigned long pstate = get_host()->get_pstate_count() - 1; pstate != 0; pstate--) { if (computed_flops / rates[task_id][pstate] <= target_time) { // We just found the pstate we want to use! best_pstate = pstate; diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index fba8ef40ed..b9a3b7a93f 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -246,7 +246,7 @@ Host* Host::set_speed_profile(kernel::profile::Profile* p) } /** @brief Get the peak processor speed (in flops/s), at the specified pstate */ -double Host::get_pstate_speed(int pstate_index) const +double Host::get_pstate_speed(unsigned long pstate_index) const { return this->pimpl_cpu_->get_pstate_peak_speed(pstate_index); } @@ -314,7 +314,7 @@ Host* Host::set_pstate_speed(const std::vector& speed_per_state) } /** @brief Set the pstate at which the host should run */ -Host* Host::set_pstate(int pstate_index) +Host* Host::set_pstate(unsigned long pstate_index) { kernel::actor::simcall([this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); }); return this; @@ -547,7 +547,7 @@ unsigned long sg_host_get_nb_pstates(const_sg_host_t host) * * See also @ref plugin_host_energy. */ -int sg_host_get_pstate(const_sg_host_t host) +unsigned long sg_host_get_pstate(const_sg_host_t host) { return host->get_pstate(); } @@ -555,7 +555,7 @@ int sg_host_get_pstate(const_sg_host_t host) * * See also @ref plugin_host_energy. */ -void sg_host_set_pstate(sg_host_t host, int pstate) +void sg_host_set_pstate(sg_host_t host, unsigned long pstate) { host->set_pstate(pstate); } diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index 086e1ad13d..a791b038c8 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -95,7 +95,7 @@ int NetZone::get_host_count() const return pimpl_->get_host_count(); } -int NetZone::add_component(kernel::routing::NetPoint* elm) +unsigned long NetZone::add_component(kernel::routing::NetPoint* elm) { return pimpl_->add_component(elm); } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index d4e7434f27..5810642ee6 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -109,7 +109,7 @@ void sg_platf_new_peer(const simgrid::kernel::routing::PeerCreationArgs* args) simgrid::kernel::routing::NetPoint* sg_platf_new_router(const std::string& name, const std::string& coords) { auto* netpoint = current_routing->create_router(name)->set_coordinates(coords); - XBT_DEBUG("Router '%s' has the id %u", netpoint->get_cname(), netpoint->id()); + XBT_DEBUG("Router '%s' has the id %lu", netpoint->get_cname(), netpoint->id()); return netpoint; } @@ -358,7 +358,7 @@ static void sg_platf_cluster_set_hostlink(simgrid::kernel::routing::StarZone* zo const simgrid::s4u::Link* link_up, const simgrid::s4u::Link* link_down, const simgrid::s4u::Link* backbone) { - XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->get_cname(), netpoint->id()); + XBT_DEBUG("Push Host_link for host '%s' to position %lu", netpoint->get_cname(), netpoint->id()); simgrid::s4u::LinkInRoute linkUp{link_up}; simgrid::s4u::LinkInRoute linkDown{link_down}; if (backbone) {