📄 mpid_nem_impl.h
字号:
/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2006 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#ifndef MPID_NEM_IMPL_H#define MPID_NEM_IMPL_H#include "my_papi_defs.h"#include "mpidi_ch3_impl.h"#include "mpid_nem_net_module_defs.h"#include "mpid_nem_atomics.h"#include "mpid_nem_defs.h"#include "mpid_nem_memdefs.h"#include "mpid_nem_fbox.h"#include "mpid_nem_nets.h"#include "mpid_nem_queue.h"#include "mpid_nem_generic_queue.h"#define MPID_NEM__BYPASS_Q_MAX_VAL ((MPID_NEM_MPICH2_DATA_LEN) - (sizeof(MPIDI_CH3_Pkt_t)))int MPID_nem_seg_create(MPID_nem_seg_ptr_t, int, int num_local, int local_rank, MPIDI_PG_t *pg_p);int MPID_nem_seg_destroy (void);int MPID_nem_seg_alloc( MPID_nem_seg_ptr_t, MPID_nem_seg_info_ptr_t, int);int MPID_nem_check_alloc(int);int MPID_nem_mpich2_init (int ckpt_restart);int MPID_nem_mpich2_send_ckpt_marker (unsigned short wave, MPIDI_VC_t *vc, int *try_again);int MPID_nem_coll_barrier_init (void);int MPID_nem_send_iov(MPIDI_VC_t *vc, MPID_Request **sreq_ptr, MPID_IOV *iov, int n_iov);int MPID_nem_lmt_pkthandler_init(MPIDI_CH3_PktHandler_Fcn *pktArray[], int arraySize);int MPID_nem_register_initcomp_cb(int (* callback)(void));#define MPID_nem_mpich2_release_fbox(cell) (MPID_nem_mem_region.mailboxes.in[(cell)->pkt.mpich2.source]->mpich2.flag.value = 0, \ MPI_SUCCESS)/* Shared memory allocation utility functions *//* MPID_nem_allocate_shared_memory allocates a shared mem region of size "length" and attaches to it. "handle" points to a string descriptor for the region to be passed in to MPID_nem_attach_shared_memory. "handle" is dynamically allocated and should be freed by the caller.*/int MPID_nem_allocate_shared_memory (char **buf_p, const int length, char *handle[]);/* MPID_nem_attach_shared_memory attaches to shared memory previously allocated by MPID_nem_allocate_shared_memory *//*int MPID_nem_attach_shared_memory (char **buf_p, const int length, const char const handle[]);*/int MPID_nem_attach_shared_memory (char **buf_p, const int length, const char handle[]);/* MPID_nem_remove_shared_memory removes the OS descriptor associated with the handle. Once all processes detatch from the region the OS resource will be destroyed. *//*int MPID_nem_remove_shared_memory (const char const handle[]);*/int MPID_nem_remove_shared_memory (const char handle[]);/* MPID_nem_detach_shared_memory detaches the shared memory region from this process */int MPID_nem_detach_shared_memory (const char *buf_p, const int length);/* initialize shared-memory MPI_Barrier variables */int MPID_nem_barrier_vars_init (MPID_nem_barrier_vars_t *barrier_region);static inline voidMPID_nem_waitforlock (MPID_nem_fbox_common_ptr_t pbox, int value, int count){ DO_PAPI2 (PAPI_reset (PAPI_EventSet)); while (pbox->flag.value != value) { if(--count == 0) { sched_yield(); } DO_PAPI2 (PAPI_reset (PAPI_EventSet)); } DO_PAPI2 (PAPI_accum_var (PAPI_EventSet, PAPI_vvalues8));}static inline intMPID_nem_islocked (MPID_nem_fbox_common_ptr_t pbox, int value, int count){ while (pbox->flag.value != value && --count == 0) { } return (pbox->flag.value != value);}/* Nemesis packets */typedef enum MPID_nem_pkt_type{ MPIDI_NEM_PKT_LMT_RTS = MPIDI_CH3_PKT_END_ALL+1, MPIDI_NEM_PKT_LMT_CTS, MPIDI_NEM_PKT_LMT_DONE, MPIDI_NEM_PKT_LMT_COOKIE, MPIDI_NEM_PKT_END } MPID_nem_pkt_type_t;typedef struct MPID_nem_pkt_lmt_rts{ MPID_nem_pkt_type_t type; MPIDI_Message_match match; MPI_Request sender_req_id; MPIDI_msg_sz_t data_sz; MPIDI_msg_sz_t cookie_len;}MPID_nem_pkt_lmt_rts_t;typedef struct MPID_nem_pkt_lmt_cts{ MPID_nem_pkt_type_t type; MPI_Request sender_req_id; MPI_Request receiver_req_id; MPIDI_msg_sz_t data_sz; MPIDI_msg_sz_t cookie_len;}MPID_nem_pkt_lmt_cts_t;typedef struct MPID_nem_pkt_lmt_done{ MPID_nem_pkt_type_t type; MPI_Request req_id;}MPID_nem_pkt_lmt_done_t;typedef struct MPID_nem_pkt_lmt_cookie{ MPID_nem_pkt_type_t type; MPI_Request req_id; MPIDI_msg_sz_t cookie_len;}MPID_nem_pkt_lmt_cookie_t;typedef union MPIDI_CH3_nem_pkt{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -