1
1

We have two different version of ompi_request_complete. One as a function

another as a macro. Make it one inline function.

This commit was SVN r16495.
Этот коммит содержится в:
Gleb Natapov 2007-10-18 13:02:27 +00:00
родитель e0a3a7e53e
Коммит 4f865e22e8
4 изменённых файлов: 18 добавлений и 28 удалений

Просмотреть файл

@ -79,14 +79,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_request_t);
/* /*
* Mark the MPI request as completed and trigger the condition if required. * Mark the MPI request as completed and trigger the condition if required.
*/ */
#define MCA_PML_BASE_REQUEST_MPI_COMPLETE( request ) \ #define MCA_PML_BASE_REQUEST_MPI_COMPLETE(req) ompi_request_complete(req)
do { \
(request)->req_complete = true; \
ompi_request_completed++; \
if(ompi_request_waiting) { \
opal_condition_broadcast(&ompi_request_cond); \
} \
} while(0)
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
} }

Просмотреть файл

@ -179,7 +179,9 @@ int ompi_grequest_complete(ompi_request_t *req)
{ {
int rc; int rc;
OPAL_THREAD_LOCK(&ompi_request_lock);
rc = ompi_request_complete(req); rc = ompi_request_complete(req);
OPAL_THREAD_LOCK(&ompi_request_lock);
OBJ_RELEASE(req); OBJ_RELEASE(req);
return rc; return rc;
} }

Просмотреть файл

@ -157,16 +157,3 @@ int ompi_request_finalize(void)
OBJ_DESTRUCT( &ompi_request_f_to_c_table ); OBJ_DESTRUCT( &ompi_request_f_to_c_table );
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
int ompi_request_complete(ompi_request_t* request)
{
OPAL_THREAD_LOCK(&ompi_request_lock);
ompi_request_completed++;
request->req_complete = true;
if(ompi_request_waiting)
opal_condition_signal(&ompi_request_cond);
OPAL_THREAD_UNLOCK(&ompi_request_lock);
return OMPI_SUCCESS;
}

Просмотреть файл

@ -211,13 +211,6 @@ static inline int ompi_request_cancel(ompi_request_t* request)
} }
/**
* Signal a request as complete. Note this will
* wake any thread pending on the request.
*/
OMPI_DECLSPEC int ompi_request_complete(ompi_request_t* request);
/** /**
* Free a request. * Free a request.
* *
@ -392,6 +385,21 @@ static inline void ompi_request_wait_completion(ompi_request_t *req)
} }
} }
/**
* Signal a request as complete. Note this will
* wake any thread pending on the request.
* ompi_request_lock should be held while calling this function
*/
static inline int ompi_request_complete(ompi_request_t* request)
{
ompi_request_completed++;
request->req_complete = true;
if(ompi_request_waiting)
opal_condition_signal(&ompi_request_cond);
return OMPI_SUCCESS;
}
END_C_DECLS END_C_DECLS
#endif #endif