⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpid_rma.c

📁 fortran并行计算包
💻 C
📖 第 1 页 / 共 2 页
字号:
#undef FUNCNAME#define FUNCNAME MPID_Win_start#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_START);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_START);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Win_start.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Win_start.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Win_start) {	mpi_errno = RMAFns.Win_start(group_ptr, assert, win_ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    } fn_fail:    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_START);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Win_complete#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_complete(MPID_Win *win_ptr){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_COMPLETE);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_COMPLETE);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Win_complete.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Win_complete.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Win_complete) {	mpi_errno = RMAFns.Win_complete(win_ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    } fn_fail:    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_COMPLETE);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Win_wait#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_wait(MPID_Win *win_ptr){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_WAIT);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_WAIT);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Win_wait.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Win_wait.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Win_wait) {	mpi_errno = RMAFns.Win_wait(win_ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    } fn_fail:    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_WAIT);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Win_lock#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_LOCK);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_LOCK);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Win_lock.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Win_lock.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Win_lock) {	mpi_errno = RMAFns.Win_lock(lock_type, dest, assert, win_ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    } fn_fail:    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_LOCK);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Win_unlock#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_unlock(int dest, MPID_Win *win_ptr){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_UNLOCK);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_UNLOCK);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Win_unlock.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Win_unlock.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Win_unlock) {	mpi_errno = RMAFns.Win_unlock(dest, win_ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    } fn_fail:    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_UNLOCK);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Alloc_mem#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)void *MPID_Alloc_mem( size_t size, MPID_Info *info_ptr ){    void *ap=NULL;    MPIDI_STATE_DECL(MPID_STATE_MPID_ALLOC_MEM);    MPIDI_FUNC_ENTER(MPID_STATE_MPID_ALLOC_MEM);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Alloc_mem.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Alloc_mem.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Alloc_mem) {	ap = RMAFns.Alloc_mem(size, info_ptr);    }        MPIDI_FUNC_EXIT(MPID_STATE_MPID_ALLOC_MEM);    return ap;}#undef FUNCNAME#define FUNCNAME MPID_Free_mem#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Free_mem( void *ptr ){    int mpi_errno = MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_FREE_MEM);    MPIDI_FUNC_ENTER(MPID_STATE_MPID_FREE_MEM);    /* Check to see if we need to setup channel-specific functions       for handling the RMA operations */    if (setupRMAFunctions) {	MPIU_CALL(MPIDI_CH3,RMAFnsInit( &RMAFns ));	setupRMAFunctions = 0;    }    /* The default for this function is MPIDI_Free_mem.       A channel may define its own function and set it in the        init check above; such a function may be named MPIDI_Free_mem.       If a channel does not implement this operation, it will set       the function pointer to NULL */    if (RMAFns.Free_mem) {	mpi_errno = RMAFns.Free_mem(ptr);	if (mpi_errno != MPI_SUCCESS) {	    MPIU_ERR_POP(mpi_errno);	}    }    else {	MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**notimpl");    }         fn_fail:    MPIDI_FUNC_EXIT(MPID_STATE_MPID_FREE_MEM);    return mpi_errno;}#undef FUNCNAME#define FUNCNAME MPID_Win_test#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPID_Win_test(MPID_Win *win_ptr, int *flag){    int mpi_errno=MPI_SUCCESS;    MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_TEST);    MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_TEST);    mpi_errno = MPID_Progress_test();    /* --BEGIN ERROR HANDLING-- */    if (mpi_errno != MPI_SUCCESS)    {        MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_TEST);        return mpi_errno;    }    /* --END ERROR HANDLING-- */    *flag = (win_ptr->my_counter) ? 0 : 1;    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_TEST);    return mpi_errno;}/* This was probably added by Brad. Leaving it here for now. Needs to be fixed    according to the FIXME below. *//* FIXME: It would be better to install this as an abort and a finalize    handler, ranter than expecting all routines to call this.  It   can be installed on first use of alloc_mem */#undef FUNCNAME#define FUNCNAME MPID_Cleanup_mem#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)void MPID_Cleanup_mem(){#if defined(MPIDI_CH3_IMPLEMENTS_CLEANUP_MEM)    MPIDI_CH3_Cleanup_mem();#endif}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -