Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Useless casts.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Jul 2019 21:34:36 +0000 (23:34 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Jul 2019 22:08:34 +0000 (00:08 +0200)
examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_task.cpp
src/plugins/host_dvfs.cpp
src/plugins/host_energy.cpp
src/plugins/host_load.cpp
src/smpi/bindings/smpi_pmpi_file.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/internals/smpi_bench.cpp
src/surf/network_ib.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp

index a1e5f86..27ecdda 100644 (file)
@@ -35,9 +35,8 @@ static void execute_load_test()
            "far: %.2E, average load as reported by the HostLoad plugin: %.5f (should be %.5f)",
            simgrid::s4u::Engine::get_clock() - start, host->get_speed(), speed, sg_host_get_computed_flops(host),
            sg_host_get_avg_load(host),
            "far: %.2E, average load as reported by the HostLoad plugin: %.5f (should be %.5f)",
            simgrid::s4u::Engine::get_clock() - start, host->get_speed(), speed, sg_host_get_computed_flops(host),
            sg_host_get_avg_load(host),
-           static_cast<double>(200E6) /
-               (10.5 * speed * host->get_core_count() +
-                (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->get_speed() * host->get_core_count()));
+           200E6 / (10.5 * speed * host->get_core_count() +
+                    (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->get_speed() * host->get_core_count()));
 
   // ========= Change power peak =========
   int pstate = 1;
 
   // ========= Change power peak =========
   int pstate = 1;
index 2781ac3..7de0a98 100644 (file)
@@ -109,7 +109,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, job
   }
 
   msg_error_t status;
   }
 
   msg_error_t status;
-  status = MSG_comm_wait(comm,static_cast<double>(timeout));
+  status = MSG_comm_wait(comm, timeout);
   env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
   if (status == MSG_OK) {
     jcomm_bind_task(env,jcomm);
   env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
   if (status == MSG_OK) {
     jcomm_bind_task(env,jcomm);
@@ -145,7 +145,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitAll(JNIEnv *env, jclass cls
   if (not comms)
     return;
 
   if (not comms)
     return;
 
-  MSG_comm_waitall(comms, count, static_cast<double>(timeout));
+  MSG_comm_waitall(comms, count, timeout);
   delete[] comms;
 }
 JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms)
   delete[] comms;
 }
 JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms)
index ede08bb..5c28035 100644 (file)
@@ -61,7 +61,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create(JNIEnv * env, jobject jt
 
   if (jname)
     name = env->GetStringUTFChars(jname, 0);
 
   if (jname)
     name = env->GetStringUTFChars(jname, 0);
-  msg_task_t task = MSG_task_create(name, static_cast<double>(jflopsAmount), static_cast<double>(jbytesAmount), jtask);
+  msg_task_t task = MSG_task_create(name, jflopsAmount, jbytesAmount, jtask);
   if (jname)
     env->ReleaseStringUTFChars(jname, name);
 
   if (jname)
     env->ReleaseStringUTFChars(jname, name);
 
@@ -73,7 +73,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jo
                                          jobjectArray jhosts, jdoubleArray jcomputeDurations_arg,
                                          jdoubleArray jmessageSizes_arg)
 {
                                          jobjectArray jhosts, jdoubleArray jcomputeDurations_arg,
                                          jdoubleArray jmessageSizes_arg)
 {
-  int host_count = static_cast<int>(env->GetArrayLength(jhosts));
+  int host_count = env->GetArrayLength(jhosts);
 
   jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, 0);
   msg_host_t* hosts          = new msg_host_t[host_count];
 
   jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, 0);
   msg_host_t* hosts          = new msg_host_t[host_count];
@@ -234,7 +234,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority(JNIEnv * env, jobje
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
-  MSG_task_set_priority(task, static_cast<double>(priority));
+  MSG_task_set_priority(task, priority);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jobject jtask, jdouble computationAmount)
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jobject jtask, jdouble computationAmount)
@@ -245,7 +245,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jo
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
-  MSG_task_set_flops_amount(task, static_cast<double>(computationAmount));
+  MSG_task_set_flops_amount(task, computationAmount);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jobject jtask, jdouble dataSize)
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jobject jtask, jdouble dataSize)
@@ -257,7 +257,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jo
     return;
   }
   env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
     return;
   }
   env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
