<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>RE: [mpich-discuss] mpi program with argumets</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2> <A HREF="https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk/src/mpi/romio/test/simple.c">https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk/src/mpi/romio/test/simple.c</A><BR>
<BR>
-----Original Message-----<BR>
From: mpich-discuss-bounces@mcs.anl.gov [<A HREF="mailto:mpich-discuss-bounces@mcs.anl.gov">mailto:mpich-discuss-bounces@mcs.anl.gov</A>] On Behalf Of Rajeev Thakur<BR>
Sent: Thursday, February 26, 2009 3:31 PM<BR>
To: mpich-discuss@mcs.anl.gov<BR>
Subject: Re: [mpich-discuss] mpi program with argumets<BR>
<BR>
See src/mpi/romio/test/simple.c<BR>
<BR>
<BR>
> -----Original Message-----<BR>
> From: mpich-discuss-bounces@mcs.anl.gov<BR>
> [<A HREF="mailto:mpich-discuss-bounces@mcs.anl.gov">mailto:mpich-discuss-bounces@mcs.anl.gov</A>] On Behalf Of Sole Eko<BR>
> Sent: Thursday, February 26, 2009 3:25 PM<BR>
> To: mpich-discuss@mcs.anl.gov<BR>
> Subject: Re: [mpich-discuss] mpi program with argumets<BR>
><BR>
> No, I don't have problems use argc/argv,<BR>
><BR>
> but, can somebody give me example how to make cpi.c to accept one<BR>
> argument (number of rectangles) and then broadcast it.. I am realy<BR>
> newbe in MPI, so any help will be great for beggining.<BR>
><BR>
><BR>
> On 2/26/09, Rajeev Thakur <thakur@mcs.anl.gov> wrote:<BR>
> > You can do it as you would in any C program. For<BR>
> portability, you should<BR>
> > assume that command-line arguments are available only at<BR>
> rank 0, and have<BR>
> > rank 0 broadcast them to other ranks.<BR>
> ><BR>
> > The Fortran example examples/f77/fpi.f shows how to do it<BR>
> using stdin.<BR>
> ><BR>
> > Rajeev<BR>
> ><BR>
> ><BR>
> > _____<BR>
> ><BR>
> > From: mpich-discuss-bounces@mcs.anl.gov<BR>
> > [<A HREF="mailto:mpich-discuss-bounces@mcs.anl.gov">mailto:mpich-discuss-bounces@mcs.anl.gov</A>] On Behalf Of Sole Eko<BR>
> > Sent: Thursday, February 26, 2009 7:23 AM<BR>
> > To: mpich-discuss@mcs.anl.gov<BR>
> > Subject: [mpich-discuss] mpi program with argumets<BR>
> ><BR>
> ><BR>
> > Hi,<BR>
> ><BR>
> > I would like to make example program cpi.c to be able to<BR>
> run wih one or more<BR>
> > arguments, for example:<BR>
> ><BR>
> > mpiexec cpi.exe 1000<BR>
> ><BR>
> > where 1000 is, say, number of rectangles.<BR>
> ><BR>
> > I saw that MPI_Init(&argc,&arv) uses argumets passed to<BR>
> main method, but not<BR>
> > more than that..<BR>
> ><BR>
> > how can I acheve passing number of rectangles to cpi.exe?<BR>
> ><BR>
> > I attached original version of cpi.c<BR>
> ><BR>
> > Sole<BR>
> ><BR>
> ><BR>
> ><BR>
> ><BR>
><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>