Posted on 2012/02/21 09:54
Filed Under 클러스터란/고성능연산_HPC 조회수: view 55855


MCNPX 2.6.X on Linux (Gentoo or Debian) using Intel 9.1 or GNU GCC

*****************
INTRODUCTION ****
*****************

This short write up would be a basic procedure guide to the installation of
various MCNPX beta versions on Linux machines. The first part describes the
compiling-installation process of MCNPX using the Intel Compiler version 9.1
both for the Fortran90 and for the C/C++ case (and without using MPICH
libraries). The second one will cover the same but using the GNU GCC compiler
both for Fortran90 and for C/C++ (always without MPICH libraries). Lastly
the third one will use always the GNU GCC compiler but with the use of the
MPICH libraries to make use of the multiprocessing capability of the code.

Marco Calviani
marco.calviani@lnl.infn.it


=====================================================

Note before the beginning: it is suggested to run the building process in
a different directory with respect to the installation directory in order
to avoid mixing source files with the compiled ones.


# ----------------------------------------------------------
# MCNPX 2.6a/b/c built with Intel Compiler 9.1 (ifort+icc)
# ----------------------------------------------------------

The tested version of the Intel Compiler was:
9.1.036 for the Fortran90 compiler (ifort, was ifc)
9.1.042 for the C/C++ compiler (icc)

1) Make sure that the compiler is correctly installed, and that the listed
variables has been defined (if for example the Intel icc compiler installation
directory is /opt/intel/compiler91 and Intel ifort compiler installation
directory is /opt/intel/fortran91):


IA32ROOT=/opt/intel/compiler91
INTEL_FLEXLM_LICENSE=/opt/intel/compiler91/licenses
LDPATH=/opt/intel/compiler91/lib
MANPATH=/opt/intel/compiler91/man
PATH=/opt/intel/compiler91/bin
ROOTPATH=/opt/intel/compiler91/bin

IA32ROOT=/opt/intel/fortran91
INTEL_FLEXLM_LICENSE=/opt/intel/fortran91/licenses
LDPATH=/opt/intel/fortran91/lib
MANPATH=/opt/intel/fortran91/man
PATH=/opt/intel/fortran91/bin
ROOTPATH=/opt/intel/fortran91/bin

(in the case you have Gentoo Linux you can simply emerge the corresponding
ebuild dev-lang/icc-9.1.042 and dev-lang/ifc-9.1.036 after having previously
downloaded the tar.gz files at put the in /usr/portage/distfiles)


2) Decompress appropriately the tar file containing the source file of MCNPX
and run the configure script with the following options (suppose you want to
install MCNPX in /usr/local/mcnpx the Fortran executable is ifort and the
C/C++ executable icc)

$ ./configure --prefix=/usr/local/mcnpx --with-FC=ifort \
              --with-CC=icc \
              --host=i686-pc-linux \
              --with-FFLAGS="-DUNIX=1 -DLINUX=1" \
              --with-CFLAGS="-DUNIX=1 -DLINUX=1"

$ make
(....)

Before running the make tests process it is necessary to modify the
src/test/Makefile.h, in particular one has to search for the following
variables TARCH, TSYS, TFC and TCC and make them looks like this:

TARCH = intel
TSYS = linux
TFC = ifc
TCC = icc

(that is existing tabulated results)

It is important to put for the TFC variable ifc instead of ifort otherwise
comparison results will not be found.

$ make tests

$ make install


3) Definition of environmental variables: before running MCNPX it is necessary
to define environmental variables PATH and DATAPATH, and this can be done
either defining the variable in each user's .bashrc or using a global
definition like the /etc/bash/bashrc (or /etc/bash.bashrc depending on the
Linux distribution). In the case of Gentoo Linux it is possible to create a
99mcnpx file in /etc/env.d directory with the variable definition directly
inside the file (perform an -- env-update -- followed by a -- source
/etc/profile -- command).

PATH=/usr/local/mcnpx/bin
DATAPATH=/usr/local/mcnpx/DATA

In the DATA directory you should put the MCNP/MCNPX data libraries. Please
note that a link to the libraries contained in the lib/ directory, phtlib,
bertin and barpol.dat to the DATA directory is required.

$ cd /usr/local/mcnpx/DATA
$ ln -s ../lib/phtlib .
$ ln -s ../lib/bertin .
$ ln -s ../lib/barpol.dat .

Appropriately create the mcnpx/DATA/xsdir if not present, copying the xsdir1
file to xsdir

4) If the environmental variables have been correctly set, the system should
respond correctly to the mcnpx program call.


=====================================================


# ------------------------------------------------------------------------------------
# MCNPX 2.6a/b/c built with GNU compiler (GCC-4.1.1) (gcc+gfortran(f90)), without MPI
# ------------------------------------------------------------------------------------

