On Jan 29, 2013, at 12:02 AM, Pradeep Jha <pradeep@ccs.engg.nagoya-u.ac.jp> wrote:

Thank you for your response. That makes it clear.

A related question. When I run a general program on a machine, say a Internet browser/Media player to watch a movie by clicking on the icon of the avi file in the folder (nothing from the terminal), how many cores does it use? In that case also does it just run on one core?

Well this isn't really a MPI question, but in short, the answer depends on the operating system and the application. If the latter is a serial application (no threads), it will generally only use one core, at most. If you are starting a more "complex" application on a graphical user interface, say, this often involves threads.  So your media player may actually use a thread for the GUI, and one thread for decoding the video. But I am just guessing here. The OS is free to distribute the threads over the cores as it sees fit.

Generally, how is the work load divided on the cores on a computer. Does every process that I start uses a new core, or the work load is distributed over all the available cores?
Again, this depends on the OS and on the hardware, so there is no general answer to your question. However, with OpenMPI (and other implementations) you can map processes to sockets and cores explicitly. This is called process affinity, which serves to improve locality for certain MPI ranks. This is described in the mpirun manpage and on the OpenMPI website, see

http://www.open-mpi.org/faq/?category=tuning#paffinity-defs

I hope this answers your original question.

Jens

Thank you


2013/1/29 Jens Glaser <jglaser@umn.edu>
Hi Pradeep,

On Jan 28, 2013, at 11:16 PM, Pradeep Jha <pradeep.kumar.jha@gmail.com> wrote:
I have a very basic question about MPI. 

I have a computer with 8 processors (each with 8 cores).  What is the difference between if I run a program simply by "./program" and "mpirun -np 8 /path/to/program" ? In the first case does the program just use one processor out of the 8? If I want the program to use all the 8 processors at the same time, then I have to do with mpirun? 

If you run the application as  "./program", it will most likely use only one core on one processor, i.e. 1/64 of your machine, if the latter really has eight CPUs with 8 cores each, as you write.  I have not heard of such machines, but you may be right.. There is an exception, namely if your program uses multi-threading (OpenMP etc.), then it could use more than one core even if you start it without mpirun.

However, if you do start it with mpirun, a number "np" of processes is launched on different cores. Provided your node really has 8 physical CPUs with 8 cores each and you want your program to utilize all your 64 cores, you should start it with -np 64.

Jens

_______________________________________________
users mailing list
users@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

_______________________________________________
users mailing list
users@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users