Running MPI code in my laptop
Asked Answered
A

4

5

I am new to parallel computing world. Can you tell me is it possible to run a c++ code uses MPI routines in my laptop with dual core or is there any simulator/emulator for doing that?

Abreu answered 19/2, 2010 at 19:52 Comment(0)
P
6

Most MPI implementations use shared memory for communication between ranks that are located on the same host. Nothing special is required in terms of setting up the laptop.

Using a dual core laptop, you can run two ranks and the OS scheduler will tend to place them on separate cores. The WinXP scheduler tends to enforce some degree of "cpu binding" because by default jobs tend to be scheduled on the core where they last ran. However, most MPI implementations also allow for an explicit "cpu binding" that will force a rank to be scheduled on one specific core. The syntax for this is non-standard and must be gotten from the specific implementations documentation.

You should try to use "the same" version and implementation of MPI on your laptop that the university computers are running. That will help to ensure that the MPI runtime flags are the same.

Most MPI implementations ship with some kind of "compiler wrapper" or at least a set of instructions for building an application that will include the MPI library. Either use those wrappers, or follow those instructions.

Parnassus answered 19/2, 2010 at 23:14 Comment(0)
E
4

If you are interested in a simulator of MPI applications, you should probably check SMPI.

This open-source simulator (in which I'm involved) can run many MPI C/C++/Fortran applications unmodified, and forecast rather accurately the runtime of the application, provided that you have an accurate description of your hardware platform. Both online and offline studies are possible.

There is many other advantages in using a simulator to study MPI applications:

  • Reproducibility: several runs lead to the exact same behavior unless you specify so. You won't have any heisenbugs where adding some more tracing changes the application behavior;
  • What-if Analysis: Ability to test on platform that you don't have access to, or that is not built yet;
  • Clairevoyance: you can observe every parts of the system, even at the network core.

For more information, see this presentation or this article.

The SMPI framework can even formally study the correction of MPI applications through exhaustive testing, as shown in that presentation.

Emporium answered 16/2, 2013 at 15:18 Comment(0)
E
1

MPI messages are transported via TCP networking (there are other high-performance possibilities like shared performance, but networking is the default). So it doesn't matter at all where the application runs as long as the nodes can connect to each other. I guess that you want to test the application on your laptop, so the nodes are all running locally and can easily connect to each other via the loopback network.

Eakins answered 19/2, 2010 at 19:58 Comment(2)
thank you. How can I create local nodes? my laptop is dual core that means I can distribute the work into two processing units right?Simply what I would like to do is to test my application in my machine and after that submit it to the university supercomputer. What should I do as a Windows XP user?Abreu
-1 All the major MPI implementations default to using shared memory for message passing between ranks on the same node.Parnassus
H
1

I am not quite sure if I do understand your question, but a laptop is a computer just like any other. Providing you have set up your MPI libs correctly and set your paths, you can, of course, use MPI routines on your laptop.

As far as I am concerned, I use Debian Linux (http://www.debian.org) for all my parallel stuff. I have written a little article dealing with HowTo get MPI run on debian machines. You may want to refer to it.

Hate answered 19/2, 2010 at 20:2 Comment(1)
thank you S.Tayefeh, I will use your experience when I submit the work to Linux-Unix machines, the real ones. However, now I am just testing my application in my laptop without getting connected to any other machine. any suggestion?Abreu

© 2022 - 2024 — McMap. All rights reserved.