Commit 41abeaa2 authored by William Gropp's avatar William Gropp
Browse files

[svn-r5355] Added (or moved) MPIU_THREADPRIV_DECL so that the thread-private...

[svn-r5355] Added (or moved) MPIU_THREADPRIV_DECL so that the thread-private area is acquired only once within a routine, since the data (pointer to the thread-private area) is fixed during the execution.  This reduces the overhead of the nest increment/decrement, for example
parent aa61523b
......@@ -76,6 +76,7 @@ int MPI_Buffer_attach(void *buffer, int size)
{
static const char FCNAME[] = "MPI_Buffer_attach";
int mpi_errno = MPI_SUCCESS;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_BUFFER_ATTACH);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -93,6 +93,7 @@ int MPI_Buffer_detach(void *buffer, int *size)
{
static const char FCNAME[] = "MPI_Buffer_detach";
int mpi_errno = MPI_SUCCESS;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_BUFFER_DETACH);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -64,6 +64,7 @@ int MPI_Cancel(MPI_Request *request)
static const char FCNAME[] = "MPI_Cancel";
int mpi_errno = MPI_SUCCESS;
MPID_Request * request_ptr;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_CANCEL);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -117,7 +118,6 @@ int MPI_Cancel(MPI_Request *request)
else
{
/* This is needed for persistent Bsend requests */
MPIU_THREADPRIV_DECL;
MPIU_THREADPRIV_GET;
MPIR_Nest_incr();
{
......@@ -155,7 +155,6 @@ int MPI_Cancel(MPI_Request *request)
case MPID_UREQUEST:
{
MPIU_THREADPRIV_DECL;
MPIU_THREADPRIV_GET;
MPIR_Nest_incr();
{
......
......@@ -54,6 +54,7 @@ int MPI_Grequest_complete( MPI_Request request )
#endif
int mpi_errno = MPI_SUCCESS;
MPID_Request *request_ptr;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GREQUEST_COMPLETE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -101,6 +101,7 @@ int MPI_Grequest_start( MPI_Grequest_query_function *query_fn,
static const char FCNAME[] = "MPI_Grequest_start";
int mpi_errno = MPI_SUCCESS;
MPID_Request *lrequest_ptr;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GREQUEST_START);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -58,6 +58,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
static const char FCNAME[] = "MPI_Iprobe";
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_IPROBE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -62,6 +62,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_IRECV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -63,6 +63,7 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_IRSEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -61,6 +61,7 @@ int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -62,6 +62,7 @@ int MPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ISSEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -54,6 +54,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
static const char FCNAME[] = "MPI_Probe";
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_PROBE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -68,6 +68,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request * request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_RECV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -64,6 +64,7 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_RECV_INIT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -66,6 +66,7 @@ int MPI_Request_free(MPI_Request *request)
static const char FCNAME[] = "MPI_Request_free";
int mpi_errno = MPI_SUCCESS;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_REQUEST_FREE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -59,6 +59,7 @@ int MPI_Rsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request * request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_RSEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -64,6 +64,7 @@ int MPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, int dest,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_RSEND_INIT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -64,6 +64,7 @@ int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request * request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_SEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -64,6 +64,7 @@ int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request *request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_SEND_INIT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -73,6 +73,7 @@ int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPID_Comm *comm_ptr = NULL;
MPID_Request * sreq;
MPID_Request * rreq;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_SENDRECV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -58,6 +58,7 @@ int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Request * request_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_SSEND);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment