Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
activate a fortran test
authorAugustin Degomme <adegomme@gmail.com>
Fri, 26 Jul 2019 12:34:49 +0000 (14:34 +0200)
committerAugustin Degomme <adegomme@gmail.com>
Fri, 26 Jul 2019 14:29:07 +0000 (16:29 +0200)
src/smpi/bindings/smpi_f77_comm.cpp
src/smpi/bindings/smpi_f77_type.cpp
src/smpi/mpi/smpi_datatype.cpp
teshsuite/smpi/mpich3-test/f77/datatype/testlist
teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/datatype/structf.f90
teshsuite/smpi/mpich3-test/f90/datatype/testlist

index 8e3c44c..4ea2664 100644 (file)
@@ -100,9 +100,8 @@ void mpi_comm_free_keyval_ (int* keyval, int* ierr) {
 
 void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){
  *ierr = MPI_Comm_get_name(simgrid::smpi::Comm::f2c(*comm), name, len);
 
 void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){
  *ierr = MPI_Comm_get_name(simgrid::smpi::Comm::f2c(*comm), name, len);
-  if(*len>0)
-    for(int i = *len; i<MPI_MAX_OBJECT_NAME+1; i++)
-      name[i]=' ';
+  for(int i = *len; i<MPI_MAX_OBJECT_NAME+1; i++)
+    name[i]=' ';
 }
 
 void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr){
 }
 
 void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr){
index f59b92d..1f71496 100644 (file)
@@ -52,8 +52,8 @@ void mpi_type_set_name_ (int*  datatype, char * name, int* ierr, int size){
 
 void mpi_type_get_name_ (int*  datatype, char * name, int* len, int* ierr){
  *ierr = MPI_Type_get_name(simgrid::smpi::Datatype::f2c(*datatype),name,len);
 
 void mpi_type_get_name_ (int*  datatype, char * name, int* len, int* ierr){
  *ierr = MPI_Type_get_name(simgrid::smpi::Datatype::f2c(*datatype),name,len);
-  if(*len>0)
-    name[*len]=' ';
+  for(int i = *len; i<MPI_MAX_OBJECT_NAME+1; i++)
+    name[i]=' ';
 }
 
 void mpi_type_get_attr_ (int* type, int* type_keyval, int *attribute_val, int* flag, int* ierr){
 }
 
 void mpi_type_get_attr_ (int* type, int* type_keyval, int *attribute_val, int* flag, int* ierr){
index a3d6f8a..a22b3d4 100644 (file)
@@ -238,8 +238,12 @@ int Datatype::extent(MPI_Aint * lb, MPI_Aint * extent){
 }
 
 void Datatype::get_name(char* name, int* length){
 }
 
 void Datatype::get_name(char* name, int* length){
-  *length = strlen(name_);
-  strncpy(name, name_, *length+1);
+  if(name_!=nullptr){
+    *length = strlen(name_);
+    strncpy(name, name_, *length+1);
+  }else{
+    *length = 0;
+  }
 }
 
 void Datatype::set_name(const char* name){
 }
 
 void Datatype::set_name(const char* name){
index fe7afa5..a98a1f2 100644 (file)
@@ -1,6 +1,6 @@
 #typenamef 1
 #typename3f 1 mpiversion=3.0
 #typenamef 1
 #typename3f 1 mpiversion=3.0
-#typesnamef 1
+typesnamef 1
 #typecntsf 1
 #typem2f 1
 typesubf 1
 #typecntsf 1
 #typem2f 1
 typesubf 1
index 5b2f44a..bc7223c 100644 (file)
@@ -8,12 +8,12 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
-  foreach(test gaddressf90
+  foreach(test gaddressf90 typesnamef90 structf
              # allctypesf90 createf90 get_elem_d get_elem_u
             # hindex1f90 hindexed_blockf90 
               indtype kinds
              # allctypesf90 createf90 get_elem_d get_elem_u
             # hindex1f90 hindexed_blockf90 
               indtype kinds
-            # packef90 sizeof structf trf90 typecntsf90 typem2f90 typename3f90
-            # typenamef90 typesnamef90
+            # packef90 sizeof  trf90 typecntsf90 typem2f90 typename3f90
+            # typenamef90 
               typesubf90)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
               typesubf90)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
index 8227ef0..dbdc861 100644 (file)
@@ -14,8 +14,9 @@
 ! for MPICH, and to fit in the MPICH test harness - WDG
 !
       program bustit
 ! for MPICH, and to fit in the MPICH test harness - WDG
 !
       program bustit
-      implicit none
       use mpi
       use mpi
+      implicit none
+
       
       integer comm
       integer newtype
       
       integer comm
       integer newtype
index 5b158a0..f10917c 100644 (file)
@@ -1,7 +1,7 @@
 # This file generated by f77tof90
 #typenamef90 1
 #typename3f90 1 mpiversion=3.0
 # This file generated by f77tof90
 #typenamef90 1
 #typename3f90 1 mpiversion=3.0
-#typesnamef90 1
+typesnamef90 1
 #typecntsf90 1
 #typem2f90 1
 typesubf90 1
 #typecntsf90 1
 #typem2f90 1
 typesubf90 1