Set the number of processes in ScaLAPACK

Open discussion regarding features, bugs, issues, vendors, etc.

Set the number of processes in ScaLAPACK

Postby jgpallero » Fri Jun 07, 2013 8:42 am

Hello:

I'm newbie in ScaLAPACK and I have sobe questions about the possibility of setting the number of processes for a program execution. I have a prototype program that looks like

Code: Select all
int main()
{
    //some work that must be done by only one node
    .....
    //function that runs internally some scalapack computations
    funcCompScalapack();
    //other work must be done by the original node
    ....
    return 0;
}

void funcCompScalapack()
{
    //Initialize MPI (or PVM)
    MPI_Init(NULL,NULL);
    //here I think I should write some code in order to inform that the work must be done by a number X or processors
    ....
    //some BLACS and ScaLAPACK computations
    ....
    //finalize MPI (or PVM)
    MPI_Finalize();
    return;
}


The idea is to encapsulate all the MPI (or PVM) and ScaLAPACK et al. code in an individual function that will be called after and before some taskc that must be performed by onlu one process. The reason to encapsulate these code into the individual function is I would like to maintain all the other code in the program free of MPI or PVM code. The, I could compile (via preprocessor variables) the code in 'void funcCompScalapack()' for using ScaLAPACK or classical LAPACK and I could have in only one function the possibility to use normal and distributed code. This can be a bad and/or inefficient idea, but my program is only for pedagogical applications.

The main idea is simple. But here starts the problems. If I write my program using ScaLAPACK MPI version and run it as mpirun -np X ./myprogram automatically the program will use X processes and all code before and after the 'funcCompScalapack()' will be executed by the X processes. If I run with -np 1, only one proccess will be used.

I have asked in the OpenMPI mailing list about and there is no exists any function in order to set dynamically the number of processes to use. The only way to manage my problem consists in detect when the process is the root and then execute the code before and after the 'funcCompScalapack()'. But asking about the process id implies to yse MPI code outside the 'funcCompScalapack()', and I do not want to do this.

MPI has the function MPI_Comm_spawn() but it distributes over a number of processes a precompiled binary, and I want to distribute a piece of code in the original program, not an autonomous binary.

It can be dode easily in OpenMP, but I need to perform it in a distributed memory environment in order to use ScaLAPACK.

So, can be my idea done using ScaLAPACK? What about PVM? Could be done using the ScaLAPACK PVM version?

Cheers
jgpallero
 
Posts: 20
Joined: Thu Jul 29, 2010 2:29 pm
Location: Madrid, Spain

Return to User Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests

cron