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