Since the source build of MCNPX needs a Fortran 90 compatible compiler if one
wants to use the GNU GCC opensource compiler it is mandatory to switch to GCC4
where the gfortran (Fortran 90) executable is present. As suggested in the
title GCC version 4.1.1 have been tested.

1) As f90 is explicitly required by MCNPX during the building process, make a
symbolic link between gfortran and f90:

Example:
$ cd /usr/i686-pc-linux-gnu/gcc-bin/4.1.1
$ ln -s gfortran f90

2) Decompress appropriately the tar file containing the source file of MCNPX:
in order for the GNU compiler to work it is necessary to modify some source .F
files and in particular this files:

src/bertin/getexm.F
src/htape3x/getexm.F
src/mcnpx/mcnpf/getexm.F
src/phtlib/mcnpf/getexm.F
src/xsex3/getexm.F

in which this line:

integer(ki4), external :: iargc    !/*ge5f        8*/

has to be transformed in:

integer(ki4) :: iargc              !/*ge5f        8*/


3) Run the configure script with the following options (supposing you want to
install MCNPX in /usr/local/mcnpx):

$ ./configure --prefix=/usr/local/mcnpx \
              --with-FC=f90 \
              --with-CC=gcc \
              --host=i686-pc-linux \
              --with-FFLAGS="-DUNIX=1 -DLINUX=1 -DG95=1" \
              --with-CFLAGS="-DUNIX=1 -DLINUX=1"

$ make
(....)


Before running the make tests process, it is necessary to modify the
src/test/Makefile.h, in particular one has to search for the following variables
TARCH, TSYS, TFC and TCC and make them looks like this:

TARCH = intel
TSYS = linux
TFC = ifc
TCC = icc

(that is existing tabulated results)

$ make tests

$ make install



4) Definition of environmental variables: before running MCNPX it is necessary
to define environmental variables PATH and DATAPATH, and this can be done
either defining the variable in each user's .bashrc or using a global definition
like the /etc/bash/bashrc (or /etc/bash.bashrc depending on the Linux
distribution). In the case of Gentoo Linux it is possible to create a 99mcnpx
file in /etc/env.d directory with the variable definition directly inside the
file (perform an -- env-update -- command followed by a -- source /etc/profile
-- command).

PATH=/usr/local/mcnpx/bin
DATAPATH=/usr/local/mcnpx/DATA

In the DATA directory you should put the MCNP/MCNPX data libraries. Please note
that a link to the libraries contained in the lib/ directory, phtlib, bertin and
barpol.dat to the DATA directory is required.

$ cd /usr/local/mcnpx/DATA
$ ln -s ../lib/phtlib .
$ ln -s ../lib/bertin .
$ ln -s ../lib/barpol.dat .

Appropriately create the mcnpx/DATA/xsdir if not present, copying the xsdir1
file to xsdir.

5) If the environmental variables have been correctly set, the system should
respond correctly to the mcnpx program call.


=======================================================


# ---------------------------------------------------------------------------------
# MCNPX 2.6a/b/c built with GNU compiler (GCC-4.1.1) (gcc+gfortran(f90)), with MPI
# ---------------------------------------------------------------------------------

A simple modification of the above configuration lead to the possibility exploit the
parallel ability of MCNPX via MPI (Message-Passing Interface). I've tested the
installation with MPICH2 libraries version 1.0.3 that can be found at this site
http://www-unix.mcs.anl.gov/mpi/mpich2 .

Please note that, as underlined in the MPICH2 web page, "MPICH2 replaces MPICH1 and
should be used instead of MPICH1 except for the case of clusters with heterogeneous
data representations (e.g., different lengths for integers or different byte
ordering). MPICH2 does not yet support those systems (support is planned for 2007)".

This libraries are useful if you have a multiple core and/or biprocessor system and
you want to make fully use of the available resources.

Here are listed the differences that one has to follow with respect to the version
without MPI.


0) (so before point 1) ) First of all install the MPICH2 libraries: you should find
that the installation of MPICH2 created, among others, two executables in /usr/bin:

/usr/bin/mpif90  (compiles and links MPI programs written in Fortran 90)
/usr/bin/mpicc   (compiles and links MPI programs written in C)

that will be used to compile MCNPX. It is important to use this command, particularly
when linking programs, as they provide the necessary libraries. Please keep note of
where the MPICH libraries are installed since this information will be required in
the configure step.
Example:

/usr/lib64/libmpich.a
/usr/lib64/libmpich.so
/usr/lib64/libmpichcxx.a
/usr/lib64/libmpich.so.0.0
/usr/lib64/libmpichf90.a
/usr/lib64/libmpich.so.0



1) and 2) the same as the version without MPICH


