MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: MathLink and MPI

  • To: mathgroup at
  • Subject: [mg29466] Re: MathLink and MPI
  • From: Albert Retey <albert.retey at>
  • Date: Thu, 21 Jun 2001 01:56:44 -0400 (EDT)
  • Organization: Visual Analysis AG
  • References: <9gn6h2$emp$>
  • Sender: owner-wri-mathgroup at


very interesting to hear that this obviously seems to work!
I've only had a short look at your code and I didn't use mpi for a
while, but I think your question is more about mpi than mathematica, so
probably the mpi-newsgroups are a better place for your question... Also
I don't know how good your knowledge about message passing libraries is.

What you do is to divide the communicater in a master and a slave,
right? Then the slave is in an infinit loop waiting for a message to be
I think the Bcast you are using is a blocking communication, so I think
it is not your own loop that uses the cpu-time on the slave, but I don't
remember really. So if I correctly remember, whether the process uses
any cpu-time to wait for messages could even depend on what hardware
(SMP or network...) you run your parallel program and how the
mpi-library you are using implements such a function (as MPI_Bcast). It
will either loop to check for new messages (uses cpu) or just wait for a
signal whether something has arrived. This depends on implementation and
also on what the hardware supports (e.g. how intelligent is your network
hardware). It might be a good idea to include information about the
hard- and software you are using in a question to one of the mpi

As far as I know a mathlink process does not use any cpu time if just
waiting for new commands, so this is why I think you should check the
mpi-part of the program (it should be relatively easy to check whether
the "slave" process needs cpu-time when waiting for a message without
even using mathlink, then you at least know where to look at...). Then
you could check whether there are other forms of communication where the
waiting slave does not use  the cpu. If it turns out that in your setup
waiting for new messages (work that is) always uses cpu time you
probably need to kill and restart the "slave" processes for a new
calculation. Not very efficient (only good for "long" calculations) and
only supported by MPI2 or alternatively PVM I think.

not much help I guess...


  • Prev by Date: Re: Re: Reentrant Functions
  • Next by Date: Two CPU AMD PC and Mathematica
  • Previous by thread: Re: MathLink and MPI
  • Next by thread: Rows