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
......@@ -54,6 +54,7 @@ int MPI_Type_contiguous(int count,
static const char FCNAME[] = "MPI_Type_contiguous";
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *new_dtp;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CONTIGUOUS);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -62,6 +62,7 @@ int MPI_Type_create_hindexed(int count,
MPID_Datatype *new_dtp;
int i, *ints;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CREATE_HINDEXED);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -60,6 +60,7 @@ int MPI_Type_create_hvector(int count,
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *new_dtp;
int ints[2];
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CREATE_HVECTOR);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -83,6 +83,7 @@ int MPI_Type_create_indexed_block(int count,
MPID_Datatype *new_dtp;
int i, *ints;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CREATE_INDEXED_BLOCK);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -57,6 +57,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype,
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *new_dtp;
MPI_Aint aints[2];
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CREATE_RESIZED);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -63,6 +63,7 @@ int MPI_Type_create_struct(int count,
int i, *ints;
MPID_Datatype *new_dtp;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_CREATE_STRUCT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -51,6 +51,7 @@ int MPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype)
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *datatype_ptr = NULL;
MPID_Datatype *new_dtp;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_DUP);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -60,6 +60,7 @@ int MPI_Type_free(MPI_Datatype *datatype)
{
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *datatype_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_FREE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -58,6 +58,7 @@ int MPI_Type_get_contents(MPI_Datatype datatype,
static const char FCNAME[] = "MPI_Type_get_contents";
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *datatype_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_GET_CONTENTS);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -87,6 +87,7 @@ int MPI_Type_hindexed(int count,
MPID_Datatype *new_dtp;
int i, *ints;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_HINDEXED);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -55,6 +55,7 @@ int MPI_Type_hvector(int count,
int mpi_errno = MPI_SUCCESS;
MPID_Datatype *new_dtp;
int ints[2];
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_HVECTOR);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -84,6 +84,7 @@ int MPI_Type_indexed(int count,
MPID_Datatype *new_dtp;
int i, *ints;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_INDEXED);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -103,6 +103,7 @@ int MPI_Type_struct(int count,
static const char FCNAME[] = "MPI_Type_struct";
int mpi_errno = MPI_SUCCESS;
MPIU_CHKLMEM_DECL(1);
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_STRUCT);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -56,6 +56,7 @@ int MPI_Type_vector(int count,
{
static const char FCNAME[] = "MPI_Type_vector";
int mpi_errno = MPI_SUCCESS;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_VECTOR);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -48,6 +48,7 @@ int MPI_Add_error_class(int *errorclass)
static const char FCNAME[] = "MPI_Add_error_class";
int mpi_errno = MPI_SUCCESS;
int new_class;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ADD_ERROR_CLASS);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -51,6 +51,7 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
static const char FCNAME[] = "MPI_Add_error_code";
int mpi_errno = MPI_SUCCESS;
int new_code;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ADD_ERROR_CODE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -60,6 +60,7 @@ int MPI_Add_error_string(int errorcode, char *string)
{
static const char FCNAME[] = "MPI_Add_error_string";
int mpi_errno = MPI_SUCCESS;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ADD_ERROR_STRING);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -52,6 +52,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *function,
static const char FCNAME[] = "MPI_Comm_create_errhandler";
int mpi_errno = MPI_SUCCESS;
MPID_Errhandler *errhan_ptr;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_CREATE_ERRHANDLER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -52,6 +52,7 @@ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler)
#endif
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_COMM_GET_ERRHANDLER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -51,6 +51,7 @@ int MPI_Errhandler_free(MPI_Errhandler *errhandler)
int mpi_errno = MPI_SUCCESS;
MPID_Errhandler *errhan_ptr = NULL;
int in_use;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ERRHANDLER_FREE);
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