unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 5a013201477117276beb5bc97fd4719de6ca5b1c 1464 bytes (raw)
name: packages/patches/fenics-dolfin-demo-init.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
Ensure MPI is initialized before getting rank, which may be called early by
Logger::write() via dolfin::info().

Fixes "MPI_Comm_rank called before MPI_INIT" error from
`demo_stokes-iterative_serial` and `demo_waveguide_serial` tests.

Submitted upstream at https://bitbucket.org/fenics-project/dolfin/issues/1127

--- a/dolfin/common/MPI.cpp
+++ b/dolfin/common/MPI.cpp
@@ -143,6 +143,7 @@ MPI_Info& dolfin::MPIInfo::operator*()
 unsigned int dolfin::MPI::rank(const MPI_Comm comm)
 {
 #ifdef HAS_MPI
+  SubSystemsManager::init_mpi();
   int rank;
   MPI_Comm_rank(comm, &rank);
   return rank;
diff --git a/dolfin/common/MPI.h b/dolfin/common/MPI.h
index b93f6df30..854114a3f 100644
--- a/dolfin/common/MPI.h
+++ b/dolfin/common/MPI.h
@@ -102,12 +102,13 @@ namespace dolfin
       /// communicator
       void reset(MPI_Comm comm);
 
-      /// Return process rank for the communicator
+      /// Return process rank for the communicator. This function will
+      /// also initialize MPI if it hasn't already been initialised.
       unsigned int rank() const;
 
       /// Return size of the group (number of processes) associated
-      /// with the communicator. This function will also intialise MPI
-      /// if it hasn't already been intialised.
+      /// with the communicator. This function will also initialise MPI
+      /// if it hasn't already been initialised.
       unsigned int size() const;
 
       /// Set a barrier (synchronization point)

debug log:

solving 5a013201477117276beb5bc97fd4719de6ca5b1c ...
found 5a013201477117276beb5bc97fd4719de6ca5b1c in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).