Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar found these potential issues .. why not.
authordegomme <augustin.degomme@unibas.ch>
Mon, 13 Feb 2017 14:06:01 +0000 (15:06 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Mon, 13 Feb 2017 14:07:14 +0000 (15:07 +0100)
src/smpi/smpi_global.cpp
src/smpi/smpi_mpi_dt.cpp

index b7b181c..47a3374 100644 (file)
@@ -790,7 +790,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[])
   SIMIX_global_init(&argc, argv);
   MSG_init(&argc,argv);
 
   SIMIX_global_init(&argc, argv);
   MSG_init(&argc,argv);
 
-  SMPI_switch_data_segment = smpi_switch_data_segment;
+  SMPI_switch_data_segment = &smpi_switch_data_segment;
 
   smpi_init_options();
 
 
   smpi_init_options();
 
index 1268a50..f7d69c5 100644 (file)
@@ -424,8 +424,9 @@ void smpi_datatype_free(MPI_Datatype* type){
 
 void smpi_datatype_use(MPI_Datatype type){
 
 
 void smpi_datatype_use(MPI_Datatype type){
 
-  if(type != MPI_DATATYPE_NULL)
-    type->in_use++;
+  if(type == MPI_DATATYPE_NULL)
+    return;
+  type->in_use++;
 
   if(type->sizeof_substruct!=0){
     static_cast<s_smpi_subtype_t *>((type)->substruct)->subtype_use(&type);  
 
   if(type->sizeof_substruct!=0){
     static_cast<s_smpi_subtype_t *>((type)->substruct)->subtype_use(&type);