2004-03-26 17:15:20 +03:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-03-26 17:15:20 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2004-01-14 06:44:11 +03:00
|
|
|
#ifndef MCA_PML_COMM_H
|
|
|
|
#define MCA_PML_COMM_H
|
|
|
|
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "threads/mutex.h"
|
|
|
|
#include "threads/condition.h"
|
|
|
|
#include "mca/ptl/ptl.h"
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "class/ompi_list.h"
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-07-03 20:06:07 +04:00
|
|
|
OMPI_DECLSPEC extern opal_class_t mca_pml_ptl_comm_t_class;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
2004-06-07 19:33:53 +04:00
|
|
|
* Cached on ompi_communicator_t to hold queues/state
|
2004-03-26 17:15:20 +03:00
|
|
|
* used by the PML<->PTL interface for matching logic.
|
|
|
|
*/
|
2004-01-14 06:44:11 +03:00
|
|
|
struct mca_pml_comm_t {
|
2005-07-03 20:06:07 +04:00
|
|
|
opal_object_t super;
|
2004-12-03 00:47:40 +03:00
|
|
|
uint32_t *c_msg_seq; /**< send message sequence number - sender side */
|
2004-11-18 01:47:08 +03:00
|
|
|
uint16_t *c_next_msg_seq; /**< send message sequence number - receiver side */
|
|
|
|
mca_ptl_sequence_t c_recv_seq; /**< recv request sequence number - receiver side */
|
|
|
|
ompi_mutex_t c_matching_lock; /**< matching lock */
|
|
|
|
ompi_list_t *c_unexpected_frags; /**< unexpected fragment queues */
|
|
|
|
ompi_list_t *c_frags_cant_match; /**< out-of-order fragment queues */
|
|
|
|
ompi_list_t *c_specific_receives; /**< queues of unmatched specific (source process specified) receives */
|
|
|
|
ompi_list_t c_wild_receives; /**< queue of unmatched wild (source process not specified) receives */
|
2004-01-14 06:44:11 +03:00
|
|
|
};
|
2004-03-18 17:05:32 +03:00
|
|
|
typedef struct mca_pml_comm_t mca_pml_ptl_comm_t;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* Initialize an instance of mca_pml_ptl_comm_t based on the communicator size.
|
|
|
|
*
|
|
|
|
* @param comm Instance of mca_pml_ptl_comm_t
|
|
|
|
* @param size Size of communicator
|
2004-06-07 19:33:53 +04:00
|
|
|
* @return OMPI_SUCCESS or error status on failure.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC extern int mca_pml_ptl_comm_init_size(mca_pml_ptl_comm_t* comm, size_t size);
|
2004-03-26 17:15:20 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtain the next sequence number (MPI) for a given destination rank.
|
|
|
|
*
|
|
|
|
* @param comm Instance of mca_pml_ptl_comm_t
|
|
|
|
* @param dst Rank of destination.
|
|
|
|
* @return Next available sequence number.
|
|
|
|
*/
|
2004-03-12 01:02:01 +03:00
|
|
|
|
2004-12-03 00:47:40 +03:00
|
|
|
static inline mca_ptl_sequence_t mca_pml_ptl_comm_send_sequence(mca_pml_ptl_comm_t* comm, int dst)
|
2004-03-12 01:02:01 +03:00
|
|
|
{
|
2004-12-03 00:47:40 +03:00
|
|
|
volatile int32_t *msg_seq = (volatile int32_t*)(comm->c_msg_seq+dst);
|
|
|
|
return (mca_ptl_sequence_t)OMPI_THREAD_ADD32(msg_seq, 1)-1;
|
2004-03-12 01:02:01 +03:00
|
|
|
}
|
2004-01-14 18:57:54 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-01-14 06:44:11 +03:00
|
|
|
#endif
|
|
|
|
|