Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix fortran f2c.
authordegomme <adegomme@users.noreply.github.com>
Mon, 8 Apr 2019 09:42:08 +0000 (11:42 +0200)
committerdegomme <adegomme@users.noreply.github.com>
Mon, 8 Apr 2019 09:55:32 +0000 (11:55 +0200)
It was using hexa to store int strings, which led to issues as 1F was interpreted as 1 in the other direction.

src/smpi/mpi/smpi_f2c.cpp

index 93510ae..58caf83 100644 (file)
@@ -34,12 +34,12 @@ int F2C::f2c_id(){
 };
 
 char* F2C::get_key(char* key, int id) {
 };
 
 char* F2C::get_key(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x", static_cast<unsigned>(id));
+  std::snprintf(key, KEY_SIZE, "%u", static_cast<unsigned>(id));
   return key;
 }
 
 char* F2C::get_key_id(char* key, int id) {
   return key;
 }
 
 char* F2C::get_key_id(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x_%ld", static_cast<unsigned>(id), simgrid::s4u::this_actor::get_pid());
+  std::snprintf(key, KEY_SIZE, "%u_%ld", static_cast<unsigned>(id), simgrid::s4u::this_actor::get_pid());
   return key;
 }
 
   return key;
 }