2006-08-23 07:32:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2008-01-25 17:07:38 +03:00
|
|
|
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
2006-08-23 07:32:36 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-01-12 23:51:34 +03:00
|
|
|
#ifndef _IOF_BASE_FRAGMENT_
|
|
|
|
#define _IOF_BASE_FRAGMENT_
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte_config.h"
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2005-07-02 20:46:27 +04:00
|
|
|
#include "opal/class/opal_free_list.h"
|
2005-07-04 03:09:55 +04:00
|
|
|
#include "opal/event/event.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/iof/iof.h"
|
|
|
|
#include "orte/mca/iof/base/base.h"
|
|
|
|
#include "orte/mca/iof/base/iof_base_header.h"
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-01-12 23:51:34 +03:00
|
|
|
|
|
|
|
/**
|
2005-03-14 23:57:21 +03:00
|
|
|
* Fragment used to hold message header/data.
|
2005-01-12 23:51:34 +03:00
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_iof_base_frag_t {
|
2006-07-18 01:51:50 +04:00
|
|
|
opal_free_list_item_t super;
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_iof_base_header_t frag_hdr;
|
|
|
|
orte_process_name_t frag_src;
|
|
|
|
unsigned char frag_data[ORTE_IOF_BASE_MSG_MAX];
|
2005-01-12 23:51:34 +03:00
|
|
|
unsigned char* frag_ptr;
|
|
|
|
size_t frag_len;
|
|
|
|
struct iovec frag_iov[2];
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_iof_base_endpoint_t* frag_owner;
|
2005-01-12 23:51:34 +03:00
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef struct orte_iof_base_frag_t orte_iof_base_frag_t;
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_base_frag_t);
|
2005-01-12 23:51:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2005-03-14 23:57:21 +03:00
|
|
|
* Free-list allocation of fragments.
|
2005-01-12 23:51:34 +03:00
|
|
|
*/
|
|
|
|
|
2008-01-25 17:07:38 +03:00
|
|
|
#define ORTE_IOF_BASE_FRAG_ALLOC(frag,rc) do { \
|
|
|
|
opal_free_list_item_t* _item; \
|
|
|
|
OPAL_FREE_LIST_GET(&orte_iof_base.iof_fragments, _item, rc); \
|
|
|
|
if(NULL == (frag = (orte_iof_base_frag_t*)_item)) { \
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "ORTE_IOF_BASE_FRAG_ALLOC failed with status=%d\n", rc); \
|
2005-01-12 23:51:34 +03:00
|
|
|
} \
|
2006-04-26 19:36:06 +04:00
|
|
|
frag->frag_owner = NULL; \
|
|
|
|
frag->frag_ptr = frag->frag_data; \
|
|
|
|
frag->frag_len = 0; \
|
2008-01-25 17:07:38 +03:00
|
|
|
} while(0)
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#define ORTE_IOF_BASE_FRAG_RETURN(frag) \
|
2006-07-18 01:51:50 +04:00
|
|
|
OPAL_FREE_LIST_RETURN(&orte_iof_base.iof_fragments, \
|
|
|
|
&frag->super);
|
2005-01-12 23:51:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send an acknowledgment to the peer that this fragment has been received.
|
|
|
|
*/
|
|
|
|
|
2007-06-09 02:59:31 +04:00
|
|
|
#define orte_iof_base_frag_ack(frag, do_close) _orte_iof_base_frag_ack((frag), (do_close), __FILE__,__LINE__)
|
|
|
|
int _orte_iof_base_frag_ack(orte_iof_base_frag_t*, bool do_close, const char*, int);
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2005-01-12 23:51:34 +03:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|