[mpich-discuss] fence vs. lock-unlock

Jie Chen jiechen at mcs.anl.gov
Tue Jul 10 10:00:22 CDT 2012


//This is what I did using fence:

for (i = 0; i < nproc; i++) {
  target = (rank + i) % nproc;
  MPI_Win_fence(MPI_MODE_NOPUT, window);
  MPI_Get(... , target , ...);
  MPI_Win_fence(MPI_MODE_NOPUT, window);
  some_computation();
}

//This is what I did using lock-unlock:

for (i = 0; i < nproc; i++) {
  target = (rank + i) % nproc;
  MPI_Win_lock(MPI_LOCK_SHARED, target, MPI_MODE_NOCHECK, window);
  MPI_Get(... , target , ...);
  MPI_Win_unlock(target, window);
  some_computation();
}



------------------------------

Message: 5
Date: Tue, 10 Jul 2012 15:51:52 +0200
From: Dave Goodell <goodell at mcs.anl.gov>
To: mpich-discuss at mcs.anl.gov
Subject: Re: [mpich-discuss] fence vs. lock-unlock
Message-ID: <9CB3A865-814C-4C4D-9863-915695993502 at mcs.anl.gov>
Content-Type: text/plain; charset=us-ascii

Can you sketch out the code that you are using when you switch to passive mode?  Replacing fence with lock/unlock could be done a couple of ways.

Are you using EXCLUSIVE or SHARED locks?  Are you providing any assertion hints to the library?

-Dave


More information about the mpich-discuss mailing list