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

📄 mpd_nameserv.c

📁 mpi并行计算的c++代码 可用vc或gcc编译通过 可以用来搭建并行计算试验环境
💻 C
字号:
/* -*- Mode: C; c-basic-offset:4 ; -*- *//*  $Id: mpd_nameserv.c,v 1.3 2005/09/29 21:09:35 lusk Exp $ * *  (C) 2001 by Argonne National Laboratory. *      See COPYRIGHT in top-level directory. *//* * This file contains a simple mpd-based implementation of the name server routines, * using the mpd daemons to hold the data, but accessing it through the PMI interface. * Publishing will go to the local mpd; lookup will search the ring, looking for the * data. */#include "mpiimpl.h"#include "namepub.h"#include "pmi.h"/* style: allow:fprintf:1 sig:0 */   /* For writing the name/service pair *//* Define the name service handle */#define MPID_MAX_NAMEPUB 64struct MPID_NS_Handle {    int foo;			/* unused for now; some compilers object				   to empty structs */};    /* Create a structure that we will use to remember files created for   publishing.  */#undef FUNCNAME#define FUNCNAME MPID_NS_Createint MPID_NS_Create( const MPID_Info *info_ptr, MPID_NS_Handle *handle_ptr ){    static const char FCNAME[] = "MPID_NS_Create";    *handle_ptr = NULL;		/* The mpd name service needs no local data */                                /* All will be handled at the mpd through the PMI interface */    return 0;}#undef FUNCNAME#define FUNCNAME MPID_NS_Publishint MPID_NS_Publish( MPID_NS_Handle handle, const MPID_Info *info_ptr,                      const char service_name[], const char port[] ){    int rc;    static const char FCNAME[] = "MPID_NS_Publish";    rc = PMI_Publish_name( service_name, port );    if (rc != PMI_SUCCESS) {	/* --BEGIN ERROR HANDLING-- */	/* printf( "PMI_Publish_name failed for %s\n", service_name ); */	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotpub", "**namepubnotpub %s", service_name );	/* --END ERROR HANDLING-- */    }    return 0;}#undef FUNCNAME#define FUNCNAME MPID_NS_Lookupint MPID_NS_Lookup( MPID_NS_Handle handle, const MPID_Info *info_ptr,                    const char service_name[], char port[] ){    int rc;    static const char FCNAME[] = "MPID_NS_Lookup";    rc = PMI_Lookup_name( service_name, port );    if (rc != PMI_SUCCESS) {	/* --BEGIN ERROR HANDLING-- */	/* printf( "PMI_Lookup_name failed for %s\n", service_name ); */	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotfound", "**namepubnotfound %s", service_name );	/* --END ERROR HANDLING-- */    }    return 0;}#undef FUNCNAME#define FUNCNAME MPID_NS_Unpublishint MPID_NS_Unpublish( MPID_NS_Handle handle, const MPID_Info *info_ptr,                        const char service_name[] ){    int rc;    static const char FCNAME[] = "MPID_NS_Unpublish";    rc = PMI_Unpublish_name( service_name );    if (rc != PMI_SUCCESS) {	/* --BEGIN ERROR HANDLING-- */	/* printf( "PMI_Unpublish_name failed for %s\n", service_name ); */	return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_NAME, "**namepubnotunpub", "**namepubnotunpub %s", service_name );	/* --END ERROR HANDLING-- */    }    return 0;}#undef FUNCNAME#define FUNCNAME MPID_NS_Freeint MPID_NS_Free( MPID_NS_Handle *handle_ptr ){    /* MPID_NS_Handle is Null */    return 0;}

⌨️ 快捷键说明

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