Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECMWF 1 Com Intro training course - 2004 Compiling environment Compiling Environment – ecgate Dominique Lucas User Support.

Similar presentations


Presentation on theme: "ECMWF 1 Com Intro training course - 2004 Compiling environment Compiling Environment – ecgate Dominique Lucas User Support."— Presentation transcript:

1 ECMWF 1 Com Intro training course Compiling environment Compiling Environment – ecgate Dominique Lucas User Support

2 ECMWF 2 Com Intro training course Compiling environment Content Introduction Fortran Compiler Compiler Options Word Lengths Fortran I/O Linking Libraries Debugging Profiling Practical session

3 ECMWF 3 Com Intro training course Compiling environment Introduction Why compiling at ECMWF? decoding of (MARS) data model runs Which platforms available? Unix IBM server (ecgate) IBM Supercomputers (hpca) Which compilers? Fortran (77/90/95) C/C++ Which platform to use? High Performance Computing Facility (HPCF) for computing intensive work, including any // work. IBM server for decoding or I/O bound work.

4 ECMWF 4 Com Intro training course Compiling environment Compilers IBM compilers: xlf[90|95] for Fortran xlc for C xlC for C++ Which version do I use? lslpp –l xlf* lslpp –l xlC* How to select a different version of a Compiler? If a different version is available, this can be set with a ECMWF local utility called use, e.g.: use xlf_8113

5 ECMWF 5 Com Intro training course Compiling environment Compilers File suffixes for fortran.f or.F to run the C preprocessor.f90 with -qsuffix=f=f90.F90 with –qsuffix=f=f90:cpp=F90

6 ECMWF 6 Com Intro training course Compiling environment Compilers Common file suffixes and files.o :object file.a : archive file (library).so:share object (library).s: assembler listing.list: source listing.mod:fortran 90 module files a.out:default name of executable

7 ECMWF 7 Com Intro training course Compiling environment Fortran source code format Fixed with xlf Free with xlf[90|95] Format can be given with options –qfixed or -qfree A few examples $ xlf prog.f # fixed f77 $ xlf prog.F # fixed f77 via cpp $ xlf90 –qsuffix=f=f90 prog.f90# free f90 $ xlf90 prog.F# free f90 via cpp Fortran compiler

8 ECMWF 8 Com Intro training course Compiling environment Setting options – given by increasing precedence In the configuration file – system wide less /etc/xlf.cfg At the command line – used for all the file xlf –qfixed prog.f As a directive in the source code – for the next unit. head FIXED Fortran Compiler options

9 ECMWF 9 Com Intro training course Compiling environment Fortran 77 / f90 -ccompilation only, no linking -qsource listing -qrealsize=8 64bit real variables -O optimisation -g debugging -v verbose -help display usage Defaults: underscores (-qextname) and 32-bit addressing mode (-q32) Well over 100 options. See man page for full list of options. Fortran Compiler common options

10 ECMWF 10 Com Intro training course Compiling environment 32bit reals and integer by default The option –qrealsize=8 promotes real variables to 64bit Integer*8 and 128bit floating point computation available and slightly slower than integer*4 or real*8 computation. When using a library, check its precision, e.g. for EMOSLIB. Word lengths – precision

11 ECMWF 11 Com Intro training course Compiling environment Unit numbers: Units 0, 5 and 6 reserved, respectively for STD error, input and output. Connecting files to Units: open (1,file="data",...) ln -s data fort.1 Fortran record types: formatted/unformatted read (1)length list-directed write(*,*)'lenght=',length Namelist read(5,NML=name_l) Fortran I/O

Similar presentations


Ads by Google