l***@yahoo.com
2008-09-02 10:00:04 UTC
Hi all,
I'm trying to write a program that combines threads and MPI. I'm using
gcc 4.1.2, OpenMP and OpenMPI 1.2.6.
However, when I printed out the value of "provided" in
MPI_Init_thread(&argc, &argv, 5, &provided), I got 0. Does that mean I
can't use threads in my program?
I have tried writing a pure OpenMP program, and it works, so I know my
compiler supports OpenMP. But how do I know that my MPI program is
really running different threads? I noticed that when I remove the
OpenMP #pragmas, the program still works correctly (the #pragmas
probably didn't do anything, since I was not allocated any threads).
I also have a couple of questions about running MPI on multi-core
systems:
Say I have a quad-core computer. If I run a MPI program locally using
"-np 4", will the 4 instances of the program automatically run on each
of the 4 cores, i.e. one instance per core? Or should I have "slots =
4" in the hostfile and run the program with "-np 1"? Or do I not have
any control over whether all 4 cores will be utilized or not?
Also, a question that is somehow related to the above question: if
using a quad-core computer leads to the one-instance-per-core
scenario, will running a MPI program on a quad-core computer be
generally faster than running the same program on 4 single-core
computers, since the physical distance between the cores/memory is
much shorter in the quad-core system than the single-core network,
which might reduce communication costs?
Thank you.
Regards,
Rayne
I'm trying to write a program that combines threads and MPI. I'm using
gcc 4.1.2, OpenMP and OpenMPI 1.2.6.
However, when I printed out the value of "provided" in
MPI_Init_thread(&argc, &argv, 5, &provided), I got 0. Does that mean I
can't use threads in my program?
I have tried writing a pure OpenMP program, and it works, so I know my
compiler supports OpenMP. But how do I know that my MPI program is
really running different threads? I noticed that when I remove the
OpenMP #pragmas, the program still works correctly (the #pragmas
probably didn't do anything, since I was not allocated any threads).
I also have a couple of questions about running MPI on multi-core
systems:
Say I have a quad-core computer. If I run a MPI program locally using
"-np 4", will the 4 instances of the program automatically run on each
of the 4 cores, i.e. one instance per core? Or should I have "slots =
4" in the hostfile and run the program with "-np 1"? Or do I not have
any control over whether all 4 cores will be utilized or not?
Also, a question that is somehow related to the above question: if
using a quad-core computer leads to the one-instance-per-core
scenario, will running a MPI program on a quad-core computer be
generally faster than running the same program on 4 single-core
computers, since the physical distance between the cores/memory is
much shorter in the quad-core system than the single-core network,
which might reduce communication costs?
Thank you.
Regards,
Rayne