Browse Source

starpu_init() must be called before starpu_mpi_init_comm().

Samuel Thibault 9 years ago
parent
commit
73e384e809

+ 1 - 0
doc/doxygen/chapters/api/mpi.doxy

@@ -23,6 +23,7 @@ Initializes the starpumpi library with the given communicator.
 \p initialize_mpi indicates if MPI should be initialized or not by StarPU.
 \p initialize_mpi indicates if MPI should be initialized or not by StarPU.
 If the value is not 0, MPI will be initialized by calling
 If the value is not 0, MPI will be initialized by calling
 <c>MPI_Init_Thread(argc, argv, MPI_THREAD_SERIALIZED, ...)</c>.
 <c>MPI_Init_Thread(argc, argv, MPI_THREAD_SERIALIZED, ...)</c>.
+starpu_init() must be called before starpu_mpi_init_comm().
 
 
 \fn int starpu_mpi_init(int *argc, char ***argv, int initialize_mpi)
 \fn int starpu_mpi_init(int *argc, char ***argv, int initialize_mpi)
 \ingroup API_MPI_Support
 \ingroup API_MPI_Support

+ 6 - 6
mpi/examples/native_fortran/nf_basic_ring.f90

@@ -30,12 +30,6 @@ program nf_basic_ring
         integer(c_int) :: src,dst
         integer(c_int) :: src,dst
         type(c_ptr) :: token_dh, st
         type(c_ptr) :: token_dh, st
 
 
-        ret = fstarpu_mpi_init(1)
-        print *,"fstarpu_mpi_init status:", ret
-        if (ret /= 0) then
-                stop 1
-        end if
-
         ret = fstarpu_init(C_NULL_PTR)
         ret = fstarpu_init(C_NULL_PTR)
         if (ret == -19) then
         if (ret == -19) then
                 stop 77
                 stop 77
@@ -43,6 +37,12 @@ program nf_basic_ring
                 stop 1
                 stop 1
         end if
         end if
 
 
+        ret = fstarpu_mpi_init(1)
+        print *,"fstarpu_mpi_init status:", ret
+        if (ret /= 0) then
+                stop 1
+        end if
+
         ! stop there if no CPU worker available
         ! stop there if no CPU worker available
         ncpu = fstarpu_cpu_worker_get_count()
         ncpu = fstarpu_cpu_worker_get_count()
         if (ncpu == 0) then
         if (ncpu == 0) then

+ 6 - 6
mpi/examples/native_fortran/nf_mm.f90

@@ -32,12 +32,6 @@ program nf_mm
         integer(c_int) :: b_row, b_col
         integer(c_int) :: b_row, b_col
         integer(c_int) :: mr, tag, rank
         integer(c_int) :: mr, tag, rank
 
 
-        ret = fstarpu_mpi_init(1)
-        print *,"fstarpu_mpi_init status:", ret
-        if (ret /= 0) then
-                stop 1
-        end if
-
         ret = fstarpu_init(C_NULL_PTR)
         ret = fstarpu_init(C_NULL_PTR)
         if (ret == -19) then
         if (ret == -19) then
                 stop 77
                 stop 77
@@ -45,6 +39,12 @@ program nf_mm
                 stop 1
                 stop 1
         end if
         end if
 
 
+        ret = fstarpu_mpi_init(1)
+        print *,"fstarpu_mpi_init status:", ret
+        if (ret /= 0) then
+                stop 1
+        end if
+
         ! stop there if no CPU worker available
         ! stop there if no CPU worker available
         ncpu = fstarpu_cpu_worker_get_count()
         ncpu = fstarpu_cpu_worker_get_count()
         if (ncpu == 0) then
         if (ncpu == 0) then