On Fri, Aug 28, 2015 at 10:49 AM, Andrew Donaldson Davis <davi...@mit.edu>
wrote:

> Hello all,
>
> You might have to forgive me if this is a silly question but I'm having
> some trouble understanding how LibMesh initializes MPI.
>
> I have the code:
>
> using namespace std;
> namespace mpi = boost::mpi;
>
> int main(int argc, char **argv) {
>   mpi::environment env(argc, argv);
>
>   unique_ptr<mpi::communicator> worldComm =
> unique_ptr<mpi::communicator>(new mpi::communicator);
>
>   auto libmeshInit = make_shared<libMesh::LibMeshInit>(argc, argv,
> MPI_Comm(*worldComm));
>
>   cout << " size: " << worldComm->size() << " rank: " << worldComm->rank()
> << endl;
>
>   return 0;
> }
>
> which I expect to have an output like:
>
>  size: 4 rank: 0
>  size: 4 rank: 1
>  size: 4 rank: 2
>  size: 4 rank: 3
>
> However, I am instead seeing the output:
>
>  size: 4 rank: 0
>

This is an easy fix, you need to run your code with --keep-cout to see the
output from all processors...

-- 
John
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to