***** CONFIGURATION AND MAKE OF MCNPX FOR PARALLEL RUNS ON CLUSTER MCC ***** First you need to copy the folder that contains the MCNP source code into your home dir (here it is assumed that this folder is named v270). Also, into your home directory, create a "build" folder (here we name it bld_v270). ---Before doing anything else, go into: v270/src/mcnpx/mcnpf and open the file getexem.F . It is recommended to commend out 6 lines from that file, in order to simplify the run command for parallel runs. Looks into that file for the following lines: #if defined(MPICH) && defined(UNIX) && !defined(XLF) /*!ge7c 3*/ ! MPIRUN adds 4 arguments to end of command line. !/*ge5f 11*/ if (k.lt.4) call expire(0,'getexm', !/*ge5f 12*/ & 'invalid number of command line arguments - use mpirun.') !/*ge5f 13*/ k=k-4 !/*ge5f 14*/ #endif add a "!" (an exclamation mark) infrom of each one of the lines (except of course for the one that already has one). You can now proceed to the compilation procedure, as explained below. ---Enter the build directory. Do one of the following configures from within the build dir: ___ normal ../v270/configure --host=i686-linux --with-FC=ifort --with-CC=icc --with-FFLAGS='-DUNIX=1 -DLINUX=1 -I/afs/psi.ch/project/sinq/sl6-64/include/' --with-CFLAGS='-DUNIX=1 -DLINUX=1' --with-MPICH --with-MPILIB='-L/afs/psi.ch/project/sinq/sl6-64/lib -lmpich -lmpl' --with-MPIINC='/afs/psi.ch/project/sinq/sl6-64/include' --with-FOPT='-O2' --cache-file=/dev/null ___ with 8-bit integers ../v270/configure --host=i686-linux --with-FC=ifort --with-CC=icc --with-FFLAGS='-i8 -DUNIX=1 -DLINUX=1 -I/afs/psi.ch/project/sinq/sl6-64/include/' --with-CFLAGS='-DUNIX=1 -DLINUX=1' --with-MPICH --with-MPILIB='-L/afs/psi.ch/project/sinq/sl6-64/lib -lmpich -lmpl' --with-MPIINC='/afs/psi.ch/project/sinq/sl6-64/include' --with-FOPT='-O2' --with-INTEGER8 --cache-file=/dev/null ---This will create the makefiles to be used in the following step. Intel compilers are used (ifort and icc) in this compilation (and it is strongly recommended that the users stick with those). The 'normal' configuration will make use of 4-bit integers instead of 8-bit integers. ---The Makefiles that are now created will need to be tweaked a bit (they contains a couple offlags and an unnecessary ':' character that the compilers will complain about during the 'make' procedure). In order to do that, copy the following 3 lines into a text file (let's name it makefile_fix) into your home directory: perl -e "s/__pthread_once -lpthread//g;" -pi $(find /home/username/bld_v270/ -type f) perl -e "s/-lgcc_s//g;" -pi $(find /home/username/bld_v270/ -type f) perl -e "s/include:/include /g;" -pi $(find /home/username/bld_v270/ -type f) Notice that 'username' should be changed to your actual username, in all three lines. Now, you can run those commands by typing in you shell: ./makefile_fix ---Go into the "src" directory in the build directory and do a 'make mcnpx' or 'make all' or 'make "target", where "target" is the directory within src that you wish to 'make'' -- The newly generated mcnpx executable is located into /bld_v270/src/mcnpx. You will need to copy this into the folder from which you will perform your runs ADDITIONAL: In case you are doing an INTEGER8 build, you also need to do "make bertin" and "make phtlib" from within the src dir. The binary files 'bertin' and 'phtlib' generated (and contained into the bertin and phtlib folders respectively) have to be copied into the directory from which you will run the mcnpx executable. NOTE:If you want to make use of your last configuration set up, then use the --cache-file=config.cache flag (provided the cache file is there - meaning this is not the first timeyou are compiling the code) ---RUNNING COMMAND (for MPI runs): mpirun -np #ofnodes mcnpx i=input n=output. ---RUNNING COMMAND (for serial runs): mcnpx i=input n=output.