-  MSG_task_set_bytes_amount(task, static_cast<double>(dataSize));
+  MSG_task_set_bytes_amount(task, dataSize);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobject jtask, jstring jalias,
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobject jtask, jstring jalias,
@@ -273,8 +273,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobjec
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
 
   const char* alias = env->GetStringUTFChars(jalias, 0);
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
 
   const char* alias = env->GetStringUTFChars(jalias, 0);
-  msg_error_t res =
-      MSG_task_send_with_timeout_bounded(task, alias, static_cast<double>(jtimeout), static_cast<double>(maxrate));
+  msg_error_t res   = MSG_task_send_with_timeout_bounded(task, alias, jtimeout, maxrate);
   env->ReleaseStringUTFChars(jalias, alias);
 
   if (res != MSG_OK)
   env->ReleaseStringUTFChars(jalias, alias);
 
   if (res != MSG_OK)
@@ -340,8 +339,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env,
   msg_task_t task = nullptr;
 
   const char *alias = env->GetStringUTFChars(jalias, 0);
   msg_task_t task = nullptr;
 
   const char *alias = env->GetStringUTFChars(jalias, 0);
-  msg_error_t res   = MSG_task_receive_ext_bounded(&task, alias, static_cast<double>(jtimeout), /*host*/ nullptr,
-                                                 static_cast<double>(rate));
+  msg_error_t res   = MSG_task_receive_ext_bounded(&task, alias, jtimeout, /*host*/ nullptr, rate);
   if (env->ExceptionOccurred())
     return nullptr;
   if (res != MSG_OK) {
   if (env->ExceptionOccurred())
     return nullptr;
   if (res != MSG_OK) {
@@ -377,7 +375,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, j
   }
 
   const char* mailbox = env->GetStringUTFChars(jmailbox, 0);
   }
 
   const char* mailbox = env->GetStringUTFChars(jmailbox, 0);
-  msg_comm_t comm     = MSG_task_irecv_bounded(task, mailbox, static_cast<double>(rate));
+  msg_comm_t comm     = MSG_task_irecv_bounded(task, mailbox, rate);
   env->ReleaseStringUTFChars(jmailbox, mailbox);
 
   env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
   env->ReleaseStringUTFChars(jmailbox, mailbox);
 
   env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
@@ -517,7 +515,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobj
 
   /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
 
   /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
-  MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend,static_cast<double>(maxrate));
+  MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend, maxrate);
 
   env->ReleaseStringUTFChars(jalias, alias);
 }
 
   env->ReleaseStringUTFChars(jalias, alias);
 }
