2004-01-14 06:44:11 +03:00
|
|
|
#ifndef MCA_PML_COMM_H
|
|
|
|
#define MCA_PML_COMM_H
|
|
|
|
|
|
|
|
#include "lam/threads/mutex.h"
|
2004-03-15 17:46:12 +03:00
|
|
|
#include "lam/threads/condition.h"
|
2004-01-14 06:44:11 +03:00
|
|
|
#include "mca/mpi/ptl/ptl.h"
|
2004-02-11 01:15:55 +03:00
|
|
|
#include "lam/lfc/lam_list.h"
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure associated w/ lam_communicator_t that contains data
|
|
|
|
* specific to the PML.
|
|
|
|
*/
|
|
|
|
|
2004-02-13 01:42:39 +03:00
|
|
|
extern lam_class_t mca_pml_comm_t_class;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
struct mca_pml_comm_t {
|
2004-01-29 02:47:02 +03:00
|
|
|
lam_object_t super;
|
|
|
|
|
2004-01-14 06:44:11 +03:00
|
|
|
/* send message sequence-number support - sender side */
|
2004-01-29 01:52:51 +03:00
|
|
|
mca_ptl_base_sequence_t *c_msg_seq;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/* send message sequence-number support - receiver side */
|
2004-01-29 01:52:51 +03:00
|
|
|
mca_ptl_base_sequence_t *c_next_msg_seq;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/* matching lock */
|
|
|
|
lam_mutex_t *c_matching_lock;
|
|
|
|
|
|
|
|
/* unexpected fragments queues */
|
2004-01-30 02:50:31 +03:00
|
|
|
lam_list_t *c_unexpected_frags;
|
2004-03-12 01:02:01 +03:00
|
|
|
|
|
|
|
/* these locks are needed to avoid a probe interfering with a match */
|
2004-01-30 02:50:31 +03:00
|
|
|
lam_mutex_t *c_unexpected_frags_lock;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/* out-of-order fragments queues */
|
2004-01-30 02:50:31 +03:00
|
|
|
lam_list_t *c_frags_cant_match;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/* queues of unmatched specific (source process specified) receives
|
|
|
|
* sorted by source process */
|
2004-01-30 02:50:31 +03:00
|
|
|
lam_list_t *c_specific_receives;
|
2004-01-14 06:44:11 +03:00
|
|
|
|
|
|
|
/* queue of unmatched wild (source process not specified) receives
|
|
|
|
* */
|
2004-01-30 02:50:31 +03:00
|
|
|
lam_list_t c_wild_receives;
|
|
|
|
|
|
|
|
/* protect access to wild receives */
|
|
|
|
lam_mutex_t c_wild_lock;
|
2004-01-14 06:44:11 +03:00
|
|
|
};
|
|
|
|
typedef struct mca_pml_comm_t mca_pml_comm_t;
|
|
|
|
|
|
|
|
|
2004-03-12 01:02:01 +03:00
|
|
|
extern int mca_pml_ptl_comm_init_size(struct mca_pml_comm_t*, size_t);
|
|
|
|
|
|
|
|
static inline mca_ptl_base_sequence_t mca_pml_ptl_comm_send_sequence(struct mca_pml_comm_t* comm, int dst)
|
|
|
|
{
|
|
|
|
mca_ptl_base_sequence_t sequence;
|
|
|
|
lam_mutex_lock(comm->c_matching_lock+dst);
|
|
|
|
sequence = comm->c_msg_seq[dst]++;
|
|
|
|
lam_mutex_unlock(comm->c_matching_lock+dst);
|
|
|
|
return sequence;
|
|
|
|
}
|
2004-01-14 18:57:54 +03:00
|
|
|
|
2004-01-14 06:44:11 +03:00
|
|
|
#endif
|
|
|
|
|