LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Subir Singh Lamba (subirs_at_[hidden])
Date: 2005-11-05 11:30:01


Hi all,

I need help to accomplish a task regarding useage of MPI with C.
I need you help in MPI implementation. I have developed a sequential code
(some 10,000 lines) in C and now I have to parallelize it. The code
consists of a main program and different functions which perform various
tasks in conjunction with the main program. My problem is to parallelize
at the level of function for e.g within a function I want to use as

if (myid == 0)
{
(somejob)
}
if (myid = 1)
{
(some job)
}

Now the problem which I am encountering is I do not want to use the
argument of the function to send the process rank ( here it is myid) to
the function and still do the parallelization at the level of the
function. I have tried many ways one of them being using myid as an extern
variable but have been unsuccessful uptil now.

So I need find some way so as to make the function recognize the process
rank and perform the required job.

Any help from you will be greatly appreciated.

With regards,

Subir