index d94c836..0290509 100644 (file)
@@ -336,9 +336,8 @@ public:
   {
     double computed_flops = sg_host_get_computed_flops(get_host()) - comp_counter;
     double target_time    = (simgrid::s4u::Engine::get_clock() - start_time);
   {
     double computed_flops = sg_host_get_computed_flops(get_host()) - comp_counter;
     double target_time    = (simgrid::s4u::Engine::get_clock() - start_time);
-    target_time =
-        target_time *
-        static_cast<double>(99.0 / 100.0); // FIXME We account for t_copy arbitrarily with 1% -- this needs to be fixed
+    target_time           = target_time * 99.0 / 100.0; // FIXME We account for t_copy arbitrarily with 1%
+                                                        // -- this needs to be fixed
 
     bool is_initialized         = rates[task_id][best_pstate] != 0;
     rates[task_id][best_pstate] = computed_flops / comp_timer;
 
     bool is_initialized         = rates[task_id][best_pstate] != 0;
     rates[task_id][best_pstate] = computed_flops / comp_timer;
index fb960ad..d85f013 100644 (file)
@@ -311,7 +311,7 @@ double HostEnergy::get_current_watts_value(double cpu_load)
      * (maxCpuLoad is by definition 1)
      */
     int coreCount         = host_->get_core_count();
      * (maxCpuLoad is by definition 1)
      */
     int coreCount         = host_->get_core_count();
-    double coreReciprocal = static_cast<double>(1) / static_cast<double>(coreCount);
+    double coreReciprocal = 1.0 / coreCount;
     if (coreCount > 1)
       power_slope = (max_power - min_power) / (1 - coreReciprocal);
     else
     if (coreCount > 1)
       power_slope = (max_power - min_power) / (1 - coreReciprocal);
     else
index 45b89e7..f3f7e3c 100644 (file)
@@ -145,7 +145,7 @@ void HostLoad::update()
 double HostLoad::get_current_load()
 {
   // We don't need to call update() here because it is called every time an action terminates or starts
 double HostLoad::get_current_load()
 {
   // We don't need to call update() here because it is called every time an action terminates or starts
-  return current_flops_ / static_cast<double>(host_->get_speed() * host_->get_core_count());
+  return current_flops_ / (host_->get_speed() * host_->get_core_count());
 }
 
 /*
 }
 
 /*
index df39eae..068bbbf 100644 (file)
@@ -97,7 +97,7 @@ int PMPI_File_read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", count * datatype->size()));
   int ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -114,7 +114,8 @@ int PMPI_File_read_shared(MPI_File fh, void *buf, int count,MPI_Datatype datatyp
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_shared", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_shared", count * datatype->size()));
   int ret = simgrid::smpi::File::read_shared(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::read_shared(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -132,7 +133,7 @@ int PMPI_File_write(MPI_File fh, const void *buf, int count,MPI_Datatype datatyp
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", count * datatype->size()));
   int ret = simgrid::smpi::File::write(fh, const_cast<void*>(buf), count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::write(fh, const_cast<void*>(buf), count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -150,7 +151,8 @@ int PMPI_File_write_shared(MPI_File fh, const void *buf, int count,MPI_Datatype
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_shared", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_shared", count * datatype->size()));
   int ret = simgrid::smpi::File::write_shared(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::write_shared(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -166,7 +168,7 @@ int PMPI_File_read_all(MPI_File fh, void *buf, int count,MPI_Datatype datatype,
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_all", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_all", count * datatype->size()));
   int ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -182,7 +184,8 @@ int PMPI_File_read_ordered(MPI_File fh, void *buf, int count,MPI_Datatype dataty
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_ordered", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_ordered", count * datatype->size()));
   int ret = simgrid::smpi::File::read_ordered(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::read_ordered(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -199,7 +202,7 @@ int PMPI_File_write_all(MPI_File fh, const void *buf, int count,MPI_Datatype dat
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_all", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_all", count * datatype->size()));
   int ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -216,7 +219,8 @@ int PMPI_File_write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_ordered", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_ordered", count * datatype->size()));
   int ret = simgrid::smpi::File::write_ordered(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
   int ret = simgrid::smpi::File::write_ordered(fh, buf, count, datatype, status);
   TRACE_smpi_comm_out(rank_traced);
   smpi_bench_begin();
@@ -234,7 +238,7 @@ int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_D
   PASS_ZEROCOUNT(count);
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count);
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", count * datatype->size()));
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
@@ -254,7 +258,8 @@ int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,M
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_FLAGS(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_at_all", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_at_all", count * datatype->size()));
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
@@ -276,7 +281,7 @@ int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int coun
   PASS_ZEROCOUNT(count);
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   PASS_ZEROCOUNT(count);
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", count * datatype->size()));
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
@@ -297,7 +302,8 @@ int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
   CHECK_RDONLY(fh)
   smpi_bench_end();
   int rank_traced = simgrid::s4u::this_actor::get_pid();
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_at_all", static_cast<double>(count*datatype->size())));
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_at_all", count * datatype->size()));
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if(ret!=MPI_SUCCESS)
     return ret;
index 0c1f5b4..d89bdde 100644 (file)
@@ -702,7 +702,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", count));
 
   *index = simgrid::smpi::Request::waitany(count, requests, status);
 
 
   *index = simgrid::smpi::Request::waitany(count, requests, status);
 
@@ -733,7 +733,7 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitall", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitall", count));
 
   int retval = simgrid::smpi::Request::waitall(count, requests, status);
 
 
   int retval = simgrid::smpi::Request::waitall(count, requests, status);
 
index a10ac85..efecf03 100644 (file)
@@ -188,14 +188,14 @@ unsigned int smpi_sleep(unsigned int secs)
 {
   if (not smpi_process())
     return sleep(secs);
 {
   if (not smpi_process())
     return sleep(secs);
-  return private_sleep(static_cast<double>(secs));
+  return private_sleep(secs);
 }
 
 int smpi_usleep(useconds_t usecs)
 {
   if (not smpi_process())
     return usleep(usecs);
 }
 
 int smpi_usleep(useconds_t usecs)
 {
   if (not smpi_process())
     return usleep(usecs);
-  return static_cast<int>(private_sleep(static_cast<double>(usecs) / 1000000.0));
+  return static_cast<int>(private_sleep(usecs / 1000000.0));
 }
 
 #if _POSIX_TIMERS > 0
 }
 
 #if _POSIX_TIMERS > 0
@@ -203,7 +203,7 @@ int smpi_nanosleep(const struct timespec* tp, struct timespec* t)
 {
   if (not smpi_process())
     return nanosleep(tp,t);
 {
   if (not smpi_process())
     return nanosleep(tp,t);
-  return static_cast<int>(private_sleep(static_cast<double>(tp->tv_sec + tp->tv_nsec / 1000000000.0)));
+  return static_cast<int>(private_sleep(tp->tv_sec + tp->tv_nsec / 1000000000.0));
 }
 #endif
 
 }
 #endif
 
@@ -416,7 +416,7 @@ void smpi_sample_3(int global, const char *file, int line)
   double period  = xbt_os_timer_elapsed(smpi_process()->timer());
   data.sum      += period;
   data.sum_pow2 += period * period;
   double period  = xbt_os_timer_elapsed(smpi_process()->timer());
   data.sum      += period;
   data.sum_pow2 += period * period;
-  double n       = static_cast<double>(data.count);
+  double n       = data.count;
   data.mean      = data.sum / n;
   data.relstderr = sqrt((data.sum_pow2 / n - data.mean * data.mean) / n) / data.mean;
 
   data.mean      = data.sum / n;
   data.relstderr = sqrt((data.sum_pow2 / n - data.mean * data.mean) / n) / data.mean;
 
index 66cc730..1e62ea1 100644 (file)
@@ -113,7 +113,7 @@ NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
 
 void NetworkIBModel::computeIBfactors(IBNode* root)
 {
 
 void NetworkIBModel::computeIBfactors(IBNode* root)
 {
-  double num_comm_out    = static_cast<double>(root->ActiveCommsUp.size());
+  double num_comm_out    = root->ActiveCommsUp.size();
   double max_penalty_out = 0.0;
   // first, compute all outbound penalties to get their max
   for (std::vector<ActiveComm*>::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
   double max_penalty_out = 0.0;
   // first, compute all outbound penalties to get their max
   for (std::vector<ActiveComm*>::iterator it = root->ActiveCommsUp.begin(); it != root->ActiveCommsUp.end(); ++it) {
index f5fb17f..8beb1e2 100644 (file)
@@ -53,7 +53,7 @@ static void hsm_put(const std::string& remote_host, const std::string& src, cons
   XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::get_cname(), read_size, remote_host.c_str());
   std::string* payload             = new std::string(simgrid::xbt::string_printf("%s %llu", dest.c_str(), read_size));
   simgrid::s4u::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(remote_host);
   XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::get_cname(), read_size, remote_host.c_str());
   std::string* payload             = new std::string(simgrid::xbt::string_printf("%s %llu", dest.c_str(), read_size));
   simgrid::s4u::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(remote_host);
-  mailbox->put(payload, static_cast<double>(read_size));
+  mailbox->put(payload, read_size);
   simgrid::s4u::this_actor::sleep_for(.4);
 }
 
   simgrid::s4u::this_actor::sleep_for(.4);
 }