[問題] 如何在Unix上使用MPI?
看板C_and_CPP (C/C++)作者htymrednuht (htymrednuht)時間15年前 (2010/11/04 14:12)推噓0(0推 0噓 7→)留言7則, 3人參與討論串1/1
使用code block 10.05, 語言c++, 環境Unix
compiler: GNU GCC compiler
在網上查了一些資料
http://140.113.239.139/~bioice/MPI/
使用下面的範例程式 MPI-01.c 中的程式碼做一些修改來測試:
----
#include<mpi.h>
#include<stdio.h>
#include<iostream>
using namespace std;
int main(int argc , char *argv[])
{
int myid, nproc;
MPI_Init(&argc, &argv);
MPI_Comm_size (MPI_COMM_WORLD, &nproc);
MPI_Comm_rank (MPI_COMM_WORLD, &myid);
cout << "I am CPU " << myid;
MPI_Finalize();
}
編譯後出現
undefined reference to MPI_Init
undefined reference to MPI_Comm_size
undefined reference to MPI_Comm_rank
undefined reference to MPI_Finalize
又去網上查詢code block mpi
http://topic.csdn.net/u/20100423/10/b242a828-e4f7-47d7-8864-a1aac711e56a.html
有看到 using namespace MPI;
但加上去後出現 MPI is not a namespace-name
想請問各位code block 使用MPI要怎麼設定?
謝謝各位
另問:
實驗室之前的電腦中一樣是unix使用code block 8.02
要使用openmp時
要在settings - compiler and debuger - other option中打上 -fopenmp
但換成cluster中code block 10.05一樣的設定與程式碼卻說
unrecognized command line option "-fopenmp"
想請問為甚麼?
感激不盡
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.97.87
※ 編輯: htymrednuht 來自: 114.32.97.87 (11/04 14:19)
→
11/04 18:48, , 1F
11/04 18:48, 1F
→
11/04 18:48, , 2F
11/04 18:48, 2F
→
11/04 19:29, , 3F
11/04 19:29, 3F
→
11/04 19:29, , 4F
11/04 19:29, 4F
→
11/04 20:45, , 5F
11/04 20:45, 5F
→
11/04 22:48, , 6F
11/04 22:48, 6F
→
11/04 22:51, , 7F
11/04 22:51, 7F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章