Re: [Yade-dev] boost::mpi and python bindings for it.

2021-03-04 Thread Bruno Chareyre

Hi,

Very interesting indeed. I didn't notice.
I wouldn't claim that, by definition, it is more safe than mpi4py (just 
another wrapper) but it would remove that dependency.


I wonder if a simple replacement of mpi4py.comm by boost.mpi.comm would 
do the trick. If they followed same naming conventions it could.


Cheers

Bruno


On 03/03/2021 23:56, Janek Kozicki (yade) wrote:

Hi Bruno,

There is a boost::mpi library built on top of OpenMPI, MPICH2, IntelMPI [0].
In the introduction [1] they say it's just a wrapper for OpenMPI,
MPICH2 and IntelMPI. By using boost you could have some extra safety.

Example [2]:

int main(int argc, char* argv[])
{
   mpi::environment env(argc, argv);
   mpi::communicator world;
   std::cout << "I am process " << world.rank() << " of " << world.size()
 << "." << std::endl;
   return 0;
}

Python example [3]:

   import boost.mpi as mpi
   print "I am process %d of %d." % (mpi.rank, mpi.size)

Have a look :)
Janek

[0] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi.html
[1] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/getting_started.html
[2] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/tutorial.html
[3] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/python.html






___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] boost::mpi and python bindings for it.

2021-03-03 Thread Janek Kozicki (yade)
Hi Bruno,

There is a boost::mpi library built on top of OpenMPI, MPICH2, IntelMPI [0].
In the introduction [1] they say it's just a wrapper for OpenMPI,
MPICH2 and IntelMPI. By using boost you could have some extra safety.

Example [2]:

int main(int argc, char* argv[])
{
  mpi::environment env(argc, argv);
  mpi::communicator world;
  std::cout << "I am process " << world.rank() << " of " << world.size()
<< "." << std::endl;
  return 0;
}

Python example [3]:

  import boost.mpi as mpi
  print "I am process %d of %d." % (mpi.rank, mpi.size)

Have a look :)
Janek

[0] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi.html
[1] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/getting_started.html
[2] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/tutorial.html
[3] https://www.boost.org/doc/libs/1_75_0/doc/html/mpi/python.html




-- 
--
Janek Kozicki, PhD. DSc. Arch. Assoc. Prof.
GdaƄsk University of Technology
Faculty of Applied Physics and Mathematics
Department of Theoretical Physics and Quantum Information
--
http://yade-dem.org/
http://pg.edu.pl/jkozicki (click English flag on top right)

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp