This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
hpc:alpgenbuildingnotes [2014/01/09 16:17] jchilders old revision restored (2014/01/09 10:01) |
hpc:alpgenbuildingnotes [2014/01/09 16:40] jchilders old revision restored (2014/01/09 10:01) |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Building ALPGEN ===== | ===== Building ALPGEN ===== | ||
+ | |||
+ | ==== Machine dependent compile time changes ==== | ||
=== For BG/P === | === For BG/P === | ||
Line 71: | Line 73: | ||
---- | ---- | ||
- | + | Run \\ | |
- | module swap PrgEnv-pgi PrgEnv-gnu \\ | + | '' |
That requires '' | That requires '' | ||
<code make> | <code make> | ||
Line 87: | Line 89: | ||
=== Edison === | === Edison === | ||
---- | ---- | ||
- | + | Run \\ | |
- | module swap PrgEnv-intel PrgEnv-gnu | + | '' |
- | + | That requires | |
- | That requires compile.mk to have the following changes | + | <code make> |
ifeq ($(shell uname), | ifeq ($(shell uname), | ||
# FFF = gfortran -fno-automatic | # FFF = gfortran -fno-automatic | ||
Line 100: | Line 101: | ||
# -ffast-math | # -ffast-math | ||
endif | endif | ||
+ | </ | ||
+ | ==== Introduce MPI to Alpgen ==== | ||
- | 2) Deal with MPI | + | === Edits to '' |
- | + | ---- | |
- | 2.1) Add the lines | + | |
+ | In subroutine '' | ||
+ | '' | ||
+ | add these lines | ||
+ | <code fortran> | ||
integer mpirank | integer mpirank | ||
character*5 rankstring | character*5 rankstring | ||
common/ | common/ | ||
- | + | </ | |
- | Just after the line "c common declarations" | + | ---- |
- | It will be near line 209 | + | Near line 230, just before \\ |
- | + | '' | |
- | 2.2 Add the lines | + | sdd the lines |
+ | <code fortran> | ||
C MPI variables | C MPI variables | ||
include ' | include ' | ||
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE) | integer rank, size, ierror, tag, status(MPI_STATUS_SIZE) | ||
- | + | </ | |
- | Just before | + | Following |
+ | <code fortran> | ||
c beginning of MPI block | c beginning of MPI block | ||
+ | c retrieve MPI rank information | ||
call MPI_INIT(ierror) | call MPI_INIT(ierror) | ||
call MPI_COMM_SIZE(MPI_COMM_WORLD, | call MPI_COMM_SIZE(MPI_COMM_WORLD, | ||
Line 129: | Line 136: | ||
write(6,*) 'MPI finalized: rank ', mpirank | write(6,*) 'MPI finalized: rank ', mpirank | ||
write( rankstring, ' | write( rankstring, ' | ||
+ | c work in this threads unique directory | ||
+ | call chdir(' | ||
+ | if(retval.ne.0) then | ||
+ | | ||
+ | endif | ||
+ | call chdir(rankstring, | ||
+ | if(retval.ne.0) then | ||
+ | | ||
+ | endif | ||
c end of MPI block | c end of MPI block | ||
- | + | </code> | |
- | + | ---- | |
- | 2.3) Add the lines | + | Just after the lines (near line 338) |
- | + | <code fortran> | |
- | c work in a unique directory ./work/rankstring | + | |
- | call chdir(" | + | |
- | call chdir(rankstring) | + | |
- | + | ||
- | Immediately after the end of the MPI block | + | |
- | + | ||
- | 2.4) Just after the lines: | + | |
- | + | ||
c save parameter values to relative variables in common blocks | c save parameter values to relative variables in common blocks | ||
call alspar | call alspar | ||
- | + | </ | |
- | This will be near line 338: | + | |
Add the lines | Add the lines | ||
+ | <code fortran> | ||
c beginning of MPI block | c beginning of MPI block | ||
iseed(1)=iseed(1)+mod(mpirank, | iseed(1)=iseed(1)+mod(mpirank, | ||
Line 155: | Line 160: | ||
print*, 'Seeds and mpirank', | print*, 'Seeds and mpirank', | ||
c end of MPI block | c end of MPI block | ||
- | + | </ | |
- | + | ---- | |
- | + | In subroutine | |
- | + | <code fortran> | |
- | + | | |
- | 2.3 In subroutine alstio, just after include ' | + | </ |
(near line 4584) add the lines: | (near line 4584) add the lines: | ||
+ | <code fortran> | ||
integer mpirank | integer mpirank | ||
character*5 rankstring | character*5 rankstring | ||
common/ | common/ | ||
- | + | </ | |
- | + | ---- | |
- | 2.3 In subroutine alstio, replace | + | Near line 4588, replace |
- | + | <code fortran> | |
- | call alustc(fname,' | + | call alustc(fname,' |
+ | </ | ||
with | with | ||
- | + | <code fortran> | |
- | call alustc(' | + | call alustc(' |
+ | </ | ||
immediately after | immediately after | ||
- | + | <code fortan> | |
- | | + | write(6,*) 'Run parameters and diagnostics written to ' |
| | ||
- | + | </ | |
- | + | This outputs the weighted event files in a common directory | |
- | Near line 4588. This outputs the weighted event files in a common directory | + | ---- |
- | + | Replace unit '' | |
- | 3) Replace unit 5 with unit 9 for input | + | '' |
- | + | For BlueGene | |
- | Near line 306, after C MANDATORY INPUTS add | + | <code fortran> |
- | for BlueGene | + | |
open(9, | open(9, | ||
- | for Carver | + | </ |
+ | For Carver | ||
+ | <code fortran> | ||
open(9, | open(9, | ||
- | + | </ | |
- | This reads the input configuration from file, instead of from the command line input via a redirect as in the tutorial | + | This reads the input configuration from file, instead of from the command line input via a redirect as in the tutorial. |
- | + | Then replace all \\ | |
- | Then replace all READ(5, with READ(9, | + | '' |
- | + | with \\ | |
+ | '' | ||
+ | This ensures everywhere is reading from the input file instead of '' | ||