Only one CPU is busy

I use PVF to calculate a program,but find only one CPU is busy.
I want to know:how to use all CPUs,or PVF does not support that?
Eager for answers.

Hi easydavid,

PVF supports various parallel models for the CPU, OpenMP, MPI, and auto-parallelization (-Mconcur) though each requires user intervention. Which parallel model are you using?

  • Mat

Thank you for your answer.
I use auto-parallelization.
My computer CPU is xeon with 12 cores.
I use Visual Studio 2010 and PGI Visual Fortran 2010.

Hi easydavid,

By default, -Mconcur compiled code will only use a single thread. For multiple threads, you need to set in the shell’s environment variable “OMP_NUM_THREADS” to the number of threads to use.

Alternatively, you could use the flag '-Mconcur=allcores" to change the default to use all available cores.

Note, that I’m assuming the compiler was able to find opportunities for parallelization. Please review the compiler feedback messages from the “-Minfo” flag for information about where parallel sections were found.

Hope this helps,
Mat

Thank you.
But may I konw how to

or

Hi easydavid,

For using environment variables, please see Chapter 13 of the PVF User’s Guide.

Since “-Mconcur=allcores” is a lesser used flag you need to manually add it to your compile line. This is done via the Project Properties pages (right-click on your project in the solution explorer window and select properties). From there open the “Fortran->Command Line” box, and type in the flag under “Additional Options”.

Hope this helps,
Mat