List Info

Thread: LAM: Need Suggestion for MPI.




LAM: Need Suggestion for MPI.
user name
2007-03-01 06:25:33
Sorry, for this newbie question.

Hi I have written an application which prints usage if
incorrect command 
line is given. It meant to be working on 3 nodes 1 master
and 2 slaves. 
But when I run it with "mpirun -np 3
<utility_name>" and incorrect 
commands it displays three usage messages obviously due to 3
processes 
running.

What could be the best way to solve this problem?

-Milind


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

Re: LAM: Need Suggestion for MPI.
country flaguser name
Sweden
2007-03-01 10:26:35
On Thursday 01 March 2007, Milind Dumbare wrote:
> Sorry, for this newbie question.
>
> Hi I have written an application which prints usage if
incorrect command
> line is given. It meant to be working on 3 nodes 1
master and 2 slaves.
> But when I run it with "mpirun -np 3
<utility_name>" and incorrect
> commands it displays three usage messages obviously due
to 3 processes
> running.
>
> What could be the best way to solve this problem?

if (rank == 0) {
	printf("...

/Peter

_______________________________________________
This list is archived at http://www.l
am-mpi.org/MailArchives/lam/
Re: LAM: Need Suggestion for MPI.
country flaguser name
United States
2007-03-05 23:13:31
On Mar 1, 2007, at 9:26 AM, Peter Kjellstrom wrote:

> On Thursday 01 March 2007, Milind Dumbare wrote:
>> Sorry, for this newbie question.
>>
>> Hi I have written an application which prints usage
if incorrect  
>> command
>> line is given. It meant to be working on 3 nodes 1
master and 2  
>> slaves.
>> But when I run it with "mpirun -np 3
<utility_name>" and incorrect
>> commands it displays three usage messages obviously
due to 3  
>> processes
>> running.
>>
>> What could be the best way to solve this problem?
>
> if (rank == 0) {
> 	printf("...

Peter's suggestion is correct, but with the note that
there's no way  
to get the rank of a given process before calling MPI_INIT. 
Of  
course, you really shouldn't be looking at argv/argc until
after you  
pass them through MPI_INIT, so the restriction on when you
can call  
MPI_COMM_RANK should not be a problem for options parsing.


Brian

-- 
   Brian Barrett
   LAM/MPI developer and all around nice guy
   Have a LAM/MPI day: http://www.lam-mpi.org/


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

[1-3]

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