2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

いま再びのシステムまぎちゃんへの道~並列処理環境を手に入れよう~

Last updated at Posted at 2019-12-02

並列処理環境をゲットする。その前に

前回、Fedoraのインストールまで行いました。
では、次に並列処理環境を入れたいのですが、
まずは、各種アプリケーションやライブラリのアップデートをします。

# dnf update

これで、環境がアップデートされます。

やっと並列処理環境が入る

これも簡単です。

# dnf install mpich mpich-devel mpich-doc

をインストールすると自動的に依存関係があるパッケージを落としてきてくれます。
あとは、インストールが終わるのを待つだけ。

ついでなので、OpenMPIを入れます。これも楽勝

# dnf install oepnmpi openmpi-devel

もう一つおまけに libomp をいれてスレッド並列環境を手に入れましょう。

# dnf install libomp libomp-test libomp-devel

とりあえずOpenMPだけテストしてみます。

[evakichi@localhost OpenMP]$ cat test.c
# include <stdio.h>
# include "omp.h"

int main()
{

# pragma omp parallel
{
int rank = omp_get_thread_num();
int size = omp_get_num_threads();
printf ("hello i am %d/%d\n",rank,size);
}
}
[evakichi@localhost OpenMP]$ gcc -fopenmp test.c
[evakichi@localhost OpenMP]$ ./a.out
hello i am 3/4
hello i am 0/4
hello i am 1/4
hello i am 2/4
[evakichi@localhost OpenMP]$

OKですね。

さて終了。MPIの動作確認はまた後程。というか全台変更しないといけないのですぐには試験できません。あしからず。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?