3) Run the configure script with the following options (suppose you want to install
MCNPX in /usr/local/mcnpx):

$ ./configure --prefix=/usr/local/mcnpx \
              --with-FC=mpif90 \
              --with-CC=mpicc \
              --host=i686-pc-linux \
              --with-FFLAGS="-DUNIX=1 -DLINUX=1 -DG95=1" \
              --with-CFLAGS="-DUNIX=1 -DLINUX=1" \
              --with-MPILIB="-L/usr/lib64 -lmpich"

$ make
(....)


Before running the make tests process, it is necessary to modify the
src/test/Makefile.h, in particular one has to search for the following variables
TARCH, TSYS, TFC and TCC and make them looks like this:

TARCH = intel
TSYS = linux
TFC = ifc
TCC = icc

(that is existing tabulated results)


$ make tests

$ make install


4) and 5) the same as the version without MPICH


6) In order to use the MPI capability, it is necessary to perform the following
steps:

a) create a mpd.conf file in which a variable MPD_SECRET_WORD is defined
b) start the MPI daemon with
   $ mpd &
c) starts an MCNPX (or in general a parallel) job with (the -np option specify
the number of processes to use):
   $ mpiexec -np 4 mcnpx inp=test n=test. > /dev/null
d) obtain a list of running jobs with
   $ mpdlistjobs
e) .. and kill them, if required with
   $ mpdkilljob (jobnum)
f) take down all MPD daemons with
   $ mpdallexit


=============================================================


*************
FINAL REMARKS
*************

Some tracking differences have been observed with both the compilers. Most of
them are not relevant because they involve scored values changes well within
the errors or others are just positioning differences inside the files. Other
changes are being investigated.


=============================================================


*****************
POSSIBLE PROBLEMS that can be encountered during MCNPX installation:
*****************

---- not using -DUNIX=1 -DLINUX=1 with gcc:

mcnpc/mcnpc.c:204: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:266: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:289: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:354: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:379: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:401: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:424: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:454: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:544: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:568: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:598: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:623: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:671: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:733: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:773: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:804: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:831: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:857: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:888: error: expected identifier or '(' before '{' token
mcnpc/mcnpc.c:915: error: expected identifier or '(' before '{' token


or other problems of syntax with mcnpc.c.


-- not using the mpif90 and mpicc when compiling with MPILIB flag:

usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libmpich.so: undefined
reference to `aio_read64'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libmpich.so:
undefined reference to `aio_error64'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libmpich.so:
undefined reference to `aio_suspend64'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libmpich.so:
undefined reference to `aio_write64'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libmpich.so:
undefined reference to `aio_return64'


-- not using -DG95 with gcc (gfortran):

f90 -lgfortranbegin -lgfortran -lm -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../.. -lm -lgcc_s  -o mcnpx f77main/f77main.o mcnpf.a mcnpf/GLOBAL1_zc.o mcnpf/GLOBAL2_vv.o mcnpf/GLOBAL3_st.o mcnpf/GLOBAL4_cg.o mcnpf/GLOBAL4_mb.o mcnpf/GLOBAL4_lk.o mcnpf/GLOBAL5_cm.o mcnpf/GLOBAL6_ht.o mcnpf/IMCN_jc.o mcnpf/GKSSIM_gs.o mcnpf/LAMBDA_lm.o mcnpf/LAMBDA_lt.o mcnpf/MCPLOT_mp.o mcnpf/PLOT_pc.o mcnpf/GLOBAL6_mc.o mcnpf/cemmod.o mcnpc.a utils.a gvaviv.a lcs.a lcs/btbd.o lcs/cabd.o lcs/e0bd.o lcs/elbd.o lcs/h1bd.o lcs/hebd.o lcs/inbd.o lcs/isbd.o lcs/phbd.o lcs/pqbd.o dedx.a dedx/atmdat.o meshtal.a histp.a spabi.a spabi/bdincl1.o spabi/bdincl2.o fluka89.a fluka89/bdnopt.o fluka89/blkdt1.o fluka89/blkdt2.o fluka89/blkdt3.o fluka89/blkdt4.o fluka89/blkdt5.o fluka89/blkdt6.o fluka89/blkdt7.o fluka89/f2bd.o hexs.a hexs/nebd.o hexs/xsbd.o -L/usr/lib64 -lX11
mcnpf.a(ttyint.o): In function `ttyint_':
ttyint.F:(.text+0x18): undefined reference to `signal_'
collect2: ld returned 1 exit status


-- not modifying the src/Test/Makefile.h file:

cp: ../../../v26c/src/Test/Test.intel.irix.ifort./usr/bin/gcc/
outp??: No such file or directory
make[2]: *** [out-links] Error 1

or similar.
Writer profile
author image
-아랑 -
2012/02/21 09:54 2012/02/21 09:54

트랙백 주소 : 이 글에는 트랙백을 보낼 수 없습니다

  1. Subject : nobis canada

    Tracked from nobis canada / 2014/12/04 20:28  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  2. Subject : nobis parka

    Tracked from nobis parka / 2014/12/05 05:32  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  3. Subject : nobis online

    Tracked from nobis online / 2014/12/05 06:49  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  4. Subject : btguard

    Tracked from btguard / 2014/12/08 16:46  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  5. Subject : レザージャケット

    Tracked from レザージャケット / 2014/12/09 11:28  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  6. Subject : 筋力トレーニング用具

    Tracked from 筋力トレーニング用具 / 2014/12/09 12:14  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  7. Subject : m88

    Tracked from m88 / 2014/12/11 15:57  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  8. Subject : gay porn jeux

    Tracked from gay porn jeux / 2014/12/12 10:29  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  9. Subject : ラルフローレンポロシャツ

    Tracked from ラルフローレンポロシャツ / 2014/12/25 15:19  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  10. Subject : 象印 トースター

    Tracked from 象印 トースター / 2014/12/25 15:32  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  11. Subject : ミルボン シャンプー

    Tracked from ミルボン シャンプー / 2014/12/26 16:37  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  12. Subject : クリスチャン ディオールワン エッセン

    Tracked from クリスチャン ディオールワン エッセン / 2014/12/26 17:28  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  13. Subject : フレアスカート

    Tracked from フレアスカート / 2014/12/26 19:57  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  14. Subject : スカートスーツ コート

    Tracked from スカートスーツ コート / 2014/12/26 21:28  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  15. Subject : ワンピーススーツ ネイビー

    Tracked from ワンピーススーツ ネイビー / 2014/12/27 16:17  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  16. Subject : ネイルチップ作り方

    Tracked from ネイルチップ作り方 / 2014/12/28 02:52  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  17. Subject : 資生堂メン シセイドウ

    Tracked from 資生堂メン シセイドウ / 2014/12/28 07:03  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  18. Subject : エルメス ベルト

    Tracked from エルメス ベルト / 2014/12/28 10:49  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  19. Subject : Women Lance Briggs Bears Nike Jersey

    Tracked from Women Lance Briggs Bears Nike Jersey / 2014/12/29 13:17  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  20. Subject : フォーマル ロング ワンピース

    Tracked from フォーマル ロング ワンピース / 2014/12/29 15:47  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  21. Subject : シフォンスカートスーツ

    Tracked from シフォンスカートスーツ / 2014/12/30 06:03  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  22. Subject : 香水 ロクシタン

    Tracked from 香水 ロクシタン / 2014/12/30 10:04  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  23. Subject : 無印 座椅子

    Tracked from 無印 座椅子 / 2015/01/07 04:04  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  24. Subject : ベイトリール

    Tracked from ベイトリール / 2015/01/07 04:06  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  25. Subject : VANS スリッポン

    Tracked from VANS スリッポン / 2015/01/07 04:11  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  26. Subject : ダッフルコート

    Tracked from ダッフルコート / 2015/01/09 16:44  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  27. Subject : stay Strong quotes

    Tracked from stay Strong quotes / 2015/01/13 06:14  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  28. Subject : Clash Of Clans Trucos

    Tracked from Clash Of Clans Trucos / 2015/01/15 23:29  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  29. Subject : {ngentot

    Tracked from {ngentot / 2015/03/14 09:24  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  30. Subject : ngewe

    Tracked from ngewe / 2015/03/18 07:00  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  31. Subject : dang tin ban nha mien phi

    Tracked from dang tin ban nha mien phi / 2015/04/19 02:03  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  32. Subject : baseball cap for men

    Tracked from baseball cap for men / 2017/11/25 18:32  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  33. Subject : pc game requirements

    Tracked from pc game requirements / 2017/12/06 05:05  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  34. Subject : cwas here

    Tracked from cwas here / 2018/01/30 18:23  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  35. Subject : Ali çöplü

    Tracked from Ali çöplü / 2018/02/19 20:42  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  36. Subject : military boots for desert deployments

    Tracked from military boots for desert deployments / 2018/04/09 16:14  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  37. Subject : Black military boots

    Tracked from Black military boots / 2018/04/09 18:27  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  38. Subject : cashfever.com

    Tracked from cashfever.com / 2018/04/28 07:46  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

  39. Subject : currency exchange

    Tracked from currency exchange / 2018/07/03 06:45  삭제

    시스템 엔지니어 공동 관리 구역 :: MCNPX 2.6.X on Linux

About

by 서진우
Twitter :@muchunalang

Counter

• Total
: 4314685
• Today
: 493
• Yesterday
: 1625