Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] ob1 and req->req_state
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-06-23 15:20:47

On Jun 23, 2008, at 3:17 PM, Brian W. Barrett wrote:

> Just because it's volatile doesn't mean that adds are atomic.
> There's at least one place in the PML (or used to be) where two
> threads could decrement that counter at the same time.

With atomics, then both subtracts should occur, right? So a request
could go from ACTIVE -> INACTIVE -> INVALID. Is that what is
desired? (I honestly don't know enough about ob1 to say)

Or should we just be assigning a specific state, rather than relying
on subtracting? That was my real question.

> On Mon, 23 Jun 2008, Jeff Squyres wrote:
>> I see in a few places in ob1 we do things like this:
>> OPAL_THREAD_ADD32(&sendreq->req_state, -1);
>> Why do we do this? req_state is technically an enum value, so we
>> shouldn't be adding/subtracting to it (granted, it looks like the
>> enum values were carefully chosen to allow this). Additionally,
>> req_state is volatile; the atomics shouldn't be necessary.
>> Is there some other non-obvious reason?
>> Also, I see this in a few places:
>> req->req_state = 2;
>> which really should be
>> req->req_state = OMPI_REQUEST_ACTIVE;
> _______________________________________________
> devel mailing list
> devel_at_[hidden]

Jeff Squyres
Cisco Systems