[mpich-discuss] dividing the program

Eugene N neverov.biks.07.1 at gmail.com
Thu Feb 3 01:07:10 CST 2011


Hello
You task seems trivial enough, just go to /examples directory in mpich2
directory, and look at cpi.c. Alternatively, lookup monte carlo pi
computations with pi on the net,
changing the code for your purposes wont be hard. You need no more then half
a dozen MPI api calls (bcast, reduce, ...)


Eugene

2011/2/3 farooq farooq <farooqnmd1220 at gmail.com>

> hai friends
>
> i am new user now
> i am working on parallel programs
> ---------i want to devide the program such that
>  p=26 is the integer
> stri[30][100] is the string empty array
> and i want to broadcast the p value to all the processes then to
> execute the following code
> for (k=myrank+1;k<=p;k+=size)
> {
>  here i am doing some manipulations on the some string string say exstr[]
>  and store the result in the stri[k][100]
> }
> at last i want to gather the result in
> stri[][] sequentially from all the processes
> and print the result of all processes sequentially from str[][]
> some one please help me in writing the code
> expecting the reply as early as possible
> --
> --------------------farooq
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20110203/b596baea/attachment.htm>


More information about the mpich-discuss mailing list