6

RmpiLAMMPIクラスターマシンにパッケージをインストールしようとしています。以前、私はいくつかのもの(mpi4pyおよび小さなC ++プログラム)をコンパイルしてテストしていたので、MPI自体が機能すると確信しています。Rmpiただし、ライブラリをリンクするときにパッケージのインストールは失敗します。

私の主な容疑者は、 makefilegccではなくへの呼び出しmpiccです(これを変更するために構成で行を見つけようとしていますが、これまでのところ見つけることができませんでした)。

誰かがLAMにRmpiをインストールした経験がありますか?それをどのように管理しましたか?

建築

  • LAM MPI(または、PBS MPIが存在する場合は、どうすれば確認できますか?)確かなことの1つは、すべてのmpi実装に共通するとは思わないmpicppファイルがあることです。
  • R-2.15.2
  • Rmpi_0.6-1
  • CentOSリリース5.5(最終版)、x86_64

Rから呼び出されたコマンド

install.packages("Rmpi")

ログ

trying URL 'http://cran.at.r-project.org/src/contrib/Rmpi_0.6-1.tar.gz'
Content type 'application/x-gzip' length 92977 bytes (90 Kb)
opened URL
==================================================
downloaded 90 Kb

* installing *source* package âRmpiâ ...
** package âRmpiâ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
I am here /usr and it is OpenMPI
Trying to find mpi.h ...
Found in /usr/include
Trying to find libmpi.so or libmpich.a ...
Found libmpi in /usr/lib
checking for openpty in -lutil... yes
checking for main in -lpthread... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c RegQuery.c -o RegQuery.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c Rmpi.c -o Rmpi.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c conversion.c -o conversion.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c internal.c -o internal.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o conversion.o internal.o -L/usr/lib -lmpi -lutil -lpthread -L/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/lib -lR
/usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libutil.a when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
installing to /home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs/Rmpi.so':
  /usr/lib/libmpi.so.0: undefined symbol: _kio
Error: loading failed
Execution halted
ERROR: loading failed
* removing â/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpiâ

The downloaded source packages are in
        â/tmp/Rtmp5qzeqp/downloaded_packagesâ
Warning message:
In install.packages("Rmpi") :
  installation of package âRmpiâ had non-zero exit status
4

3 に答える 3

9

非常によく似た設定があります。私は最近、あなたの特定の状況について話すことができるほど十分に触れていませんが、私たちを稼働させたいくつかのコマンドを渡すことができます...

Dirkが述べたように、私たちにとっての最初のステップは、OpenMPIを実行することでした。LD_LIBRARY_PATHセットアップが完了したら、正しく設定されていることを確認する必要があります。

export LD_LIBRARY_PATH=/opt/openmpiv2/lib/:$LD_LIBRARY_PATH

(上記のコマンドを実行してRを起動した後)最終的にRmpiをインストールしたコマンドは次のとおりです。

install.packages("Rmpi", configure.args = c("--with-Rmpi-include=/opt/openmpiv2/include/", "--with-Rmpi-libpath=/opt/openmpiv2/lib/", "--with-Rmpi-type=OPENMPI", "--with-mpi=/opt/openmpiv2/"))

これでパッケージが正常にインストールされました。次に、次のようなコマンドを使用してジョブを実行できます。

qsub -I -l nodes=2:ppn=12
/opt/openmpiv2/bin/mpirun --hostfile $PBS_NODEFILE -n 1 R --slave -f rmpitest.R

これらのコマンドはセットアップに固有であるため、役に立たない場合がありますが、ここにあるコマンドで時間を節約できることを願っています。

@Sergejが以下に提案しているように、より一般的な解決策は次のとおりです。

install.packages(
  "Rmpi", 
  configure.args = c(
   "--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
   "--with-Rmpi-libpath=/usr/lib/",     # This is where liblam.so is located (actually as I type it mine was located in /usr/lib64/liblam.so.0, so maybe this is not needed at all)
   "--with-Rmpi-type=LAM"               # This says that the type is LAM (there is also OPENMPI and MPICH)
))

セットアップ:RHEL 5、Rmpi 0.5-9、OpenMPI 1.4.3。、R 2.15.0

于 2012-11-26T18:35:53.747 に答える
3

何年も前、私はLAMを使用していましたが、その後OpenMPIに切り替えました。Rmpiの作者であるHaoYuは、同じことをすることを提案しています。

r-sig-hpcリストは、そのような質問に適した場所です。

于 2012-11-26T18:27:25.310 に答える
2

ジェフ・アレンが提案したように、私はRに行って走りました

install.packages(
  "Rmpi", 
  configure.args = c(
   "--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
   "--with-Rmpi-libpath=/usr/lib64/",     # This is where liblam.so is located
   "--with-Rmpi-type=LAM"               # This says that the type is LAM (there is also OPENMPI and MPICH)
))

私も走ります

# Because it was non-standard R location so it din't find shared libraries
export LD_LIBRARY_PATH=/g/software/linux/pack/r-2.15.0/lib64/R/lib

# Rmpi also could not find libutil so I had to add path to it as well
export LD_PRELOAD=/usr/lib64/libutil.so

編集

複数のノードでRmpiを実行するとコンパイルできましたが、失敗します。だから私は結局OpenMPI移行を推進し始めなければならないと思います:/

于 2012-11-26T19:02:00.527 に答える