Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: [OMPI users] MPI - memory sharing?
From: Rohan Deshpande (rohand87_at_[hidden])
Date: 2012-05-16 08:08:13


I have following structure of MPI code -

int main(){

MPI_INIT.....
//initialize MPI
data = malloc(sizeof(int)*200);
    //initialize data
   /*--------Master---------*/
  if(taskid == 0){

    //send data to each slave
    MPI_SEND....
   }

   /*----Slaves-------*/
  if(taskid > 0){

   //accept data from master
  MPI_RECV....
  //do some calculations
 }

 MPI_Finalize()
}

I have few doubts about the code above.
In above code, the data is allocated memory in the main program. If I run
this program on cluster where
node 1 is slave and node 0 is master, does node 1 actually shares the
memory location of node 0 to perform the calculations?

If I do not want to share the memory, how can i make task on node 1 work
independently ?

Thanks in advance.