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

📄 getreturnthread.cpp

📁 MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程环境.
💻 CPP
字号:
#include "GetReturnThread.h"#include "global.h"// Function name	: GetReturnThread// Description	    : // Return type		: void // Argument         : GetReturnThreadArg *pArgvoid GetReturnThread(GetReturnThreadArg *pArg){	int n = 0;	void *pDbsValue;	char *pBuf;	MPD_CMD_HANDLE hCommand;	g_Database.Get(pArg->pszDbsID, pArg->pszDbsKey, pDbsValue, &n);	if (n>0)	{		pDbsValue = new char[n];		if (g_Database.Get(pArg->pszDbsID, pArg->pszDbsKey, pDbsValue, &n) == MPI_DBS_SUCCESS)		{			pArg->command.hCmd.nBufferLength = 2 * sizeof(unsigned long) + 2 * sizeof(int);			pBuf = &pArg->command.pCommandBuffer[2 * sizeof(unsigned long) + sizeof(int)];			*((int *)(pBuf)) = n;			pBuf += sizeof(int);			memcpy(pBuf, pDbsValue, n);			delete pArg->pszDbsKey;		}		delete pDbsValue;	}	pArg->command.hCmd.nBufferLength += n;	pArg->command.nCommand = MPD_CMD_FORWARD;		hCommand = InsertCommand(pArg->command);	//WaitForCommand(hCommand);	delete pArg;}// Function name	: GetThread// Description	    : // Return type		: void // Argument         : GetReturnThreadArg *pArgvoid GetThread(GetReturnThreadArg *pArg){	int n = 0;	void *pDbsValue = NULL;	g_Database.Get(pArg->pszDbsID, pArg->pszDbsKey, pDbsValue, &n);	if (n>0)	{		pDbsValue = new char[n];		if (g_Database.Get(pArg->pszDbsID, pArg->pszDbsKey, pDbsValue, &n) == MPI_DBS_SUCCESS)		{			pArg->pCommand->hCmd.nBufferLength = n;			memcpy(pArg->pCommand->pCommandBuffer, pDbsValue, n);			delete pArg->pszDbsKey;		}		delete pDbsValue;	}	MarkCommandCompleted(pArg->pCommand);	delete pArg;}

⌨️ 快捷键说明

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