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

📄 ch3_init.c

📁 mpi并行计算的c++代码 可用vc或gcc编译通过 可以用来搭建并行计算试验环境
💻 C
字号:
/* -*- Mode: C; c-basic-offset:4 ; -*- *//* *  (C) 2001 by Argonne National Laboratory. *      See COPYRIGHT in top-level directory. */#include "mpidi_ch3_impl.h"/* *  MPIDI_CH3_Init  - makes socket specific initializations.  Most of this  *                    functionality is in the MPIDI_CH3U_Init_sock upcall  *                    because the same tasks need to be done for the ssh  *                    (sock + shm) channel.   */#undef FUNCNAME#define FUNCNAME MPIDI_CH3_Init#undef FCNAME#define FCNAME MPIDI_QUOTE(FUNCNAME)int MPIDI_CH3_Init(int has_parent, MPIDI_PG_t * pg_p, int pg_rank ){    int mpi_errno = MPI_SUCCESS;    char *publish_bc_orig = NULL;    char *bc_key = NULL;    char *bc_val = NULL;    int val_max_remaining;    MPIDI_STATE_DECL(MPID_STATE_MPID_CH3_INIT);    MPIDI_FUNC_ENTER(MPID_STATE_MPID_CH3_INIT);    mpi_errno = MPIDI_CH3I_Acceptq_init();    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);    mpi_errno = MPIDI_CH3I_Progress_init();    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);    /* Initialize the business card */    mpi_errno = MPIDI_CH3I_BCInit( pg_rank, &publish_bc_orig, &bc_key, &bc_val,				   &val_max_remaining );    if (mpi_errno) MPIU_ERR_POP(mpi_errno);    /* initialize aspects specific to sockets  */    mpi_errno = MPIDI_CH3U_Init_sock(has_parent, pg_p, pg_rank,				     &publish_bc_orig, &bc_key, &bc_val, 				     &val_max_remaining);    if (mpi_errno) MPIU_ERR_POP(mpi_errno); fn_exit:    MPIDI_FUNC_EXIT(MPID_STATE_MPID_CH3_INIT);    return mpi_errno; fn_fail:    if (bc_key != NULL) {        MPIU_Free(bc_key);    }    if (publish_bc_orig != NULL) {        MPIU_Free(publish_bc_orig);    }               goto fn_exit;}/* This function simply tells the CH3 device to use the defaults for the    MPI Port functions */int MPIDI_CH3_PortFnsInit( MPIDI_PortFns *portFns ) {    MPIU_UNREFERENCED_ARG(portFns);    return 0;}/* This function simply tells the CH3 device to use the defaults for the    MPI-2 RMA functions */int MPIDI_CH3_RMAFnsInit( MPIDI_RMAFns *a ) {     return 0;}/* Perform the channel-specific vc initialization */int MPIDI_CH3_VC_Init( MPIDI_VC_t *vc ) {    vc->ch.sendq_head         = NULL;    vc->ch.sendq_tail         = NULL;    vc->ch.state              = MPIDI_CH3I_VC_STATE_UNCONNECTED;    MPIDI_VC_InitSock( vc );    return 0;}/* Select the routine that uses sockets to connect two communicators   using a socket */int MPIDI_CH3_Connect_to_root(const char * port_name, 			      MPIDI_VC_t ** new_vc){    return MPIDI_CH3I_Connect_to_root_sock( port_name, new_vc );}

⌨️ 快捷键说明

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