Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix signess that bother Qt Creator
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 10 Jan 2019 13:55:14 +0000 (14:55 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 11 Jan 2019 16:36:24 +0000 (17:36 +0100)
examples/s4u/exec-ptask/s4u-exec-ptask.cpp
include/simgrid/actor.h
src/s4u/s4u_Actor.cpp

index 645afd4..c243494 100644 (file)
@@ -26,8 +26,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_energyptask, "Messages specific for this s4u ex
 static void runner()
 {
   /* Retrieve the list of all hosts as an array of hosts */
-  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::get_instance()->get_all_hosts();
-  int hosts_count = hosts.size();
+  auto hosts         = simgrid::s4u::Engine::get_instance()->get_all_hosts();
+  size_t hosts_count = hosts.size();
 
   XBT_INFO("First, build a classical parallel task, with 1 Gflop to execute on each node, "
            "and 10MB to exchange between each pair");
@@ -38,8 +38,8 @@ static void runner()
   /* ------[ test 1 ]----------------- */
   computation_amounts.assign(hosts.size(), 1e9 /*1Gflop*/);
   communication_amounts.assign(hosts.size() * hosts.size(), 0);
-  for (int i = 0; i < hosts_count; i++)
-    for (int j = i + 1; j < hosts_count; j++)
+  for (size_t i = 0; i < hosts_count; i++)
+    for (size_t j = i + 1; j < hosts_count; j++)
       communication_amounts[i * hosts_count + j] = 1e7; // 10 MB
 
   simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts);
@@ -48,8 +48,8 @@ static void runner()
   XBT_INFO("We can do the same with a timeout of one second enabled.");
   computation_amounts.assign(hosts.size(), 1e9 /*1Gflop*/);
   communication_amounts.assign(hosts.size() * hosts.size(), 0);
-  for (int i = 0; i < hosts_count; i++)
-    for (int j = i + 1; j < hosts_count; j++)
+  for (size_t i = 0; i < hosts_count; i++)
+    for (size_t j = i + 1; j < hosts_count; j++)
       communication_amounts[i * hosts_count + j] = 1e7; // 10 MB
 
   try {
@@ -70,7 +70,7 @@ static void runner()
   /* ------[ test 4 ]----------------- */
   XBT_INFO("Then, build a parallel task involving only heterogeneous computations and no communication");
   computation_amounts.resize(hosts.size());
-  for (int i = 0; i < hosts_count; i++)
+  for (size_t i = 0; i < hosts_count; i++)
     computation_amounts[i] = 5 * (i + 1) * 1e8; // 500Mflop, 1Gflop, 1.5Gflop
   communication_amounts.clear();                /* no comm */
   simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts);
index 5871dc0..5aa30d1 100644 (file)
@@ -20,8 +20,8 @@ SG_BEGIN_DECL()
     You should not access directly to the fields of the pointed structure, but always use the provided API to interact
     with actors.
  */
-XBT_PUBLIC int sg_actor_get_PID(sg_actor_t actor);
-XBT_PUBLIC int sg_actor_get_PPID(sg_actor_t actor);
+XBT_PUBLIC aid_t sg_actor_get_PID(sg_actor_t actor);
+XBT_PUBLIC aid_t sg_actor_get_PPID(sg_actor_t actor);
 XBT_PUBLIC sg_actor_t sg_actor_by_PID(aid_t pid);
 XBT_PUBLIC const char* sg_actor_get_name(sg_actor_t actor);
 XBT_PUBLIC sg_host_t sg_actor_get_host(sg_actor_t actor);
index b22b2b0..3869be9 100644 (file)
@@ -460,7 +460,7 @@ void kill() /* deprecated */
  *
  * This function checks whether @a actor is a valid pointer and return its PID (or 0 in case of problem).
  */
-int sg_actor_get_PID(sg_actor_t actor)
+aid_t sg_actor_get_PID(sg_actor_t actor)
 {
   /* Do not raise an exception here: this function is called by the logs
    * and the exceptions, so it would be called back again and again */
@@ -475,7 +475,7 @@ int sg_actor_get_PID(sg_actor_t actor)
  * This function checks whether @a actor is a valid pointer and return its parent's PID.
  * Returns -1 if the actor has not been created by any other actor.
  */
-int sg_actor_get_PPID(sg_actor_t actor)
+aid_t sg_actor_get_PPID(sg_actor_t actor)
 {
   return actor->get_ppid();
 }