List Info

Thread: LAM: Setting the number of processes.




LAM: Setting the number of processes.
user name
2007-11-22 18:48:59
Is there a way to set the number of processors from within
the source
code in MPI? I want to develop an application that evaluates
the
number of processors needed depending on custom command
line
arguments. If this is impossible, is there a way to set the
number of
processors via an environment variable? Or is using
"mpirun -np" the
only way?

Thanks in advance,

-- 
Loerenz Praeiji
_______________________________________________
This list is archived at http://www.l
am-mpi.org/MailArchives/lam/

Re: LAM: Setting the number of processes.
country flaguser name
United States
2007-11-23 22:08:07
On Nov 22, 2007, at 5:48 PM, Loerenz Praeiji wrote:

> Is there a way to set the number of processors from
within the source
> code in MPI? I want to develop an application that
evaluates the
> number of processors needed depending on custom command
line
> arguments. If this is impossible, is there a way to set
the number of
> processors via an environment variable? Or is using
"mpirun -np" the
> only way?

There's no way to set the number of processors that will be
in a  
process's MPI_COMM_WORLD once that process has started. In
LAM/MPI in  
particular, processes are either started with mpirun (where
the -np  
flag sets the number of processes to start) or are started
as  
"singletons" -- standalone MPI applications.  It
is possible to use  
MPI_COMM_SPAWN to have one (or more) MPI processes start a
new set of  
MPI processes (in a different MPI_COMM_WORLD).

Hope this helps,

Brian

-- 
   Brian Barrett
   LAM/MPI Developer
   Make today a LAM/MPI day!


_______________________________________________
This list is archived at http://www.l
am-mpi.org/MailArchives/lam/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )