第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

MPI_Rank為所有進(jìn)程返回相同的進(jìn)程號

MPI_Rank為所有進(jìn)程返回相同的進(jìn)程號

繁星coding 2020-02-01 16:55:22
我正在嘗試在debian 7上使用openmpi和mpirun運(yùn)行此示例hello world程序。#include <stdio.h>#include <mpi/mpi.h>int main (int argc, char **argv) {   int nProcId, nProcNo;   int nNameLen;   char szMachineName[MPI_MAX_PROCESSOR_NAME];   MPI_Init (&argc, &argv); // Start up MPI   MPI_Comm_size (MPI_COMM_WORLD,&nProcNo); // Find out number of processes   MPI_Comm_rank (MPI_COMM_WORLD, &nProcId); // Find out process rank   MPI_Get_processor_name (szMachineName, &nNameLen); // Get machine name   printf ("Hello World from process %d on %s\r\n", nProcId, szMachineName);   if (nProcId == 0)      printf ("Number of Processes: %d\r\n", nProcNo);   MPI_Finalize (); // Shut down MPI   return 0;}我的問題是MPI_Comm_Rank該過程的所有副本都返回0。當(dāng)我在外殼上運(yùn)行此命令時:mpirun -np 4  helloWorld它產(chǎn)生以下輸出:Hello World from process 0 on debianNumber of Processes: 1Hello World from process 0 on debianNumber of Processes: 1Hello World from process 0 on debianNumber of Processes: 1Hello World from process 0 on debianNumber of Processes: 1為什么進(jìn)程數(shù)仍為1?
查看完整描述

2 回答

?
侃侃爾雅

TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超16個贊

我在Mint 17上同時安裝了openmpi和mpich,并使用進(jìn)行了切換update-alternatives --configure mpi。但是,這不會關(guān)閉mpiexec實(shí)現(xiàn),您還必須為此執(zhí)行update-alternatives --configure mpirun。

查看完整回答
反對 回復(fù) 2020-02-01
  • 2 回答
  • 0 關(guān)注
  • 1137 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號