2005-05-24 02:06:50 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2009-12-16 02:34:09 +03:00
|
|
|
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2008-03-09 16:17:13 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-05-24 02:06:50 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2008-01-09 21:50:51 +03:00
|
|
|
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
2009-12-16 02:34:09 +03:00
|
|
|
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* $COPYRIGHT$
|
2008-03-09 16:17:13 +03:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* Additional copyrights may follow
|
2008-03-09 16:17:13 +03:00
|
|
|
*
|
2005-05-24 02:06:50 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
#ifndef MCA_BTL_SM_SEND_FRAG_H
|
|
|
|
#define MCA_BTL_SM_SEND_FRAG_H
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_sm.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
|
2007-03-05 17:24:09 +03:00
|
|
|
#define MCA_BTL_SM_FRAG_TYPE_MASK ((uintptr_t)0x3)
|
|
|
|
#define MCA_BTL_SM_FRAG_SEND ((uintptr_t)0x0)
|
|
|
|
#define MCA_BTL_SM_FRAG_ACK ((uintptr_t)0x1)
|
|
|
|
#define MCA_BTL_SM_FRAG_PUT ((uintptr_t)0x2)
|
|
|
|
#define MCA_BTL_SM_FRAG_GET ((uintptr_t)0x3)
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2007-03-05 17:24:09 +03:00
|
|
|
#define MCA_BTL_SM_FRAG_STATUS_MASK ((uintptr_t)0x4)
|
2007-03-05 17:17:50 +03:00
|
|
|
|
|
|
|
struct mca_btl_sm_frag_t;
|
|
|
|
|
|
|
|
struct mca_btl_sm_hdr_t {
|
|
|
|
struct mca_btl_sm_frag_t *frag;
|
2007-03-05 17:24:09 +03:00
|
|
|
size_t len;
|
2009-02-17 18:58:15 +03:00
|
|
|
int my_smp_rank;
|
2007-03-05 17:24:09 +03:00
|
|
|
mca_btl_base_tag_t tag;
|
2007-03-05 17:17:50 +03:00
|
|
|
};
|
|
|
|
typedef struct mca_btl_sm_hdr_t mca_btl_sm_hdr_t;
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2012-06-21 21:09:12 +04:00
|
|
|
struct mca_btl_sm_segment_t {
|
|
|
|
mca_btl_base_segment_t base;
|
|
|
|
#if OMPI_BTL_SM_HAVE_KNEM || OMPI_BTL_SM_HAVE_CMA
|
|
|
|
uint64_t key;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
typedef struct mca_btl_sm_segment_t mca_btl_sm_segment_t;
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
/**
|
|
|
|
* shared memory send fragment derived type.
|
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_sm_frag_t {
|
|
|
|
mca_btl_base_descriptor_t base;
|
2012-06-21 21:09:12 +04:00
|
|
|
mca_btl_sm_segment_t segment;
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint;
|
2005-05-24 02:06:50 +04:00
|
|
|
size_t size;
|
2007-08-28 01:41:04 +04:00
|
|
|
/* pointer written to the FIFO, this is the base of the shared memory region */
|
2007-03-05 17:17:50 +03:00
|
|
|
mca_btl_sm_hdr_t *hdr;
|
2006-05-31 18:24:32 +04:00
|
|
|
ompi_free_list_t* my_list;
|
2005-05-24 02:06:50 +04:00
|
|
|
};
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_sm_frag_t mca_btl_sm_frag_t;
|
|
|
|
typedef struct mca_btl_sm_frag_t mca_btl_sm_frag1_t;
|
|
|
|
typedef struct mca_btl_sm_frag_t mca_btl_sm_frag2_t;
|
2009-12-16 02:34:09 +03:00
|
|
|
typedef struct mca_btl_sm_frag_t mca_btl_sm_user_t;
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_sm_frag_t);
|
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_sm_frag1_t);
|
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_sm_frag2_t);
|
2009-12-16 02:34:09 +03:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_sm_user_t);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2008-12-18 01:14:59 +03:00
|
|
|
#define MCA_BTL_SM_FRAG_ALLOC_EAGER(frag, rc) \
|
2006-10-07 01:13:49 +04:00
|
|
|
{ \
|
|
|
|
ompi_free_list_item_t* item; \
|
2008-05-30 07:58:39 +04:00
|
|
|
OMPI_FREE_LIST_GET(&mca_btl_sm_component.sm_frags_eager, item, rc); \
|
2006-10-07 01:13:49 +04:00
|
|
|
frag = (mca_btl_sm_frag_t*)item; \
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
2008-12-18 01:14:59 +03:00
|
|
|
#define MCA_BTL_SM_FRAG_ALLOC_MAX(frag, rc) \
|
2006-10-07 01:13:49 +04:00
|
|
|
{ \
|
|
|
|
ompi_free_list_item_t* item; \
|
2008-05-30 07:58:39 +04:00
|
|
|
OMPI_FREE_LIST_GET(&mca_btl_sm_component.sm_frags_max, item, rc); \
|
2006-10-07 01:13:49 +04:00
|
|
|
frag = (mca_btl_sm_frag_t*)item; \
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
2009-12-16 02:34:09 +03:00
|
|
|
#define MCA_BTL_SM_FRAG_ALLOC_USER(frag, rc) \
|
|
|
|
{ \
|
|
|
|
ompi_free_list_item_t* item; \
|
|
|
|
OMPI_FREE_LIST_GET(&mca_btl_sm_component.sm_frags_user, item, rc); \
|
|
|
|
frag = (mca_btl_sm_frag_t*)item; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-31 18:24:32 +04:00
|
|
|
#define MCA_BTL_SM_FRAG_RETURN(frag) \
|
2005-05-24 02:06:50 +04:00
|
|
|
{ \
|
2006-08-24 20:38:08 +04:00
|
|
|
OMPI_FREE_LIST_RETURN(frag->my_list, (ompi_free_list_item_t*)(frag)); \
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
#endif
|