Typedefs | |
| typedef struct tmpi_comm_ * | MPI_Comm |
| typedef struct tmpi_datatype_ * | MPI_Datatype |
| typedef struct tmpi_group_ * | MPI_Group |
| typedef tMPI_Op | MPI_Op |
| typedef struct tmpi_req_ * | MPI_Request |
| typedef struct tmpi_status_ | MPI_Status |
| typedef struct PLMD::thread_mpi::tMPI_Atomic_ptr | tMPI_Atomic_ptr_t |
| Atomic pointer type equivalent to tMPI_Atomic_t. | |
| typedef struct PLMD::thread_mpi::tMPI_Atomic | tMPI_Atomic_t |
| Atomic operations datatype. | |
| typedef struct tMPI_Barrier_t | tMPI_Barrier_t |
| typedef int | tmpi_bool |
| typedef struct tmpi_comm_ * | tMPI_Comm |
| tMPI Communicator | |
| typedef struct tmpi_datatype_ * | tMPI_Datatype |
| tMPI datatype | |
| typedef struct tmpi_datatype_ | tmpi_dt |
| typedef struct tmpi_errhandler_ * | tMPI_Errhandler |
| error handler object | |
| typedef void(* | tMPI_Errhandler_fn) (tMPI_Comm *, int *) |
| error handler function | |
| typedef struct tMPI_Event_t | tMPI_Event |
| typedef struct tmpi_group_ * | tMPI_Group |
| tMPI Group | |
| typedef struct tMPI_Lock | tMPI_Lock_t |
| typedef void(* | tMPI_Op_fn) (void *, const void *, const void *, int) |
| typedef struct tmpi_req_ * | tMPI_Request |
| tMPI Request | |
| typedef struct tMPI_Spinlock * | tMPI_Spinlock_t |
| Spinlock. | |
| typedef struct PLMD::thread_mpi::tMPI_Stack_element | tMPI_Stack_element |
| A single element in stack. | |
| typedef struct PLMD::thread_mpi::tmpi_status_ | tMPI_Status |
| tMPI Status. | |
| typedef struct tMPI_Thread * | tMPI_Thread_t |
Enumerations | |
| enum | { TMPI_SUCCESS = 0 , TMPI_ERR_NO_MEM , TMPI_ERR_IO , TMPI_ERR_INIT , TMPI_ERR_FINALIZE , TMPI_ERR_GROUP , TMPI_ERR_COMM , TMPI_ERR_STATUS , TMPI_ERR_GROUP_RANK , TMPI_ERR_DIMS , TMPI_ERR_COORDS , TMPI_ERR_CART_CREATE_NPROCS , TMPI_ERR_XFER_COUNTERPART , TMPI_ERR_XFER_BUFSIZE , TMPI_ERR_XFER_BUF_OVERLAP , TMPI_ERR_SEND_DEST , TMPI_ERR_RECV_SRC , TMPI_ERR_BUF , TMPI_ERR_MULTI_MISMATCH , TMPI_ERR_OP_FN , TMPI_ERR_ENVELOPES , TMPI_ERR_REQUESTS , TMPI_ERR_COPY_NBUFFERS , TMPI_ERR_COPY_BUFFER_SIZE , TMPI_ERR_IN_STATUS , TMPI_ERR_PROCNR , TMPI_FAILURE , TMPI_ERR_TYPE , TMPI_ERR_UNKNOWN , N_TMPI_ERR } |
| Error codes. More... | |
| enum | envelope_state { env_unmatched = 0 , env_copying = 1 , env_cb_available = 2 , env_finished = 3 } |
| enum | tMPI_Affinity_strategy { TMPI_AFFINITY_NONE = 0 , TMPI_AFFINITY_ALL_CORES } |
| enum | tMPI_Op { TMPI_MAX , TMPI_MIN , TMPI_SUM , TMPI_PROD , TMPI_LAND , TMPI_BAND , TMPI_LOR , TMPI_BOR , TMPI_LXOR , TMPI_BXOR } |
| tMPI_Reduce operators. More... | |
Functions | |
| int | main (int argc, char **argv) |
| TMPI_EXPORT int | tMPI_Atomic_add_return (tMPI_Atomic_t *a, int i) |
| Add integer to atomic variable. | |
| TMPI_EXPORT int | tMPI_Atomic_cas (tMPI_Atomic_t *a, int old_val, int new_val) |
| Atomic compare-and-swap operation. | |
| TMPI_EXPORT int | tMPI_Atomic_fetch_add (tMPI_Atomic_t *a, int i) |
| Add to variable, return the old value. | |
| TMPI_EXPORT int | tMPI_Atomic_get (const tMPI_Atomic_t *a) |
| Return value of an atomic integer. | |
| TMPI_EXPORT int | tMPI_Atomic_ptr_cas (tMPI_Atomic_ptr_t *a, void *old_val, void *new_val) |
| Atomic pointer compare-and-swap operation. | |
| TMPI_EXPORT void * | tMPI_Atomic_ptr_get (const tMPI_Atomic_ptr_t *a) |
| Return value of an atomic pointer. | |
| TMPI_EXPORT void | tMPI_Atomic_ptr_set (tMPI_Atomic_ptr_t *a, void *p) |
| Write value to an atomic pointer. | |
| TMPI_EXPORT void * | tMPI_Atomic_ptr_swap (tMPI_Atomic_ptr_t *a, void *b) |
| Atomic swap pointer operation. | |
| TMPI_EXPORT void | tMPI_Atomic_set (tMPI_Atomic_t *a, int i) |
| Write value to an atomic integer. | |
| TMPI_EXPORT int | tMPI_Atomic_swap (tMPI_Atomic_t *a, int b) |
| Atomic swap operation. | |
| TMPI_EXPORT void | tMPI_Barrier_init (tMPI_Barrier_t *barrier, int count) |
| Initialize barrier. | |
| TMPI_EXPORT int | tMPI_Barrier_wait (tMPI_Barrier_t *barrier) |
| Perform yielding, busy-waiting barrier synchronization. | |
| TMPI_EXPORT void * | tMPI_Calloc_local (size_t nmemb, size_t size) |
| Allocate local memory by array and element size. | |
| void | tMPI_Cart_destroy (struct cart_topol *top) |
| void | tMPI_Coll_env_destroy (struct coll_env *mev) |
| int | tMPI_Coll_env_init (struct coll_env *mev, int N) |
| void | tMPI_Coll_root_xfer (tMPI_Comm comm, tMPI_Datatype sendtype, tMPI_Datatype recvtype, size_t sendsize, size_t recvsize, void *sendbuf, void *recvbuf, int *ret) |
| void | tMPI_Coll_sync_destroy (struct coll_sync *msc) |
| int | tMPI_Coll_sync_init (struct coll_sync *msc, int N) |
| int | tMPI_Comm_alloc (tMPI_Comm *newcomm, tMPI_Comm parent, int N) |
| int | tMPI_Comm_destroy (tMPI_Comm comm, tmpi_bool do_link_lock) |
| int | tMPI_Comm_N (tMPI_Comm comm) |
| int | tMPI_Comm_seek_rank (tMPI_Comm comm, struct tmpi_thread *th) |
| int | tMPI_Error (tMPI_Comm comm, int tmpi_errno) |
| void | tmpi_errors_are_fatal_fn (tMPI_Comm *comm, int *err) |
| void | tmpi_errors_return_fn (tMPI_Comm *comm, int *err) |
| TMPI_EXPORT void | tMPI_Event_destroy (tMPI_Event *ev) |
| Deallocate the internals of the contents of event object. | |
| TMPI_EXPORT void | tMPI_Event_init (tMPI_Event *ev) |
| Initialize the event object. | |
| TMPI_EXPORT int | tMPI_Event_wait (tMPI_Event *ev) |
| Wait for an event to occur. | |
| TMPI_EXPORT void | tMPI_Fatal_error (const char *file, int line, const char *message,...) |
| handle a fatal error. | |
| void | tMPI_Free (void *p) |
| void | tMPI_Free_env_list_destroy (struct free_envelope_list *evl) |
| int | tMPI_Free_env_list_init (struct free_envelope_list *evl, int N) |
| TMPI_EXPORT int | tMPI_Free_numa (void *ptr) |
| Free memory allocate with any of the NUMA-aware allocators. | |
| struct coll_env * | tMPI_Get_cev (tMPI_Comm comm, int myrank, int *synct) |
| tMPI_Comm | tMPI_Get_comm_self (void) |
| TMPI_EXPORT int | tMPI_Get_hw_nthreads (void) |
| TMPI_EXPORT int | tMPI_Get_recommended_nthreads (void) |
| Determine the recommended number of hardware threads to run on. | |
| struct tmpi_req_ * | tMPI_Get_req (struct req_list *rl) |
| tMPI_Group | tMPI_Group_alloc (void) |
| tmpi_bool | tMPI_In_group (tMPI_Group group) |
| tmpi_bool | tMPI_Is_master (void) |
| TMPI_EXPORT void | tMPI_Lock_init (tMPI_Lock_t *lock) |
| Initialize lock. | |
| TMPI_EXPORT int | tMPI_Lock_islocked (tMPI_Lock_t *lock) |
| Check the status of the lock without affecting its state. | |
| TMPI_EXPORT void | tMPI_Lock_lock (tMPI_Lock_t *lock) |
| Perform yielding, busy-waiting locking. | |
| TMPI_EXPORT int | tMPI_Lock_trylock (tMPI_Lock_t *lock) |
| Try to lock the lock but don't block if it is locked. | |
| TMPI_EXPORT void | tMPI_Lock_unlock (tMPI_Lock_t *lock) |
| Unlock the lock. | |
| void * | tMPI_Malloc (size_t size) |
| TMPI_EXPORT void * | tMPI_Malloc_local (size_t size) |
| Allocate local memory by size in bytes. | |
| void | tMPI_Mult_recv (tMPI_Comm comm, struct coll_env *cev, int rank, int index, int expected_tag, tMPI_Datatype recvtype, size_t recvsize, void *recvbuf, int *ret) |
| TMPI_EXPORT int | tMPI_Once (tMPI_Comm comm, void(*function)(void *), void *param, int *was_first) |
| TMPI_EXPORT void * | tMPI_Once_wait (tMPI_Comm comm, void *(*function)(void *), void *param, int *was_first) |
| Execute function once over comm, and wait for the function to return its value. | |
| struct envelope * | tMPI_Post_match_recv (struct tmpi_thread *cur, tMPI_Comm comm, struct tmpi_thread *src, void *recv_buf, int recv_count, tMPI_Datatype datatype, int tag, tmpi_bool nonblock) |
| int | tMPI_Post_multi (struct coll_env *cev, int myrank, int index, int tag, tMPI_Datatype datatype, size_t bufsize, void *buf, int n_remaining, int synct, int dest) |
| struct envelope * | tMPI_Post_send (struct tmpi_thread *cur, tMPI_Comm comm, struct tmpi_thread *dest, void *send_buf, int send_count, tMPI_Datatype datatype, int tag, tmpi_bool nonblock) |
| void * | tMPI_Realloc (void *p, size_t size) |
| TMPI_EXPORT void * | tMPI_Realloc_local (void *ptr, size_t size) |
| Re-allocate to local memory. | |
| void | tMPI_Recv_env_list_destroy (struct recv_envelope_list *evl) |
| int | tMPI_Recv_env_list_init (struct recv_envelope_list *evl) |
| TMPI_EXPORT tMPI_Reduce_req * | tMPI_Reduce_req_alloc (tMPI_Comm comm) |
| Allocate data structure for asynchronous reduce. | |
| int | tMPI_Reduce_run_op (void *dest, const void *src_a, const void *src_b, tMPI_Datatype datatype, int count, tMPI_Op op, tMPI_Comm comm) |
| void | tMPI_Req_init (struct tmpi_req_ *rq, struct envelope *ev) |
| void | tMPI_Req_list_destroy (struct req_list *rl) |
| int | tMPI_Req_list_init (struct req_list *rl, int N_reqs) |
| void | tMPI_Return_req (struct req_list *rl, struct tmpi_req_ *req) |
| void | tMPI_Send_env_list_destroy (struct send_envelope_list *evl) |
| int | tMPI_Send_env_list_init (struct send_envelope_list *evl, int N) |
| void | tMPI_Set_status (struct tmpi_req_ *req, tMPI_Status *st) |
| TMPI_EXPORT void * | tMPI_Shmalloc (tMPI_Comm comm, size_t size) |
| Allocate a shared block of memory as a collective call. | |
| TMPI_EXPORT void | tMPI_Spinlock_init (tMPI_Spinlock_t *x) |
| Initialize spinlock. | |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static TMPI_EXPORT int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| static int | tMPI_Spinlock_islocked (const tMPI_Spinlock_t *x) |
| TMPI_EXPORT int | tMPI_Spinlock_islocked (tMPI_Spinlock_t *x) |
| Check if spinlock is locked. | |
| TMPI_EXPORT void | tMPI_Spinlock_lock (tMPI_Spinlock_t *x) |
| Acquire spinlock. | |
| TMPI_EXPORT int | tMPI_Spinlock_trylock (tMPI_Spinlock_t *x) |
| Attempt to acquire spinlock. | |
| TMPI_EXPORT void | tMPI_Spinlock_unlock (tMPI_Spinlock_t *x) |
| Release spinlock. | |
| TMPI_EXPORT void | tMPI_Spinlock_wait (tMPI_Spinlock_t *x) |
| Wait for a spinlock to become available. | |
| TMPI_EXPORT void | tMPI_Stack_destroy (tMPI_Stack *st) |
| Deallocates a stack. | |
| TMPI_EXPORT tMPI_Stack_element * | tMPI_Stack_detach (tMPI_Stack *st) |
| Detaches entire stack for use by a single thread. | |
| TMPI_EXPORT void | tMPI_Stack_init (tMPI_Stack *st) |
| Initialize a stack. | |
| TMPI_EXPORT tMPI_Stack_element * | tMPI_Stack_pop (tMPI_Stack *st) |
| Pops a stack element from a stack. | |
| TMPI_EXPORT void | tMPI_Stack_push (tMPI_Stack *st, tMPI_Stack_element *el) |
| Pushes a stack element onto a stack. | |
| tmpi_bool | tMPI_Test_multi (struct tmpi_thread *cur, struct tmpi_req_ *rqs, tmpi_bool *any_done) |
| tmpi_bool | tMPI_Test_single (struct tmpi_thread *cur, struct tmpi_req_ *rq) |
| void | tMPI_Wait_for_data (struct tmpi_thread *cur, struct coll_env *cev, int myrank) |
| void | tMPI_Wait_for_others (struct coll_env *cev, int myrank) |
| void | tMPI_Wait_process_incoming (struct tmpi_thread *th) |
| void | tMPI_Wait_single (struct tmpi_thread *cur, struct tmpi_req_ *rq) |
Initialization and exit functions | |
| TMPI_EXPORT int | tMPI_Init (int *argc, char ***argv, int(*start_function)(int, char **)) |
| Traditional MPI initializer; spawns threads that start at the given function. | |
| TMPI_EXPORT int | tMPI_Init_fn (int main_thread_returns, int N, tMPI_Affinity_strategy aff_strategy, void(*start_function)(const void *), const void *arg) |
| Generic init function thread MPI intializer and thread spawner. | |
| TMPI_EXPORT int | tMPI_Get_N (int *argc, char ***argv, const char *optname, int *nthreads) |
| get the number of threads from the command line | |
| TMPI_EXPORT int | tMPI_Finalize (void) |
| Waits for all other threads to finish and cleans up. | |
| TMPI_EXPORT int | tMPI_Abort (tMPI_Comm comm, int errorcode) |
| Just kills all threads. | |
| TMPI_EXPORT int | tMPI_Initialized (int *flag) |
| whether tMPI_Init, but not yet tMPI_Finalize, has been run | |
| TMPI_EXPORT int | tMPI_Finalized (int *flag) |
| Determine whether tMPI_Finalize has been run. | |
Error handling functions | |
| TMPI_EXPORT int | tMPI_Create_errhandler (tMPI_Errhandler_fn *function, tMPI_Errhandler *errhandler) |
| Create an error handler object from a function. | |
| TMPI_EXPORT int | tMPI_Errhandler_free (tMPI_Errhandler *errhandler) |
| Free the error handler object. | |
| TMPI_EXPORT int | tMPI_Comm_set_errhandler (tMPI_Comm comm, tMPI_Errhandler errhandler) |
| Set the error handler. | |
| TMPI_EXPORT int | tMPI_Comm_get_errhandler (tMPI_Comm comm, tMPI_Errhandler *errhandler) |
| get the error handler. | |
| TMPI_EXPORT int | tMPI_Error_string (int errorcode, char *string, int *resultlen) |
| get the error string associated with an error code. | |
Environment query functions | |
| TMPI_EXPORT int | tMPI_Get_processor_name (char *name, int *resultlen) |
| returns string with thread number. | |
| TMPI_EXPORT double | tMPI_Wtime (void) |
| get a time value as a double, in seconds. | |
| TMPI_EXPORT double | tMPI_Wtick (void) |
| get the resolution of tMPI_Wtime as a double, in seconds | |
tMPI_Group functions | |
| TMPI_EXPORT int | tMPI_Group_size (tMPI_Group group, int *size) |
| Get the size (number of members) of a group. | |
| TMPI_EXPORT int | tMPI_Group_rank (tMPI_Group group, int *rank) |
| Get the rank of a thread in a group. | |
| TMPI_EXPORT int | tMPI_Group_incl (tMPI_Group group, int n, const int *ranks, tMPI_Group *newgroup) |
| Create a new group as a the collection of threads with given ranks. | |
| TMPI_EXPORT int | tMPI_Comm_group (tMPI_Comm comm, tMPI_Group *group) |
| Get a pointer to the group in the comm. | |
| TMPI_EXPORT int | tMPI_Group_free (tMPI_Group *group) |
| De-allocate a group. | |
tMPI_Comm functions | |
| TMPI_EXPORT int | tMPI_Comm_size (tMPI_Comm comm, int *size) |
| Get the comm size (nr. | |
| TMPI_EXPORT int | tMPI_Comm_rank (tMPI_Comm comm, int *rank) |
| get the rank in comm of the current process | |
| TMPI_EXPORT int | tMPI_Comm_compare (tMPI_Comm comm1, tMPI_Comm comm2, int *result) |
| Compare two comms. | |
| TMPI_EXPORT int | tMPI_Comm_free (tMPI_Comm *comm) |
| De-allocate a comm. | |
| TMPI_EXPORT int | tMPI_Comm_create (tMPI_Comm comm, tMPI_Group group, tMPI_Comm *newcomm) |
| Create a comm based on group membership. | |
| TMPI_EXPORT int | tMPI_Comm_split (tMPI_Comm comm, int color, int key, tMPI_Comm *newcomm) |
| Split up a group into same-colored sub-groups ordered by key. | |
| TMPI_EXPORT int | tMPI_Comm_dup (tMPI_Comm comm, tMPI_Comm *newcomm) |
| Make a duplicate of a comm. | |
Topology functions | |
| TMPI_EXPORT int | tMPI_Topo_test (tMPI_Comm comm, int *status) |
| Check what type of topology the comm has. | |
| TMPI_EXPORT int | tMPI_Cartdim_get (tMPI_Comm comm, int *ndims) |
| Get the dimensionality of a comm with a topology. | |
| TMPI_EXPORT int | tMPI_Cart_get (tMPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) |
| Get the size and pbc a of a comm with a Cartesian topology has. | |
| TMPI_EXPORT int | tMPI_Cart_rank (tMPI_Comm comm, const int *coords, int *rank) |
| Get rank that a specific set of process coordinates has in a Cartesian topology. | |
| TMPI_EXPORT int | tMPI_Cart_coords (tMPI_Comm comm, int rank, int maxdims, int *coords) |
| Get coordinates of a process rank in a Cartesian topology. | |
| TMPI_EXPORT int | tMPI_Cart_map (tMPI_Comm comm, int ndims, const int *dims, const int *periods, int *newrank) |
| Get optimal rank this process would have in a Cartesian topology. | |
| TMPI_EXPORT int | tMPI_Cart_create (tMPI_Comm comm_old, int ndims, const int *dims, const int *periods, int reorder, tMPI_Comm *comm_cart) |
| Create a comm with a Cartesian topology. | |
| TMPI_EXPORT int | tMPI_Cart_sub (tMPI_Comm comm, const int *remain_dims, tMPI_Comm *newcomm) |
| Create a comms that are sub-spaces of the Cartesian topology communicator. | |
Data type manipulation functions | |
| TMPI_EXPORT int | tMPI_Type_contiguous (int count, tMPI_Datatype oldtype, tMPI_Datatype *newtype) |
| Create a contiguous data type (the only type possible right now). | |
| TMPI_EXPORT int | tMPI_Type_commit (tMPI_Datatype *datatype) |
| Make a data type ready for use. | |
| TMPI_EXPORT int | tMPI_Type_free (tMPI_Datatype *datatype) |
| Free the datatype. | |
Point-to-point communication functions | |
| TMPI_EXPORT int | tMPI_Send (const void *buf, int count, tMPI_Datatype datatype, int dest, int tag, tMPI_Comm comm) |
| Send message; blocks until buf is reusable. | |
| TMPI_EXPORT int | tMPI_Recv (void *buf, int count, tMPI_Datatype datatype, int source, int tag, tMPI_Comm comm, tMPI_Status *status) |
| Receive message; blocks until buf is filled. | |
| TMPI_EXPORT int | tMPI_Sendrecv (const void *sendbuf, int sendcount, tMPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, tMPI_Datatype recvtype, int source, int recvtag, tMPI_Comm comm, tMPI_Status *status) |
| Send & receive message at the same time. | |
| TMPI_EXPORT int | tMPI_Isend (const void *buf, int count, tMPI_Datatype datatype, int dest, int tag, tMPI_Comm comm, tMPI_Request *request) |
| Initiate sending a message, non-blocking. | |
| TMPI_EXPORT int | tMPI_Irecv (void *buf, int count, tMPI_Datatype datatype, int source, int tag, tMPI_Comm comm, tMPI_Request *request) |
| Initiate receiving a message. | |
| TMPI_EXPORT int | tMPI_Test (tMPI_Request *request, int *flag, tMPI_Status *status) |
| Test whether a message is transferred. | |
| TMPI_EXPORT int | tMPI_Wait (tMPI_Request *request, tMPI_Status *status) |
| Wait until a message is transferred. | |
| TMPI_EXPORT int | tMPI_Waitall (int count, tMPI_Request *array_of_requests, tMPI_Status *array_of_statuses) |
| Wait until several messages are transferred. | |
| TMPI_EXPORT int | tMPI_Testall (int count, tMPI_Request *array_of_requests, int *flag, tMPI_Status *array_of_statuses) |
| Test whether several messages are transferred. | |
| TMPI_EXPORT int | tMPI_Waitany (int count, tMPI_Request *array_of_requests, int *index, tMPI_Status *status) |
| Wait until one of several messages is transferred. | |
| TMPI_EXPORT int | tMPI_Testany (int count, tMPI_Request *array_of_requests, int *index, int *flag, tMPI_Status *status) |
| Test whether one of several messages is transferred. | |
| TMPI_EXPORT int | tMPI_Waitsome (int incount, tMPI_Request *array_of_requests, int *outcount, int *array_of_indices, tMPI_Status *array_of_statuses) |
| Wait until some of several messages are transferred. | |
| TMPI_EXPORT int | tMPI_Testsome (int incount, tMPI_Request *array_of_requests, int *outcount, int *array_of_indices, tMPI_Status *array_of_statuses) |
| Test whether some of several messages are transferred. | |
| TMPI_EXPORT int | tMPI_Get_count (const tMPI_Status *status, tMPI_Datatype datatype, int *count) |
| get the number of actually transferred items from a receive status. | |
Synchronization functions | |
| TMPI_EXPORT int | tMPI_Barrier (tMPI_Comm comm) |
| Block until all threads in the comm call this function. | |
Multicast communication functions | |
| TMPI_EXPORT int | tMPI_Bcast (void *buffer, int count, tMPI_Datatype datatype, int root, tMPI_Comm comm) |
| Broadcast from one thread to all others in comm. | |
| TMPI_EXPORT int | tMPI_Gather (const void *sendbuf, int sendcount, tMPI_Datatype sendtype, void *recvbuf, int recvcount, tMPI_Datatype recvtype, int root, tMPI_Comm comm) |
| Gather data from all threads in comm to root. | |
| TMPI_EXPORT int | tMPI_Gatherv (const void *sendbuf, int sendcount, tMPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, tMPI_Datatype recvtype, int root, tMPI_Comm comm) |
| Gather irregularly laid out data from all processes in comm to root. | |
| TMPI_EXPORT int | tMPI_Scatter (const void *sendbuf, int sendcount, tMPI_Datatype sendtype, void *recvbuf, int recvcount, tMPI_Datatype recvtype, int root, tMPI_Comm comm) |
| Spread parts of sendbuf to all processes in comm from root. | |
| TMPI_EXPORT int | tMPI_Scatterv (const void *sendbuf, const int *sendcounts, const int *displs, tMPI_Datatype sendtype, void *recvbuf, int recvcount, tMPI_Datatype recvtype, int root, tMPI_Comm comm) |
| Spread irregularly laid out parts of sendbuf to all processes in comm from root. | |
| TMPI_EXPORT int | tMPI_Alltoall (const void *sendbuf, int sendcount, tMPI_Datatype sendtype, void *recvbuf, int recvcount, tMPI_Datatype recvtype, tMPI_Comm comm) |
| Spread out parts of sendbuf to all processes from all processes in comm. | |
| TMPI_EXPORT int | tMPI_Alltoallv (const void *sendbuf, const int *sendcounts, const int *sdispls, tMPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *rdispls, tMPI_Datatype recvtype, tMPI_Comm comm) |
| Spread out irregularly laid out parts of sendbuf to all processes from all processes in comm. | |
Reduce functions | |
| TMPI_EXPORT int | tMPI_Reduce (const void *sendbuf, void *recvbuf, int count, tMPI_Datatype datatype, tMPI_Op op, int root, tMPI_Comm comm) |
| Do an operation between all locally held buffers on all items in the buffers, and send the results to root. | |
| TMPI_EXPORT int | tMPI_Allreduce (const void *sendbuf, void *recvbuf, int count, tMPI_Datatype datatype, tMPI_Op op, tMPI_Comm comm) |
| Do an operation between all locally held buffers on all items in the buffers and broadcast the results. | |
| TMPI_EXPORT int | tMPI_Reduce_fast (const void *sendbuf, void *recvbuf, int count, tMPI_Datatype datatype, tMPI_Op op, int root, tMPI_Comm comm) |
| Do an tMPI_Reduce, but with the following assumption: recvbuf points to a valid buffer in all calling threads, or sendbuf has the value TMPI_IN_PLACE (in which case the values of sendbuf may be changed in that thread). | |
| TMPI_EXPORT int | tMPI_Scan (const void *sendbuf, void *recvbuf, int count, tMPI_Datatype datatype, tMPI_Op op, tMPI_Comm comm) |
| Do a partial reduce operation, based on rank: the results of the reduction operation of ranks 0 - i will be put in the recvbuf of rank i. | |
Mutexes | |
| TMPI_EXPORT int | tMPI_Thread_mutex_init (tMPI_Thread_mutex_t *mtx) |
| Initialize a new mutex. | |
| TMPI_EXPORT int | tMPI_Thread_mutex_destroy (tMPI_Thread_mutex_t *mtx) |
| Kill a mutex you no longer need. | |
| TMPI_EXPORT int | tMPI_Thread_mutex_lock (tMPI_Thread_mutex_t *mtx) |
| Wait for exclusive access to a mutex. | |
| TMPI_EXPORT int | tMPI_Thread_mutex_trylock (tMPI_Thread_mutex_t *mtx) |
| Try to lock a mutex, return if busy. | |
| TMPI_EXPORT int | tMPI_Thread_mutex_unlock (tMPI_Thread_mutex_t *mtx) |
| Release the exclusive access to a mutex. | |
Thread-specific storage | |
| TMPI_EXPORT int | tMPI_Thread_key_create (tMPI_Thread_key_t *key, void(*destructor)(void *)) |
| Initialize thread-specific-storage handle. | |
| TMPI_EXPORT int | tMPI_Thread_key_delete (tMPI_Thread_key_t key) |
| Delete thread-specific-storage handle. | |
| TMPI_EXPORT void * | tMPI_Thread_getspecific (tMPI_Thread_key_t key) |
| Get value for thread-specific-storage in this thread. | |
| TMPI_EXPORT int | tMPI_Thread_setspecific (tMPI_Thread_key_t key, void *value) |
| Set value for thread-specific-storage in this thread. | |
Run-once | |
| TMPI_EXPORT int | tMPI_Thread_once (tMPI_Thread_once_t *once_data, void(*init_routine)(void)) |
| Run the provided routine exactly once. | |
Condition variables | |
| TMPI_EXPORT int | tMPI_Thread_cond_init (tMPI_Thread_cond_t *cond) |
| Initialize condition variable. | |
| TMPI_EXPORT int | tMPI_Thread_cond_destroy (tMPI_Thread_cond_t *cond) |
| Destroy condition variable. | |
| TMPI_EXPORT int | tMPI_Thread_cond_wait (tMPI_Thread_cond_t *cond, tMPI_Thread_mutex_t *mtx) |
| Wait for a condition to be signaled. | |
| TMPI_EXPORT int | tMPI_Thread_cond_signal (tMPI_Thread_cond_t *cond) |
| Unblock one waiting thread. | |
| TMPI_EXPORT int | tMPI_Thread_cond_broadcast (tMPI_Thread_cond_t *cond) |
| Unblock all waiting threads. | |
Barriers | |
| TMPI_EXPORT int | tMPI_Thread_barrier_init (tMPI_Thread_barrier_t *barrier, int count) |
| Initialize a synchronization barrier type. | |
| TMPI_EXPORT int | tMPI_Thread_barrier_destroy (tMPI_Thread_barrier_t *barrier) |
| Release data in a barrier datatype. | |
| TMPI_EXPORT int | tMPI_Thread_barrier_wait (tMPI_Thread_barrier_t *barrier) |
| Perform barrier synchronization. | |
Thread creation, destruction, and inspection | |
| enum | tMPI_Thread_support { TMPI_THREAD_SUPPORT_NO = 0 , TMPI_THREAD_SUPPORT_YES = 1 } |
| Thread support status enumeration. More... | |
| enum | tMPI_Thread_setaffinity_support { TMPI_SETAFFINITY_SUPPORT_NO = 0 , TMPI_SETAFFINITY_SUPPORT_YES = 1 } |
| Thread setaffinity support status enumeration. More... | |
| TMPI_EXPORT int | tMPI_Thread_get_hw_number (void) |
| Get the number of hardware threads that can be run simultaneously. | |
| TMPI_EXPORT int | tMPI_Thread_create (tMPI_Thread_t *thread, void *(*start_routine)(void *), void *arg) |
| Create a new thread. | |
| TMPI_EXPORT int | tMPI_Thread_join (tMPI_Thread_t thread, void **value_ptr) |
| Wait for a specific thread to finish executing. | |
| TMPI_EXPORT void | tMPI_Thread_exit (void *value_ptr) |
| Terminate calling thread. | |
| TMPI_EXPORT int | tMPI_Thread_cancel (tMPI_Thread_t thread) |
| Ask a thread to exit. | |
| TMPI_EXPORT tMPI_Thread_t | tMPI_Thread_self (void) |
| Get a thread ID of the calling thread. | |
| TMPI_EXPORT int | tMPI_Thread_equal (tMPI_Thread_t t1, tMPI_Thread_t t2) |
| Check whether two thread pointers point to the same thread. | |
| TMPI_EXPORT int | tMPI_Thread_setaffinity_single (tMPI_Thread_t thread, unsigned int nr) |
| Set thread affinity to a single core. | |
| typedef struct tmpi_comm_* PLMD::thread_mpi::MPI_Comm |
| typedef struct tmpi_datatype_* PLMD::thread_mpi::MPI_Datatype |
| typedef struct tmpi_group_* PLMD::thread_mpi::MPI_Group |
| typedef tMPI_Op PLMD::thread_mpi::MPI_Op |
| typedef struct tmpi_req_* PLMD::thread_mpi::MPI_Request |
| typedef struct tmpi_status_ PLMD::thread_mpi::MPI_Status |
Atomic pointer type equivalent to tMPI_Atomic_t.
Useful for lock-free and wait-free data structures. The only operations available for this type are:
| typedef struct PLMD::thread_mpi::tMPI_Atomic PLMD::thread_mpi::tMPI_Atomic_t |
Atomic operations datatype.
Portable synchronization primitives like mutexes are effective for many purposes, but usually not very high performance. One of the problem is that you have the overhead of a function call, and another is that Mutexes often have extra overhead to make the scheduling fair. Finally, if performance is important we don't want to suspend the thread if we cannot lock a mutex, but spin-lock at 100% CPU usage until the resources is available (e.g. increment a counter).
These things can often be implemented with inline-assembly or other system-dependent functions, and we provide such functionality for the most common platforms. For portability we also have a fallback implementation using a mutex for locking.
Performance-wise, the fastest solution is always to avoid locking completely (obvious, but remember it!). If you cannot do that, the next best thing is to use atomic operations that e.g. increment a counter without explicit locking. Spinlocks are useful to lock an entire region, but leads to more overhead and can be difficult to debug - it is up to you to make sure that only the thread owning the lock unlocks it!
You should normally NOT use atomic operations for things like I/O threads. These should yield to other threads while waiting for the disk instead of spinning at 100% CPU usage.
It is imperative that you use the provided routines for reading and writing, since some implementations require memory barriers before the CPU or memory sees an updated result. The structure contents is only visible here so it can be inlined for performance - it might change without further notice.
Currently, we have (real) atomic operations for:
| typedef struct tMPI_Barrier_t PLMD::thread_mpi::tMPI_Barrier_t |
| typedef int PLMD::thread_mpi::tmpi_bool |
| typedef struct tmpi_comm_* PLMD::thread_mpi::tMPI_Comm |
tMPI Communicator
Holds the group of processes to communicate with, and defines the scope for global operations such as broadcast.
| typedef struct tmpi_datatype_* PLMD::thread_mpi::tMPI_Datatype |
tMPI datatype
tMPI data type structure. Holds info about datatypes.
| typedef struct tmpi_datatype_ PLMD::thread_mpi::tmpi_dt |
| typedef struct tmpi_errhandler_* PLMD::thread_mpi::tMPI_Errhandler |
error handler object
| typedef void(* PLMD::thread_mpi::tMPI_Errhandler_fn) (tMPI_Comm *, int *) |
error handler function
| typedef struct tMPI_Event_t PLMD::thread_mpi::tMPI_Event |
| typedef struct tmpi_group_* PLMD::thread_mpi::tMPI_Group |
tMPI Group
The group structure. Contains a list of threads.
| typedef struct tMPI_Lock PLMD::thread_mpi::tMPI_Lock_t |
| typedef void(* PLMD::thread_mpi::tMPI_Op_fn) (void *, const void *, const void *, int) |
| typedef struct tmpi_req_* PLMD::thread_mpi::tMPI_Request |
tMPI Request
Request structure for holding data about non-blocking transfers.
| typedef struct PLMD::thread_mpi::tMPI_Spinlock PLMD::thread_mpi::tMPI_Spinlock_t |
Spinlock.
Spinlocks provide a faster synchronization than mutexes, although they consume CPU-cycles while waiting. They are implemented with atomic operations and inline assembly whenever possible, and otherwise we use a fallback implementation where a spinlock is identical to a mutex (this is one of the reasons why you have to initialize them).
There are no guarantees whatsoever about fair scheduling or debugging if you make a mistake and unlock a variable somebody else has locked - performance is the primary goal of spinlocks.
| typedef struct PLMD::thread_mpi::tMPI_Stack_element PLMD::thread_mpi::tMPI_Stack_element |
A single element in stack.
| typedef struct PLMD::thread_mpi::tmpi_status_ PLMD::thread_mpi::tMPI_Status |
tMPI Status.
Holds status info (tag, sender, amount of data transmitted) for receives. The status object is user-maintained.
| typedef struct tMPI_Thread* PLMD::thread_mpi::tMPI_Thread_t |
| anonymous enum |
Error codes.
| Enumerator | |
|---|---|
| TMPI_SUCCESS | No error |
| TMPI_ERR_NO_MEM | Out of memory |
| TMPI_ERR_IO | I/O Error (used for system errors) |
| TMPI_ERR_INIT | Initialization error |
| TMPI_ERR_FINALIZE | Finalize error |
| TMPI_ERR_GROUP | Group error |
| TMPI_ERR_COMM | Comm error |
| TMPI_ERR_STATUS | Status error |
| TMPI_ERR_GROUP_RANK | Group rank error |
| TMPI_ERR_DIMS | Invalid topology dimensions |
| TMPI_ERR_COORDS | Invalid topology coordinates |
| TMPI_ERR_CART_CREATE_NPROCS | Not enough processes for topology |
| TMPI_ERR_XFER_COUNTERPART | Invalid counterpart for xfer |
| TMPI_ERR_XFER_BUFSIZE | buffer size too small |
| TMPI_ERR_XFER_BUF_OVERLAP | buffer overlaps (thread error?) |
| TMPI_ERR_SEND_DEST | Faulty send destination |
| TMPI_ERR_RECV_SRC | Faulty receive source |
| TMPI_ERR_BUF | Invalid buffer |
| TMPI_ERR_MULTI_MISMATCH | Comm not the same in collective call |
| TMPI_ERR_OP_FN | Invalid reduce operator |
| TMPI_ERR_ENVELOPES | out of envelopes (tMPI internal) |
| TMPI_ERR_REQUESTS | out of requests (tMPI internal) |
| TMPI_ERR_COPY_NBUFFERS | out of copy buffers (tMPI internal) |
| TMPI_ERR_COPY_BUFFER_SIZE | copy buffer size err (tMPI internal) |
| TMPI_ERR_IN_STATUS | error code in tMPI_Status |
| TMPI_ERR_PROCNR | Hardware processor number (such as for thread affinity) error |
| TMPI_FAILURE | Transmission failure |
| TMPI_ERR_TYPE | Invalid datatype argument |
| TMPI_ERR_UNKNOWN | Unknown error |
| N_TMPI_ERR | |
tMPI_Reduce operators.
These all work (except obviously bad combinations like bitwise and/or/xor on floats, etc):
| enum TMPI_EXPORT enum tMPI_Thread_setaffinity_support PLMD::thread_mpi::tMPI_Thread_setaffinity_support | ( | void | ) |
Thread setaffinity support status enumeration.
Check whether this platform supports setting of thread affinity.
This function returns TMPI_SETAFFINITY_SUPPORT_YES if setting thread affinity is supported by the platform, and TMPI_SETAFFINITY_SUPPORT_NO if not. If this function returns 0, the function tMPI_Thread_setaffinity_single will simply return 0 itself, effectively ignoring the request.
| Enumerator | |
|---|---|
| TMPI_SETAFFINITY_SUPPORT_NO | Setting thread affinity not supported |
| TMPI_SETAFFINITY_SUPPORT_YES | Setting thread affinity supported |
| enum TMPI_EXPORT enum tMPI_Thread_support PLMD::thread_mpi::tMPI_Thread_support | ( | void | ) |
Thread support status enumeration.
Check if threads are supported.
This routine provides a cleaner way to check if threads are supported instead of sprinkling your code with preprocessor conditionals.
All thread functions are still available even without thread support, but some of them might return failure error codes, for instance if you try to start a thread.
| Enumerator | |
|---|---|
| TMPI_THREAD_SUPPORT_NO | Starting threads will fail |
| TMPI_THREAD_SUPPORT_YES | Thread support available |
| int PLMD::thread_mpi::main | ( | int | argc, |
| char ** | argv ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Abort | ( | tMPI_Comm | comm, |
| int | errorcode ) |
Just kills all threads.
Not really neccesary because exit() would do that for us anyway.
| [in] | comm | Comm to kill threads for |
| [in] | errorcode | Error code to exit with |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Allreduce | ( | const void * | sendbuf, |
| void * | recvbuf, | ||
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| tMPI_Op | op, | ||
| tMPI_Comm | comm ) |
Do an operation between all locally held buffers on all items in the buffers and broadcast the results.
Collective function.
| [in] | sendbuf | The operand parameters. Any process may specify TMPI_IN_PLACE, in which case recvbuf will hold the operand parameters for that process. |
| [in,out] | recvbuf | The result buffer. |
| [in] | count | The number of items to do operation on. |
| [in] | datatype | The data type of the items. |
| [in] | op | The operation to perform. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Alltoall | ( | const void * | sendbuf, |
| int | sendcount, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| int | recvcount, | ||
| tMPI_Datatype | recvtype, | ||
| tMPI_Comm | comm ) |
Spread out parts of sendbuf to all processes from all processes in comm.
Collective function.
| [in] | sendbuf | The send buffer. |
| [in] | sendcount | The number of items for to send to each thread. |
| [in] | sendtype | The type of the items to send. |
| [out] | recvbuf | The receive buffer for all threads. |
| [in] | recvcount | The number of items recvbuf can receive per thread. |
| [in] | recvtype | The type of items to receive. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Alltoallv | ( | const void * | sendbuf, |
| const int * | sendcounts, | ||
| const int * | sdispls, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| const int * | recvcounts, | ||
| const int * | rdispls, | ||
| tMPI_Datatype | recvtype, | ||
| tMPI_Comm | comm ) |
Spread out irregularly laid out parts of sendbuf to all processes from all processes in comm.
Collective function.
| [in] | sendbuf | The send buffer. |
| [in] | sendcounts | List of the number of items for to send to each thread. |
| [in] | sdispls | List of the displacements in sendbuf of items to send to each thread. |
| [in] | sendtype | The type of the items to send. |
| [out] | recvbuf | The receive buffer for all threads. |
| [in] | recvcounts | List of the number of items recvbuf can receive from each thread. |
| [in] | rdispls | List of the displacements in recvbuf of items to receive from each thread. |
| [in] | recvtype | The type of items to receive. |
| [in] | comm | The communicator. |
|
inline |
Add integer to atomic variable.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | atomic datatype to modify |
| i | integer to increment with. Use i<0 to subtract atomically. |
|
inline |
Atomic compare-and-swap operation.
The old value is compared with the memory value in the atomic datatype. If the are identical, the atomic type is swapped with the new value, and otherwise left unchanged.
This is the synchronization primitive: it has a consensus number of infinity, and is available in some form on all modern CPU architectures. In the words of Herlihy&Shavit (The art of multiprocessor programming), it is the 'king of all wild things'.
In practice, use it as follows: You can start by reading a value (without locking anything), perform some calculations, and then atomically try to update it in memory unless it has changed. If it has changed you will get an error return code - reread the new value an repeat the calculations in that case.
| a | Atomic datatype ('memory' value) |
| old_val | Integer value read from the atomic type at an earlier point |
| new_val | New value to write to the atomic type if it currently is identical to the old value. |
|
inline |
Add to variable, return the old value.
This operation is quite useful for synchronization counters. By performing a fetchadd with N, a thread can e.g. reserve a chunk with the next N iterations, and the return value is the index of the first element to treat.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | atomic datatype to modify |
| i | integer to increment with. Use i<0 to subtract atomically. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Atomic_get | ( | const tMPI_Atomic_t * | a | ) |
Return value of an atomic integer.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | Atomic variable to read |
|
inline |
Atomic pointer compare-and-swap operation.
The old value is compared with the memory value in the atomic datatype. If the are identical, the atomic type is swapped with the new value, and otherwise left unchanged.
This is essential for implementing wait-free lists and other data structures. See 'tMPI_Atomic_cas()'.
| a | Atomic datatype ('memory' value) |
| old_val | Pointer value read from the atomic type at an earlier point |
| new_val | New value to write to the atomic type if it currently is identical to the old value. |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Atomic_ptr_get | ( | const tMPI_Atomic_ptr_t * | a | ) |
Return value of an atomic pointer.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | Atomic variable to read |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Atomic_ptr_set | ( | tMPI_Atomic_ptr_t * | a, |
| void * | p ) |
Write value to an atomic pointer.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | Atomic variable |
| p | Pointer value to set the atomic variable to. |
|
inline |
Atomic swap pointer operation.
Atomically swaps the pointer in the tMPI_Atomic_ptr_t operand with the value of b. Note: This has no good assembly counterparts on many architectures, so it might not be faster than a repreated CAS.
| a | Pointer to atomic type |
| b | Value to swap |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Atomic_set | ( | tMPI_Atomic_t * | a, |
| int | i ) |
Write value to an atomic integer.
Also implements proper memory barriers when necessary. The actual implementation is system-dependent.
| a | Atomic variable |
| i | Integer to set the atomic variable to. |
|
inline |
Atomic swap operation.
Atomically swaps the data in the tMPI_Atomic_t operand with the value of b. Note: This has no good assembly counterparts on many architectures, so it might not be faster than a repreated CAS.
| a | Pointer to atomic type |
| b | Value to swap |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Barrier | ( | tMPI_Comm | comm | ) |
Block until all threads in the comm call this function.
| [in] | comm | The comm object. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Barrier_init | ( | tMPI_Barrier_t * | barrier, |
| int | count ) |
Initialize barrier.
| barrier | Pointer to spinlock barrier. Note that this is not the same datatype as the full, thread based, barrier. |
| count | Number of threads to synchronize. All threads will be released after count calls to tMPI_Barrier_wait(). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Barrier_wait | ( | tMPI_Barrier_t * | barrier | ) |
Perform yielding, busy-waiting barrier synchronization.
This function blocks until it has been called N times, where N is the count value the barrier was initialized with. After N total calls all threads return. The barrier automatically cycles, and thus requires another N calls to unblock another time.
| barrier | Pointer to previously created barrier. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Bcast | ( | void * | buffer, |
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Broadcast from one thread to all others in comm.
Collective function; data is transferred from root's buffer to all others' buffer.
| [in,out] | buffer | The buffer to send from (root)/receive from (other threads). |
| [in] | count | The number of items to send/receive. |
| [in] | datatype | The type of the items to send/receive. |
| [in] | root | The rank of the sending thread. |
| [in] | comm | The communicator. |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Calloc_local | ( | size_t | nmemb, |
| size_t | size ) |
Allocate local memory by array and element size.
| [in] | nmemb | = number of array members |
| [in] | size | = size in units of sizeof() of a single array element |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_coords | ( | tMPI_Comm | comm, |
| int | rank, | ||
| int | maxdims, | ||
| int * | coords ) |
Get coordinates of a process rank in a Cartesian topology.
| [in] | comm | The comm to query. |
| [in] | rank | The rank associated with the coordinates. |
| [in] | maxdims | The maximum number of dimensions in the coords parameter. |
| [out] | coords | The coordinates in each dimension. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_create | ( | tMPI_Comm | comm_old, |
| int | ndims, | ||
| const int * | dims, | ||
| const int * | periods, | ||
| int | reorder, | ||
| tMPI_Comm * | comm_cart ) |
Create a comm with a Cartesian topology.
| [in] | comm_old | The originating comm. |
| [in] | ndims | The number of dimensions. |
| [in] | dims | The size in each dimension. |
| [in] | periods | The periodicity in each dimension. |
| [in] | reorder | Whether to allow reordering of the threads according to tMPI_Cart_map(). |
| [out] | comm_cart | The new comm with Cartesian topology. |
| void PLMD::thread_mpi::tMPI_Cart_destroy | ( | struct cart_topol * | top | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_get | ( | tMPI_Comm | comm, |
| int | maxdims, | ||
| int * | dims, | ||
| int * | periods, | ||
| int * | coords ) |
Get the size and pbc a of a comm with a Cartesian topology has.
| [in] | comm | The comm to query. |
| [in] | maxdims | The maximum number of dimensions in the periods and coords parameter. |
| [out] | dims | The number of dimensions. |
| [out] | periods | The periodicity in each dimension. |
| [out] | coords | The number of coordinates in each dimension. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_map | ( | tMPI_Comm | comm, |
| int | ndims, | ||
| const int * | dims, | ||
| const int * | periods, | ||
| int * | newrank ) |
Get optimal rank this process would have in a Cartesian topology.
| [in] | comm | The comm to query. |
| [in] | ndims | The number of dimensions. |
| [in] | dims | The size in each dimension. |
| [in] | periods | The periodicity in each dimension. |
| [out] | newrank | The rank the thread would have given the topology. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_rank | ( | tMPI_Comm | comm, |
| const int * | coords, | ||
| int * | rank ) |
Get rank that a specific set of process coordinates has in a Cartesian topology.
| [in] | comm | The comm to query. |
| [in] | coords | The coordinates in each dimension. |
| [out] | rank | The rank associated with the coordinates. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cart_sub | ( | tMPI_Comm | comm, |
| const int * | remain_dims, | ||
| tMPI_Comm * | newcomm ) |
Create a comms that are sub-spaces of the Cartesian topology communicator.
Works like a MPI_Comm_split() for the Cartesian dimensions specified as false in remain_dims.
| [in] | comm | The originating comm with Cartesian topology. |
| [in] | remain_dims | An Boolean array that decides whether a specific dimensionality should remain in newcomm (if true), or should be split up (if false). |
| [out] | newcomm | The new split communicator |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Cartdim_get | ( | tMPI_Comm | comm, |
| int * | ndims ) |
Get the dimensionality of a comm with a topology.
| [in] | comm | The comm to query. |
| [out] | ndims | The number of dimensions. |
| void PLMD::thread_mpi::tMPI_Coll_env_destroy | ( | struct coll_env * | mev | ) |
| int PLMD::thread_mpi::tMPI_Coll_env_init | ( | struct coll_env * | mev, |
| int | N ) |
| void PLMD::thread_mpi::tMPI_Coll_root_xfer | ( | tMPI_Comm | comm, |
| tMPI_Datatype | sendtype, | ||
| tMPI_Datatype | recvtype, | ||
| size_t | sendsize, | ||
| size_t | recvsize, | ||
| void * | sendbuf, | ||
| void * | recvbuf, | ||
| int * | ret ) |
| void PLMD::thread_mpi::tMPI_Coll_sync_destroy | ( | struct coll_sync * | msc | ) |
| int PLMD::thread_mpi::tMPI_Coll_sync_init | ( | struct coll_sync * | msc, |
| int | N ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_compare | ( | tMPI_Comm | comm1, |
| tMPI_Comm | comm2, | ||
| int * | result ) |
Compare two comms.
Returns TMPI_IDENT if the two comms point to the same underlying comm structure, TMPI_CONGRUENT if all members appear in the both comms in the same order, TMPI_SIMILAR if both comms have the smae members but not in the same order, or TMPI_UNEQUAL if the comms have different members.
| [in] | comm1 | The first comm to compare. |
| [in] | comm2 | The second comm to compare. |
| [out] | result | The output result, one of the values described above. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_create | ( | tMPI_Comm | comm, |
| tMPI_Group | group, | ||
| tMPI_Comm * | newcomm ) |
Create a comm based on group membership.
Collective function that creates a new comm containing only proceses that are members of the given group.
| [in] | comm | The originating comm. |
| [in] | group | The group of threads to create a comm from. |
| [out] | newcomm | The new comm. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_dup | ( | tMPI_Comm | comm, |
| tMPI_Comm * | newcomm ) |
Make a duplicate of a comm.
Collective function.
| [in] | comm | The originating comm. |
| [in] | newcomm | The new comm. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_free | ( | tMPI_Comm * | comm | ) |
De-allocate a comm.
Collective function.
| [in] | comm | The comm to free. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_get_errhandler | ( | tMPI_Comm | comm, |
| tMPI_Errhandler * | errhandler ) |
get the error handler.
Gets the error handler associated with a comm
| [in] | comm | the communicator to get the error handler for. |
| [out] | errhandler | the error handler. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_group | ( | tMPI_Comm | comm, |
| tMPI_Group * | group ) |
Get a pointer to the group in the comm.
| [in] | comm | The comm from which to take the group. |
| [out] | group | The comm's group. |
| int PLMD::thread_mpi::tMPI_Comm_N | ( | tMPI_Comm | comm | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_rank | ( | tMPI_Comm | comm, |
| int * | rank ) |
get the rank in comm of the current process
| [in] | comm | The comm to query. |
| [out] | rank | Thread rank in comm. |
| int PLMD::thread_mpi::tMPI_Comm_seek_rank | ( | tMPI_Comm | comm, |
| struct tmpi_thread * | th ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_set_errhandler | ( | tMPI_Comm | comm, |
| tMPI_Errhandler | errhandler ) |
Set the error handler.
| [in] | comm | the communicator to set the error handler for. |
| [in] | errhandler | the error handler. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_size | ( | tMPI_Comm | comm, |
| int * | size ) |
Get the comm size (nr.
of threads).
| [in] | comm | The comm to query. |
| [out] | size | The comm size. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Comm_split | ( | tMPI_Comm | comm, |
| int | color, | ||
| int | key, | ||
| tMPI_Comm * | newcomm ) |
Split up a group into same-colored sub-groups ordered by key.
This is the main comm creation function: it's a collective call that takes a color and a key from each process, and arranges all threads that call tMPI_Split() withe the same color together into a comm.
The rank in the new group will be based on the value given in key.
Passing TMPI_UNDEFINED as a color will result in the thread not being part of any group, and getting TMPI_COMM_NULL back in newcomm.
| [in] | comm | The originating comm. |
| [in] | color | This thread's color (determines which comm it will be in). Giving TMPI_UNDEFINED will result in this thread not being in any group. |
| [in] | key | This thread's key (determines rank). |
| [out] | newcomm | The new comm. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Create_errhandler | ( | tMPI_Errhandler_fn * | function, |
| tMPI_Errhandler * | errhandler ) |
Create an error handler object from a function.
| [in] | function | The function to make an error handler of. |
| [out] | errhandler | The error handler. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Errhandler_free | ( | tMPI_Errhandler * | errhandler | ) |
Free the error handler object.
| [in] | errhandler | The error handler. |
| int PLMD::thread_mpi::tMPI_Error | ( | tMPI_Comm | comm, |
| int | tmpi_errno ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Error_string | ( | int | errorcode, |
| char * | string, | ||
| int * | resultlen ) |
get the error string associated with an error code.
The length of the error string will never exceed TMPI_MAX_ERROR_STRING.
| [in] | errorcode | The error code. |
| [out] | string | The pre-allocated char pointer to output to. |
| [out] | resultlen | The length of the error string. Will never be longer than TMPI_MAX_ERROR_STRING. |
| void PLMD::thread_mpi::tmpi_errors_are_fatal_fn | ( | tMPI_Comm * | comm, |
| int * | err ) |
| void PLMD::thread_mpi::tmpi_errors_return_fn | ( | tMPI_Comm * | comm, |
| int * | err ) |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Event_destroy | ( | tMPI_Event * | ev | ) |
Deallocate the internals of the contents of event object.
| ev | The event structure to be destroyed. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Event_init | ( | tMPI_Event * | ev | ) |
Initialize the event object.
| ev | The event structure to be intialized. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Event_wait | ( | tMPI_Event * | ev | ) |
Wait for an event to occur.
Sets the number of events that had occurred during the wait in N.
| ev | The event structure to wait on. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Fatal_error | ( | const char * | file, |
| int | line, | ||
| const char * | message, | ||
| ... ) |
handle a fatal error.
| file | source code file name of error. |
| line | source code line number of error. |
| message | format string for error message. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Finalize | ( | void | ) |
Waits for all other threads to finish and cleans up.
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Finalized | ( | int * | flag | ) |
Determine whether tMPI_Finalize has been run.
| [out] | flag | Set to TRUE if tMPI_Finalize() has been called, FALSE if not. |
| void PLMD::thread_mpi::tMPI_Free | ( | void * | p | ) |
| void PLMD::thread_mpi::tMPI_Free_env_list_destroy | ( | struct free_envelope_list * | evl | ) |
| int PLMD::thread_mpi::tMPI_Free_env_list_init | ( | struct free_envelope_list * | evl, |
| int | N ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Free_numa | ( | void * | ptr | ) |
Free memory allocate with any of the NUMA-aware allocators.
| [in] | ptr | = pointer to block of memory allocated with a NUMA allocator |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Gather | ( | const void * | sendbuf, |
| int | sendcount, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| int | recvcount, | ||
| tMPI_Datatype | recvtype, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Gather data from all threads in comm to root.
Collective function; assumes that all data is received in blocks of recvcount.
| [in] | sendbuf | The send buffer for all threads (root may specify TMPI_IN_PLACE, in which case it transfers nothing to itself). |
| [in] | sendcount | The number of items to send for all threads. |
| [in] | sendtype | The type of the items to send. |
| [out] | recvbuf | The receiving buffer (for root thread). |
| [in] | recvcount | The number of items to receive (for root). |
| [in] | recvtype | The type of the items to receive (for root). |
| [in] | root | The rank of root. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Gatherv | ( | const void * | sendbuf, |
| int | sendcount, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| const int * | recvcounts, | ||
| const int * | displs, | ||
| tMPI_Datatype | recvtype, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Gather irregularly laid out data from all processes in comm to root.
Collective function.
| [in] | sendbuf | The send buffer for all threads (root may specify TMPI_IN_PLACE, in which case it transfers nothing to itself). |
| [in] | sendcount | The number of items to send for all threads. |
| [in] | sendtype | The type of the items to send. |
| [out] | recvbuf | The receiving buffer (for root thread). |
| [in] | recvcounts | The list of number of items to receive (for root). |
| [in] | displs | The list of displacements in recvbuf to receive data in (for root). |
| [in] | recvtype | The type of the items to receive (for root). |
| [in] | root | The rank of root. |
| [in] | comm | The communicator. |
| tMPI_Comm PLMD::thread_mpi::tMPI_Get_comm_self | ( | void | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Get_count | ( | const tMPI_Status * | status, |
| tMPI_Datatype | datatype, | ||
| int * | count ) |
get the number of actually transferred items from a receive status.
| [in] | status | The status. |
| [in] | datatype | The data type which was received. |
| [out] | count | The number of items actually received. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Get_hw_nthreads | ( | void | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Get_N | ( | int * | argc, |
| char *** | argv, | ||
| const char * | optname, | ||
| int * | nthreads ) |
get the number of threads from the command line
can be called before tMPI_Init()
| [in] | argc | argc from main() |
| [in] | argv | argv from main() |
| [in] | optname | name of the argument specifying the number of threads to run. If this is NULL, this function will read the first argument and interpret it as the number of threads. |
| [out] | nthreads | the number of threads |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Get_processor_name | ( | char * | name, |
| int * | resultlen ) |
returns string with thread number.
| [out] | name | Pre-allocated string to output name to (will not be longer than TMPI_MAX_PROCESSOR_NAME). |
| [out] | resultlen | The length of the output. Note that this is an int instead of a size_t because the MPI standard for some reason defines all sizes as int |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Get_recommended_nthreads | ( | void | ) |
Determine the recommended number of hardware threads to run on.
Returns the total number of cores and SMT threads to run on. This is equal to the number of hardware threads available, or 1 if the number can't be determined, or if there are no atomics for this platform.
| tMPI_Group PLMD::thread_mpi::tMPI_Group_alloc | ( | void | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Group_free | ( | tMPI_Group * | group | ) |
De-allocate a group.
| [in] | group | The group to de-allocate. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Group_incl | ( | tMPI_Group | group, |
| int | n, | ||
| const int * | ranks, | ||
| tMPI_Group * | newgroup ) |
Create a new group as a the collection of threads with given ranks.
| [in] | group | The group from which the ranks are taken. |
| [in] | n | The number of new group members. |
| [in] | ranks | The ranks of the threads to add to the new group. |
| [out] | newgroup | The new group. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Group_rank | ( | tMPI_Group | group, |
| int * | rank ) |
Get the rank of a thread in a group.
| [in] | group | The group. |
| [out] | rank | Variable for the rank, or TMPI_UNDEFINED if not in group. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Group_size | ( | tMPI_Group | group, |
| int * | size ) |
Get the size (number of members) of a group.
| [in] | group | The group. |
| [out] | size | Size. |
| tmpi_bool PLMD::thread_mpi::tMPI_In_group | ( | tMPI_Group | group | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Init | ( | int * | argc, |
| char *** | argv, | ||
| int(* | start_function )(int, char **) ) |
Traditional MPI initializer; spawns threads that start at the given function.
Seeks the argument '-nt n', where n is the number of threads that will be created. If n==0, the number of threads will be the recommended number of threads for this platform as obtained from tMPI_Get_recommended_ntreads().
The new threads then run the function start_function, with the original argc and argv. This function could be main(), or any other function; calling this function again - whether from the started threads or from the main thread - has no effect.
On platforms that support thread affinity setting, this function will use the 'all-cores' affinity strategy: it will only set thread affinity if the number of threads is equal to the number of hardware threads (cores + hyperthreads).
| [in] | argc | argc of original main() invocation, or NULL |
| [in] | argv | argv of original main() invocation, or NULL. |
| [in] | start_function | Starting function of type int start_function(int argc, char *argv[]); |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Init_fn | ( | int | main_thread_returns, |
| int | N, | ||
| tMPI_Affinity_strategy | aff_strategy, | ||
| void(* | start_function )(const void *), | ||
| const void * | arg ) |
Generic init function thread MPI intializer and thread spawner.
Creates N threads (including main thread) that run the function start_function, which takes a void* argument, given by arg. The function start_function also gets called by the main thread. When the function start_function returns it, will behave as if tMPI_Finalize is called, and if it's a sub-thread it will stop running.
If N==0, the number of threads will be the recommended number of threads for this platform as obtained from tMPI_Get_recommended_ntreads().
Note that thread affinity strategy only has an effect when this is supported by the underlying platform. As of yet (2012), this is not the case for Mac OS X, for example.
| [in] | main_thread_returns | whether the control in the main thread should return immediately (if true), or the start_function() should be called from the main thread, too (if false). |
| [in] | N | The number of threads to start (or 0 to automatically determine this). |
| [in] | aff_strategy | The thread affinity strategy to use. |
| [in] | start_function | The function to start threads at (including main thread if main_thread_returns). |
| [in] | arg | An optional argument for start_function(). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Initialized | ( | int * | flag | ) |
whether tMPI_Init, but not yet tMPI_Finalize, has been run
| [out] | flag | Set to TRUE if tMPI_Init() has been called, FALSE if not. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Irecv | ( | void * | buf, |
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| int | source, | ||
| int | tag, | ||
| tMPI_Comm | comm, | ||
| tMPI_Request * | request ) |
Initiate receiving a message.
This makes the buffer available to be filled with data. The contents of buf should not be relied on before the transmission is finished with tMPI_Wait(), tMPI_Test() or tMPI_Waitall().
| [out] | buf | The buffer for data to receive. |
| [in] | count | The maximum number of items to receive. |
| [in] | datatype | The data type of the items in buf. |
| [in] | source | The rank of the source thread (or TMPI_ANY_SOURCE). |
| [in] | tag | The message tag (or TMPI_ANY_TAG). |
| [in] | comm | The shared communicator. |
| [out] | request | The request object that can be used in tMPI_Wait(), tMPI_Test, etc. |
| tmpi_bool PLMD::thread_mpi::tMPI_Is_master | ( | void | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Isend | ( | const void * | buf, |
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| int | dest, | ||
| int | tag, | ||
| tMPI_Comm | comm, | ||
| tMPI_Request * | request ) |
Initiate sending a message, non-blocking.
This makes the buffer available to be received. The contents of buf should not be touched before the transmission is finished with tMPI_Wait(), tMPI_Test() or tMPI_Waitall().
| [in] | buf | The buffer with data to send. |
| [in] | count | The number of items to send. |
| [in] | datatype | The data type of the items in buf. |
| [in] | dest | The rank of the destination thread. |
| [in] | tag | The message tag. |
| [in] | comm | The shared communicator. |
| [out] | request | The request object that can be used in tMPI_Wait(), tMPI_Test, etc. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Lock_init | ( | tMPI_Lock_t * | lock | ) |
Initialize lock.
| lock | Pointer to the new lock. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Lock_islocked | ( | tMPI_Lock_t * | lock | ) |
Check the status of the lock without affecting its state.
| lock | Pointer to previously created lock. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Lock_lock | ( | tMPI_Lock_t * | lock | ) |
Perform yielding, busy-waiting locking.
This function blocks until the lock is locked.
| lock | Pointer to previously created lock. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Lock_trylock | ( | tMPI_Lock_t * | lock | ) |
Try to lock the lock but don't block if it is locked.
| lock | Pointer to previously created lock. |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Lock_unlock | ( | tMPI_Lock_t * | lock | ) |
Unlock the lock.
| lock | Pointer to previously created lock. |
| void * PLMD::thread_mpi::tMPI_Malloc | ( | size_t | size | ) |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Malloc_local | ( | size_t | size | ) |
Allocate local memory by size in bytes.
| [in] | size | = size in units of sizeof() of the memory to be allocated |
| void PLMD::thread_mpi::tMPI_Mult_recv | ( | tMPI_Comm | comm, |
| struct coll_env * | cev, | ||
| int | rank, | ||
| int | index, | ||
| int | expected_tag, | ||
| tMPI_Datatype | recvtype, | ||
| size_t | recvsize, | ||
| void * | recvbuf, | ||
| int * | ret ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Once | ( | tMPI_Comm | comm, |
| void(* | function )(void *), | ||
| void * | param, | ||
| int * | was_first ) |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Once_wait | ( | tMPI_Comm | comm, |
| void *(* | function )(void *), | ||
| void * | param, | ||
| int * | was_first ) |
Execute function once over comm, and wait for the function to return its value.
Executes a given function only once per collective call over comm.
Collective function.
| [in] | function | the function to call |
| [in] | param | the parameter to the function |
| [out] | was_first | set to 1 if the current thread was the one to execute the function. unchanged if current thread was not the one to execute the function; ignored if NULL. |
| [in] | comm | The communicator. |
| struct envelope * PLMD::thread_mpi::tMPI_Post_match_recv | ( | struct tmpi_thread * | cur, |
| tMPI_Comm | comm, | ||
| struct tmpi_thread * | src, | ||
| void * | recv_buf, | ||
| int | recv_count, | ||
| tMPI_Datatype | datatype, | ||
| int | tag, | ||
| tmpi_bool | nonblock ) |
| int PLMD::thread_mpi::tMPI_Post_multi | ( | struct coll_env * | cev, |
| int | myrank, | ||
| int | index, | ||
| int | tag, | ||
| tMPI_Datatype | datatype, | ||
| size_t | bufsize, | ||
| void * | buf, | ||
| int | n_remaining, | ||
| int | synct, | ||
| int | dest ) |
| struct envelope * PLMD::thread_mpi::tMPI_Post_send | ( | struct tmpi_thread * | cur, |
| tMPI_Comm | comm, | ||
| struct tmpi_thread * | dest, | ||
| void * | send_buf, | ||
| int | send_count, | ||
| tMPI_Datatype | datatype, | ||
| int | tag, | ||
| tmpi_bool | nonblock ) |
| void * PLMD::thread_mpi::tMPI_Realloc | ( | void * | p, |
| size_t | size ) |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Realloc_local | ( | void * | ptr, |
| size_t | size ) |
Re-allocate to local memory.
| [in] | ptr | = input pointer of originally allocated memory (can be allocated with NUMA or non-NUMA malloc()) |
| [in] | size | = new size in units of sizeof(). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Recv | ( | void * | buf, |
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| int | source, | ||
| int | tag, | ||
| tMPI_Comm | comm, | ||
| tMPI_Status * | status ) |
Receive message; blocks until buf is filled.
| [out] | buf | The buffer for data to receive. |
| [in] | count | The maximum number of items to receive. |
| [in] | datatype | The data type of the items in buf. |
| [in] | source | The rank of the source thread (or TMPI_ANY_SOURCE). |
| [in] | tag | The message tag (or TMPI_ANY_TAG). |
| [in] | comm | The shared communicator. |
| [out] | status | The message status. |
| void PLMD::thread_mpi::tMPI_Recv_env_list_destroy | ( | struct recv_envelope_list * | evl | ) |
| int PLMD::thread_mpi::tMPI_Recv_env_list_init | ( | struct recv_envelope_list * | evl | ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Reduce | ( | const void * | sendbuf, |
| void * | recvbuf, | ||
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| tMPI_Op | op, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Do an operation between all locally held buffers on all items in the buffers, and send the results to root.
Collective function.
| [in] | sendbuf | The operand parameters. Root may specify TMPI_IN_PLACE, in which case recvbuf will hold the operand parameters. |
| [out] | recvbuf | The result buffer at root. |
| [in] | count | The number of items to do operation on. |
| [in] | datatype | The data type of the items. |
| [in] | op | The operation to perform. |
| [in] | root | The root thread (which is to receive the results). |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Reduce_fast | ( | const void * | sendbuf, |
| void * | recvbuf, | ||
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| tMPI_Op | op, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Do an tMPI_Reduce, but with the following assumption: recvbuf points to a valid buffer in all calling threads, or sendbuf has the value TMPI_IN_PLACE (in which case the values of sendbuf may be changed in that thread).
This avoids unnecessary memory allocations associated with the normal tMPI_Reduce.
Collective function.
| [in] | sendbuf | The operand parameters (or TMPI_IN_PLACE, in which case the operand parameters will be in recvbuf). |
| [in,out] | recvbuf | The result buffer. |
| [in] | count | The number of items to do operation on. |
| [in] | datatype | The data type of the items. |
| [in] | op | The operation to perform. |
| [in] | root | The root thread (which is to receive the final results). |
| [in] | comm | The communicator. |
| TMPI_EXPORT tMPI_Reduce_req * PLMD::thread_mpi::tMPI_Reduce_req_alloc | ( | tMPI_Comm | comm | ) |
Allocate data structure for asynchronous reduce.
| int PLMD::thread_mpi::tMPI_Reduce_run_op | ( | void * | dest, |
| const void * | src_a, | ||
| const void * | src_b, | ||
| tMPI_Datatype | datatype, | ||
| int | count, | ||
| tMPI_Op | op, | ||
| tMPI_Comm | comm ) |
| void PLMD::thread_mpi::tMPI_Req_list_destroy | ( | struct req_list * | rl | ) |
| int PLMD::thread_mpi::tMPI_Req_list_init | ( | struct req_list * | rl, |
| int | N_reqs ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Scan | ( | const void * | sendbuf, |
| void * | recvbuf, | ||
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| tMPI_Op | op, | ||
| tMPI_Comm | comm ) |
Do a partial reduce operation, based on rank: the results of the reduction operation of ranks 0 - i will be put in the recvbuf of rank i.
Collective function.
| [in] | sendbuf | The operand parameters. All ranks may specify TMPI_IN_PLACE, in which case recvbuf will hold the operand parameters. |
| [in,out] | recvbuf | The result buffer. |
| [in] | count | The number of items to do operation on. |
| [in] | datatype | The data type of the items. |
| [in] | op | The operation to perform. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Scatter | ( | const void * | sendbuf, |
| int | sendcount, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| int | recvcount, | ||
| tMPI_Datatype | recvtype, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Spread parts of sendbuf to all processes in comm from root.
Collective function.
| [in] | sendbuf | The send buffer for root. |
| [in] | sendcount | The number of items for root to send to each thread. |
| [in] | sendtype | The type of the items root sends. |
| [out] | recvbuf | The receiving buffer for all receiving threads (root may specify TMPI_IN_PLACE, in which case it transmits nothing to itself). |
| [in] | recvcount | The number of items recvbuf can receive. |
| [in] | recvtype | The type of items to receive. |
| [in] | root | The rank of root. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Scatterv | ( | const void * | sendbuf, |
| const int * | sendcounts, | ||
| const int * | displs, | ||
| tMPI_Datatype | sendtype, | ||
| void * | recvbuf, | ||
| int | recvcount, | ||
| tMPI_Datatype | recvtype, | ||
| int | root, | ||
| tMPI_Comm | comm ) |
Spread irregularly laid out parts of sendbuf to all processes in comm from root.
Collective function.
| [in] | sendbuf | The send buffer for root. |
| [in] | sendcounts | List of the number of items for root to send to each thread. |
| [in] | displs | List of displacements in sendbuf from which to start transmission to each thread. |
| [in] | sendtype | The type of the items root sends. |
| [out] | recvbuf | The receiving buffer for all receiving threads (root may specify TMPI_IN_PLACE, in which case it transmits nothing to itself). |
| [in] | recvcount | The number of items recvbuf can receive. |
| [in] | recvtype | The type of items to receive. |
| [in] | root | The rank of root. |
| [in] | comm | The communicator. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Send | ( | const void * | buf, |
| int | count, | ||
| tMPI_Datatype | datatype, | ||
| int | dest, | ||
| int | tag, | ||
| tMPI_Comm | comm ) |
Send message; blocks until buf is reusable.
| [in] | buf | The buffer with data to send. |
| [in] | count | The number of items to send. |
| [in] | datatype | The data type of the items in buf. |
| [in] | dest | The rank of the destination thread. |
| [in] | tag | The message tag. |
| [in] | comm | The shared communicator. |
| void PLMD::thread_mpi::tMPI_Send_env_list_destroy | ( | struct send_envelope_list * | evl | ) |
| int PLMD::thread_mpi::tMPI_Send_env_list_init | ( | struct send_envelope_list * | evl, |
| int | N ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Sendrecv | ( | const void * | sendbuf, |
| int | sendcount, | ||
| tMPI_Datatype | sendtype, | ||
| int | dest, | ||
| int | sendtag, | ||
| void * | recvbuf, | ||
| int | recvcount, | ||
| tMPI_Datatype | recvtype, | ||
| int | source, | ||
| int | recvtag, | ||
| tMPI_Comm | comm, | ||
| tMPI_Status * | status ) |
Send & receive message at the same time.
Blocks until recvbuf is filled, and sendbuf is ready for reuse.
| [in] | sendbuf | The buffer with data to send. |
| [in] | sendcount | The number of items to send. |
| [in] | sendtype | The data type of the items in send buf. |
| [in] | dest | The rank of the destination thread. |
| [in] | sendtag | The send message tag. |
| [out] | recvbuf | The buffer for data to receive. |
| [in] | recvcount | The maximum number of items to receive. |
| [in] | recvtype | The data type of the items in recvbuf. |
| [in] | source | The rank of the source thread (or TMPI_ANY_SOURCE). |
| [in] | recvtag | The receive message tag (or TMPI_ANY_TAG). |
| [in] | comm | The shared communicator. |
| [out] | status | The received message status. |
| void PLMD::thread_mpi::tMPI_Set_status | ( | struct tmpi_req_ * | req, |
| tMPI_Status * | st ) |
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Shmalloc | ( | tMPI_Comm | comm, |
| size_t | size ) |
Allocate a shared block of memory as a collective call.
Collective function.
| [in] | comm | The communicator |
| [in] | size | The size in bytes to allocate |
|
inline |
Initialize spinlock.
In theory you can call this from multiple threads, but remember that we don't check for errors. If the first thread proceeded to lock the spinlock after initialization, the second will happily overwrite the contents and unlock it without warning you.
| x | Spinlock pointer. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Spinlock_islocked | ( | tMPI_Spinlock_t * | x | ) |
Check if spinlock is locked.
This routine returns immediately with the lock status.
| x | Spinlock pointer |
|
inline |
Acquire spinlock.
This routine blocks until the spinlock is available, and the locks it again before returning.
| x | Spinlock pointer |
|
inline |
Attempt to acquire spinlock.
This routine acquires the spinlock if possible, but if already locked it return an error code immediately.
| x | Spinlock pointer |
|
inline |
Release spinlock.
| x | Spinlock pointer |
Unlocks the spinlock, regardless if which thread locked it.
|
inline |
Wait for a spinlock to become available.
This routine blocks until the spinlock is unlocked, but in contrast to tMPI_Spinlock_lock() it returns without trying to lock the spinlock.
| x | Spinlock pointer |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Stack_destroy | ( | tMPI_Stack * | st | ) |
Deallocates a stack.
| TMPI_EXPORT tMPI_Stack_element * PLMD::thread_mpi::tMPI_Stack_detach | ( | tMPI_Stack * | st | ) |
Detaches entire stack for use by a single thread.
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Stack_init | ( | tMPI_Stack * | st | ) |
Initialize a stack.
| TMPI_EXPORT tMPI_Stack_element * PLMD::thread_mpi::tMPI_Stack_pop | ( | tMPI_Stack * | st | ) |
Pops a stack element from a stack.
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Stack_push | ( | tMPI_Stack * | st, |
| tMPI_Stack_element * | el ) |
Pushes a stack element onto a stack.
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Test | ( | tMPI_Request * | request, |
| int * | flag, | ||
| tMPI_Status * | status ) |
Test whether a message is transferred.
| [in,out] | request | The request obtained wit tMPI_Isend()/tMPI_Irecv(). |
| [out] | flag | A flag set to TRUE(1) if the request is finished, FALSE(0) otherwise. |
| [out] | status | Message status (can be set to TMPI_STATUS_IGNORE). |
| tmpi_bool PLMD::thread_mpi::tMPI_Test_multi | ( | struct tmpi_thread * | cur, |
| struct tmpi_req_ * | rqs, | ||
| tmpi_bool * | any_done ) |
| tmpi_bool PLMD::thread_mpi::tMPI_Test_single | ( | struct tmpi_thread * | cur, |
| struct tmpi_req_ * | rq ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Testall | ( | int | count, |
| tMPI_Request * | array_of_requests, | ||
| int * | flag, | ||
| tMPI_Status * | array_of_statuses ) |
Test whether several messages are transferred.
| [in] | count | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | flag | Whether all requests have completed. |
| [out] | array_of_statuses | List of count message statuses (can be set to TMPI_STATUSES_IGNORE). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Testany | ( | int | count, |
| tMPI_Request * | array_of_requests, | ||
| int * | index, | ||
| int * | flag, | ||
| tMPI_Status * | status ) |
Test whether one of several messages is transferred.
| [in] | count | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | index | Index of the request that has completed. |
| [out] | flag | Whether any request has completed. |
| [out] | status | Pointer to tMPI_Status object associated with completed request. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Testsome | ( | int | incount, |
| tMPI_Request * | array_of_requests, | ||
| int * | outcount, | ||
| int * | array_of_indices, | ||
| tMPI_Status * | array_of_statuses ) |
Test whether some of several messages are transferred.
| [in] | incount | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | outcount | Number of completed requests |
| [out] | array_of_indices | Array of ints that gets filled with the indices of the completed requests. |
| [out] | array_of_statuses | List of count message statuses (can be set to TMPI_STATUSES_IGNORE). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_barrier_destroy | ( | tMPI_Thread_barrier_t * | barrier | ) |
Release data in a barrier datatype.
| barrier | Pointer to previously initialized barrier. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_barrier_init | ( | tMPI_Thread_barrier_t * | barrier, |
| int | count ) |
Initialize a synchronization barrier type.
You only need to initialize a barrier once. They cycle automatically, so after release it is immediately ready to accept waiting threads again.
| barrier | Pointer to previously allocated barrier type |
| count | Number of threads to synchronize. All threads will be released after count calls to tMPI_Thread_barrier_wait(). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_barrier_wait | ( | tMPI_Thread_barrier_t * | barrier | ) |
Perform barrier synchronization.
This routine blocks until it has been called N times, where N is the count value the barrier was initialized with. After N total calls all threads return. The barrier automatically cycles, and thus requires another N calls to unblock another time.
| barrier | Pointer to previously create barrier. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cancel | ( | tMPI_Thread_t | thread | ) |
Ask a thread to exit.
This routine tries to end the execution of another thread, but there are no guarantees it will succeed.
| thread | Handle to thread we want to see dead. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cond_broadcast | ( | tMPI_Thread_cond_t * | cond | ) |
Unblock all waiting threads.
This routine signals a condition variable to all (if any) threads that are waiting for it after calling tMPI_Thread_cond_wait().
| cond | condition variable |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cond_destroy | ( | tMPI_Thread_cond_t * | cond | ) |
Destroy condition variable.
This routine should be called when you are done with a condition variable. Note that it only releases memory allocated internally, not the tMPI_Thread_cond_t structure you provide a pointer to.
| cond | Pointer to condition variable. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cond_init | ( | tMPI_Thread_cond_t * | cond | ) |
Initialize condition variable.
This routine must be called before using any condition variable not initialized with static storage class and TMPI_THREAD_COND_INITIALIZER.
| cond | Pointer to previously allocated condition variable |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cond_signal | ( | tMPI_Thread_cond_t * | cond | ) |
Unblock one waiting thread.
This routine signals a condition variable to one thread (if any) waiting for it after calling tMPI_Thread_cond_wait().
| cond | condition variable |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_cond_wait | ( | tMPI_Thread_cond_t * | cond, |
| tMPI_Thread_mutex_t * | mtx ) |
Wait for a condition to be signaled.
This routine releases the mutex, and waits for the condition to be signaled by another thread before it returns.
Note that threads waiting for conditions with tMPI_Thread_cond_wait may be subject to spurious wakeups: use this function in a while loop and check the state of a predicate associated with the wakeup before leaving the loop.
| cond | condition variable |
| mtx | Mutex protecting the condition variable |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_create | ( | tMPI_Thread_t * | thread, |
| void *(* | start_routine )(void *), | ||
| void * | arg ) |
Create a new thread.
The new thread will call start_routine() with the argument arg.
Please be careful not to change arg after calling this function.
| [out] | thread | Pointer to thread ID |
| [in] | start_routine | The function to call in the new thread |
| [in] | arg | Argument to call with |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_equal | ( | tMPI_Thread_t | t1, |
| tMPI_Thread_t | t2 ) |
Check whether two thread pointers point to the same thread.
| [in] | t1 | Thread ID 1 |
| [in] | t2 | Thread ID 2 |
| TMPI_EXPORT void PLMD::thread_mpi::tMPI_Thread_exit | ( | void * | value_ptr | ) |
Terminate calling thread.
Die voluntarily.
| value_ptr | Pointer to a return value. Threads waiting for us to join them can read this value if they try. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_get_hw_number | ( | void | ) |
Get the number of hardware threads that can be run simultaneously.
Returns the total number of cores and SMT threads that can run.
| TMPI_EXPORT void * PLMD::thread_mpi::tMPI_Thread_getspecific | ( | tMPI_Thread_key_t | key | ) |
Get value for thread-specific-storage in this thread.
If it has not yet been set, NULL is returned.
| key | Thread-specific-storage handle. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_join | ( | tMPI_Thread_t | thread, |
| void ** | value_ptr ) |
Wait for a specific thread to finish executing.
If the thread has already finished the routine returns immediately.
| [in] | thread | Pointer to thread ID |
| [out] | value_ptr | Pointer to location where to store pointer to exit value from threads that called tMPI_Thread_exit(). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_key_create | ( | tMPI_Thread_key_t * | key, |
| void(* | destructor )(void *) ) |
Initialize thread-specific-storage handle.
The tMPI_Thread_key_t handle must always be initialized dynamically with this routine. If you need to initialize it statically in a file, use the tMPI_Thread_once() routine and corresponding data to initialize the thread-specific-storage key the first time you access it.
| key | Pointer to opaque thread key type. |
| destructor | Routine to call (to free memory of key) when we quit |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_key_delete | ( | tMPI_Thread_key_t | key | ) |
Delete thread-specific-storage handle.
Calling this routine will kill the handle, and invoke the automatic destructor routine for each non-NULL value pointed to by key.
| key | Opaque key type to destroy |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_mutex_destroy | ( | tMPI_Thread_mutex_t * | mtx | ) |
Kill a mutex you no longer need.
Note that this call only frees resources allocated inside the mutex. It does not free the tMPI_Thread_mutex_t memory area itself if you created it with dynamic memory allocation.
| mtx | Pointer to a mutex variable to get rid of. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_mutex_init | ( | tMPI_Thread_mutex_t * | mtx | ) |
Initialize a new mutex.
This routine must be called before using any mutex not initialized with static storage class and TMPI_THREAD_MUTEX_INITIALIZER.
| mtx | Pointer to a mutex opaque type. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_mutex_lock | ( | tMPI_Thread_mutex_t * | mtx | ) |
Wait for exclusive access to a mutex.
This routine does not return until the mutex has been acquired.
| mtx | Pointer to the mutex to lock |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_mutex_trylock | ( | tMPI_Thread_mutex_t * | mtx | ) |
Try to lock a mutex, return if busy.
This routine always returns directly.
| mtx | Pointer to the mutex to try and lock |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_mutex_unlock | ( | tMPI_Thread_mutex_t * | mtx | ) |
Release the exclusive access to a mutex.
| mtx | Pointer to the mutex to release |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_once | ( | tMPI_Thread_once_t * | once_data, |
| void(* | init_routine )(void) ) |
Run the provided routine exactly once.
The control data must have been initialized before calling this routine, but you can do it with the static initialzer TMPI_THREAD_ONCE_INIT.
tMPI_Thread_once() will not return to any of the calling routines until the initialization function has been completed.
| once_data | Initialized one-time execution data |
| init_routine | Function to call exactly once |
| TMPI_EXPORT tMPI_Thread_t PLMD::thread_mpi::tMPI_Thread_self | ( | void | ) |
Get a thread ID of the calling thread.
This function also works on threads not started with tMPI_Thread_create, or any other function in thread_mpi. This makes it possible to, for example assign thread affinities to any thread.
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_setaffinity_single | ( | tMPI_Thread_t | thread, |
| unsigned int | nr ) |
Set thread affinity to a single core.
This function sets the thread affinity of a thread to a a specific numbered processor. This only works if the underlying operating system supports it. The processor number must be between 0 and the number returned by tMPI_Thread_get_hw_number().
| [in] | thread | Thread ID of the thread to set affinity for |
| [in] | nr | Processor number to set affinity to |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Thread_setspecific | ( | tMPI_Thread_key_t | key, |
| void * | value ) |
Set value for thread-specific-storage in this thread.
| key | Thread-specific-storage handle. |
| value | What to set the data to (pointer-to-void). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Topo_test | ( | tMPI_Comm | comm, |
| int * | status ) |
Check what type of topology the comm has.
| [in] | comm | The comm to query |
| [out] | status | The type of topology. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Type_commit | ( | tMPI_Datatype * | datatype | ) |
Make a data type ready for use.
| [in,out] | datatype | The new datatype. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Type_contiguous | ( | int | count, |
| tMPI_Datatype | oldtype, | ||
| tMPI_Datatype * | newtype ) |
Create a contiguous data type (the only type possible right now).
Creates a datatype that is a vector of oldtype.
| [in] | count | The number of oldtype types in the new type. |
| [in] | oldtype | The old data type. |
| [out] | newtype | The new data type (still needs to be committed). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Type_free | ( | tMPI_Datatype * | datatype | ) |
Free the datatype.
| [in,out] | datatype | The datatype to destroy. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Wait | ( | tMPI_Request * | request, |
| tMPI_Status * | status ) |
Wait until a message is transferred.
| [in,out] | request | The request obtained wit tMPI_Isend()/tMPI_Irecv(). |
| [out] | status | Message status. |
| void PLMD::thread_mpi::tMPI_Wait_for_data | ( | struct tmpi_thread * | cur, |
| struct coll_env * | cev, | ||
| int | myrank ) |
| void PLMD::thread_mpi::tMPI_Wait_for_others | ( | struct coll_env * | cev, |
| int | myrank ) |
| void PLMD::thread_mpi::tMPI_Wait_process_incoming | ( | struct tmpi_thread * | th | ) |
| void PLMD::thread_mpi::tMPI_Wait_single | ( | struct tmpi_thread * | cur, |
| struct tmpi_req_ * | rq ) |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Waitall | ( | int | count, |
| tMPI_Request * | array_of_requests, | ||
| tMPI_Status * | array_of_statuses ) |
Wait until several messages are transferred.
| [in] | count | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | array_of_statuses | List of count message statuses (can be set to TMPI_STATUSES_IGNORE). |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Waitany | ( | int | count, |
| tMPI_Request * | array_of_requests, | ||
| int * | index, | ||
| tMPI_Status * | status ) |
Wait until one of several messages is transferred.
| [in] | count | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | index | Index of the request that has completed. |
| [out] | status | Pointer to tMPI_Status object associated with completed request. |
| TMPI_EXPORT int PLMD::thread_mpi::tMPI_Waitsome | ( | int | incount, |
| tMPI_Request * | array_of_requests, | ||
| int * | outcount, | ||
| int * | array_of_indices, | ||
| tMPI_Status * | array_of_statuses ) |
Wait until some of several messages are transferred.
Waits until at least one message is transferred.
| [in] | incount | The number of requests |
| [in,out] | array_of_requests | List of count requests obtained with tMPI_Isend()/tMPI_Irecv(). |
| [out] | outcount | Number of completed requests |
| [out] | array_of_indices | Array of ints that gets filled with the indices of the completed requests. |
| [out] | array_of_statuses | List of count message statuses (can be set to TMPI_STATUSES_IGNORE). |
| TMPI_EXPORT double PLMD::thread_mpi::tMPI_Wtick | ( | void | ) |
get the resolution of tMPI_Wtime as a double, in seconds
| TMPI_EXPORT double PLMD::thread_mpi::tMPI_Wtime | ( | void | ) |
get a time value as a double, in seconds.
|
extern |
|
extern |
|
extern |
|
extern |
byte (for binary xmissions)
|
extern |
bool
|
extern |
char
|
extern |
Pre-initialized communicator with all available threads.
|
extern |
double
|
extern |
pre-defined error handler that abort()s on every error
|
extern |
pre-defined error handler that tries to continue on every error
|
extern |
float
|
extern |
|
extern |
the empty group
|
extern |
int
|
extern |
int64_t
|
extern |
long
|
extern |
long double
|
extern |
pointer (thread_mpi specific)
|
extern |
short
|
extern |
signed char
|
extern |
unsigned int
|
extern |
unsigned char
|
extern |
unsigned long
|
extern |
unsigned short
Hosted by GitHub
|
1.13.2
|