Using GNU Fortran

Total Page:16

File Type:pdf, Size:1020Kb

Using GNU Fortran Using GNU Fortran For gcc version 4.9.4 (GCC) The gfortran team Published by the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA Copyright c 1999-2014 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being \Funding Free Software", the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled \GNU Free Documentation License". (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Short Contents 1 Introduction ::::::::::::::::::::::::::::::::::::::::: 1 Invoking GNU Fortran 2 GNU Fortran Command Options :::::::::::::::::::::::: 7 3 Runtime: Influencing runtime behavior with environment variables ::::::::::::::::::::::::::::::::::::::::::: 27 Language Reference 4 Fortran 2003 and 2008 Status :::::::::::::::::::::::::: 33 5 Compiler Characteristics :::::::::::::::::::::::::::::: 37 6 Extensions :::::::::::::::::::::::::::::::::::::::::: 41 7 Mixed-Language Programming ::::::::::::::::::::::::: 53 8 Intrinsic Procedures :::::::::::::::::::::::::::::::::: 67 9 Intrinsic Modules ::::::::::::::::::::::::::::::::::: 219 Contributing ::::::::::::::::::::::::::::::::::::::::::: 225 GNU General Public License :::::::::::::::::::::::::::::: 229 GNU Free Documentation License ::::::::::::::::::::::::: 241 Funding Free Software ::::::::::::::::::::::::::::::::::: 249 Option Index :::::::::::::::::::::::::::::::::::::::::: 251 Keyword Index ::::::::::::::::::::::::::::::::::::::::: 253 iii Table of Contents 1 Introduction::::::::::::::::::::::::::::::::::::: 1 1.1 About GNU Fortran ::::::::::::::::::::::::::::::::::::::::::: 1 1.2 GNU Fortran and GCC :::::::::::::::::::::::::::::::::::::::: 2 1.3 Preprocessing and conditional compilation :::::::::::::::::::::: 2 1.4 GNU Fortran and G77 ::::::::::::::::::::::::::::::::::::::::: 3 1.5 Project Status ::::::::::::::::::::::::::::::::::::::::::::::::: 3 1.6 Standards :::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 1.6.1 Varying Length Character Strings ::::::::::::::::::::::::: 4 Part I: Invoking GNU Fortran :::::::::::::::::::: 5 2 GNU Fortran Command Options ::::::::::::: 7 2.1 Option summary ::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Options controlling Fortran dialect ::::::::::::::::::::::::::::: 8 2.3 Enable and customize preprocessing ::::::::::::::::::::::::::: 11 2.4 Options to request or suppress errors and warnings :::::::::::: 14 2.5 Options for debugging your program or GNU Fortran:::::::::: 18 2.6 Options for directory search ::::::::::::::::::::::::::::::::::: 19 2.7 Influencing the linking step:::::::::::::::::::::::::::::::::::: 19 2.8 Influencing runtime behavior :::::::::::::::::::::::::::::::::: 19 2.9 Options for code generation conventions ::::::::::::::::::::::: 20 2.10 Environment variables affecting gfortran :::::::::::::::::::: 26 3 Runtime: Influencing runtime behavior with environment variables:::::::::::::::::::::::: 27 3.1 TMPDIR|Directory for scratch files :::::::::::::::::::::::::::: 27 3.2 GFORTRAN_STDIN_UNIT|Unit number for standard input :::::: 27 3.3 GFORTRAN_STDOUT_UNIT|Unit number for standard output :::: 27 3.4 GFORTRAN_STDERR_UNIT|Unit number for standard error:::::: 27 3.5 GFORTRAN_UNBUFFERED_ALL|Do not buffer I/O on all units:::: 27 3.6 GFORTRAN_UNBUFFERED_PRECONNECTED|Do not buffer I/O on preconnected units::::::::::::::::::::::::::::::::::::::::::::: 27 3.7 GFORTRAN_SHOW_LOCUS|Show location for runtime errors :::::: 27 3.8 GFORTRAN_OPTIONAL_PLUS|Print leading + where permitted :: 28 3.9 GFORTRAN_DEFAULT_RECL|Default record length for new files :: 28 3.10 GFORTRAN_LIST_SEPARATOR|Separator for list output :::::::: 28 3.11 GFORTRAN_CONVERT_UNIT|Set endianness for unformatted I/O ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 28 3.12 GFORTRAN_ERROR_BACKTRACE|Show backtrace on run-time errors ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 Part II: Language Reference ::::::::::::::::::::: 31 iv The GNU Fortran Compiler 4 Fortran 2003 and 2008 Status :::::::::::::::: 33 4.1 Fortran 2003 status ::::::::::::::::::::::::::::::::::::::::::: 33 4.2 Fortran 2008 status ::::::::::::::::::::::::::::::::::::::::::: 34 4.3 Technical Specification 29113 Status ::::::::::::::::::::::::::: 36 5 Compiler Characteristics ::::::::::::::::::::: 37 5.1 KIND Type Parameters ::::::::::::::::::::::::::::::::::::::: 37 5.2 Internal representation of LOGICAL variables ::::::::::::::::: 37 5.3 Thread-safety of the runtime library ::::::::::::::::::::::::::: 38 5.4 Data consistency and durability ::::::::::::::::::::::::::::::: 38 6 Extensions ::::::::::::::::::::::::::::::::::::: 41 6.1 Extensions implemented in GNU Fortran :::::::::::::::::::::: 41 6.1.1 Old-style kind specifications :::::::::::::::::::::::::::::: 41 6.1.2 Old-style variable initialization ::::::::::::::::::::::::::: 41 6.1.3 Extensions to namelist ::::::::::::::::::::::::::::::::::: 42 6.1.4 X format descriptor without count field ::::::::::::::::::: 43 6.1.5 Commas in FORMAT specifications ::::::::::::::::::::::::: 43 6.1.6 Missing period in FORMAT specifications ::::::::::::::::::: 43 6.1.7 I/O item lists :::::::::::::::::::::::::::::::::::::::::::: 43 6.1.8 Q exponent-letter ::::::::::::::::::::::::::::::::::::::::: 43 6.1.9 BOZ literal constants::::::::::::::::::::::::::::::::::::: 43 6.1.10 Real array indices ::::::::::::::::::::::::::::::::::::::: 44 6.1.11 Unary operators :::::::::::::::::::::::::::::::::::::::: 44 6.1.12 Implicitly convert LOGICAL and INTEGER values :::::::::: 44 6.1.13 Hollerith constants support:::::::::::::::::::::::::::::: 44 6.1.14 Cray pointers ::::::::::::::::::::::::::::::::::::::::::: 45 6.1.15 CONVERT specifier:::::::::::::::::::::::::::::::::::::::: 47 6.1.16 OpenMP:::::::::::::::::::::::::::::::::::::::::::::::: 47 6.1.17 Argument list functions %VAL, %REF and %LOC :::::::::::: 48 6.2 Extensions not implemented in GNU Fortran :::::::::::::::::: 49 6.2.1 STRUCTURE and RECORD ::::::::::::::::::::::::::::::::::: 49 6.2.2 ENCODE and DECODE statements ::::::::::::::::::::::::::: 50 6.2.3 Variable FORMAT expressions :::::::::::::::::::::::::::::: 51 6.2.4 Alternate complex function syntax:::::::::::::::::::::::: 51 6.2.5 Volatile COMMON blocks:::::::::::::::::::::::::::::::::::: 51 7 Mixed-Language Programming::::::::::::::: 53 7.1 Interoperability with C :::::::::::::::::::::::::::::::::::::::: 53 7.1.1 Intrinsic Types ::::::::::::::::::::::::::::::::::::::::::: 53 7.1.2 Derived Types and struct::::::::::::::::::::::::::::::::: 53 7.1.3 Interoperable Global Variables:::::::::::::::::::::::::::: 54 7.1.4 Interoperable Subroutines and Functions:::::::::::::::::: 54 7.1.5 Working with Pointers ::::::::::::::::::::::::::::::::::: 56 7.1.6 Further Interoperability of Fortran with C :::::::::::::::: 58 7.2 GNU Fortran Compiler Directives ::::::::::::::::::::::::::::: 59 7.3 Non-Fortran Main Program ::::::::::::::::::::::::::::::::::: 60 v 7.3.1 _gfortran_set_args | Save command-line arguments ::: 60 7.3.2 _gfortran_set_options | Set library option flags::::::: 61 7.3.3 _gfortran_set_convert | Set endian conversion :::::::: 62 7.3.4 _gfortran_set_record_marker | Set length of record markers :::::::::::::::::::::::::::::::::::::::::::::::::::: 62 7.3.5 _gfortran_set_fpe | Enable floating point exception traps :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 63 7.3.6 _gfortran_set_max_subrecord_length | Set subrecord length :::::::::::::::::::::::::::::::::::::::::::::::::::::: 63 7.4 Naming and argument-passing conventions :::::::::::::::::::: 63 7.4.1 Naming conventions :::::::::::::::::::::::::::::::::::::: 64 7.4.2 Argument passing conventions :::::::::::::::::::::::::::: 64 8 Intrinsic Procedures::::::::::::::::::::::::::: 67 8.1 Introduction to intrinsic procedures ::::::::::::::::::::::::::: 67 8.2 ABORT | Abort the program :::::::::::::::::::::::::::::::::: 67 8.3 ABS | Absolute value ::::::::::::::::::::::::::::::::::::::::: 68 8.4 ACCESS | Checks file access modes:::::::::::::::::::::::::::: 68 8.5 ACHAR | Character in ASCII collating sequence:::::::::::::::: 69 8.6 ACOS | Arccosine function :::::::::::::::::::::::::::::::::::: 70 8.7 ACOSH | Inverse hyperbolic cosine function:::::::::::::::::::: 70 8.8 ADJUSTL | Left adjust a string ::::::::::::::::::::::::::::::: 71 8.9 ADJUSTR | Right adjust a string :::::::::::::::::::::::::::::: 71 8.10 AIMAG | Imaginary part of complex number ::::::::::::::::: 72 8.11 AINT | Truncate to a whole number ::::::::::::::::::::::::: 73 8.12 ALARM | Execute a routine after a given delay ::::::::::::::: 73 8.13 ALL | All values in MASK along DIM are true :::::::::::::: 74 8.14 ALLOCATED | Status of an allocatable entity ::::::::::::::::: 75 8.15 AND | Bitwise logical AND :::::::::::::::::::::::::::::::::: 75 8.16 ANINT | Nearest whole number :::::::::::::::::::::::::::::: 76 8.17 ANY | Any value in MASK along DIM is true ::::::::::::::: 77 8.18 ASIN | Arcsine function ::::::::::::::::::::::::::::::::::::: 78 8.19 ASINH | Inverse hyperbolic sine function::::::::::::::::::::: 78 8.20 ASSOCIATED | Status of a pointer or pointer/target pair ::::: 79 8.21 ATAN | Arctangent
Recommended publications
  • Introduction to Programming in Fortran 77 for Students of Science and Engineering
    Introduction to programming in Fortran 77 for students of Science and Engineering Roman GrÄoger University of Pennsylvania, Department of Materials Science and Engineering 3231 Walnut Street, O±ce #215, Philadelphia, PA 19104 Revision 1.2 (September 27, 2004) 1 Introduction Fortran (FORmula TRANslation) is a programming language designed speci¯cally for scientists and engineers. For the past 30 years Fortran has been used for such projects as the design of bridges and aeroplane structures, it is used for factory automation control, for storm drainage design, analysis of scienti¯c data and so on. Throughout the life of this language, groups of users have written libraries of useful standard Fortran programs. These programs can be borrowed and used by other people who wish to take advantage of the expertise and experience of the authors, in a similar way in which a book is borrowed from a library. Fortran belongs to a class of higher-level programming languages in which the programs are not written directly in the machine code but instead in an arti¯cal, human-readable language. This source code consists of algorithms built using a set of standard constructions, each consisting of a series of commands which de¯ne the elementary operations with your data. In other words, any algorithm is a cookbook which speci¯es input ingredients, operations with them and with other data and ¯nally returns one or more results, depending on the function of this algorithm. Any source code has to be compiled in order to obtain an executable code which can be run on your computer.
    [Show full text]
  • Writing Fast Fortran Routines for Python
    Writing fast Fortran routines for Python Table of contents Table of contents ............................................................................................................................ 1 Overview ......................................................................................................................................... 2 Installation ...................................................................................................................................... 2 Basic Fortran programming ............................................................................................................ 3 A Fortran case study ....................................................................................................................... 8 Maximizing computational efficiency in Fortran code ................................................................. 12 Multiple functions in each Fortran file ......................................................................................... 14 Compiling and debugging ............................................................................................................ 15 Preparing code for f2py ................................................................................................................ 16 Running f2py ................................................................................................................................. 17 Help with f2py ..............................................................................................................................
    [Show full text]
  • 7. Functions in PHP – II
    7. Functions in PHP – II Scope of variables in Function Scope of variable is the part of PHP script where the variable can be accessed or used. PHP supports three different scopes for a variable. These scopes are 1. Local 2. Global 3. Static A variable declared within the function has local scope. That means this variable is only used within the function body. This variable is not used outside the function. To demonstrate the concept, let us take an example. // local variable scope function localscope() { $var = 5; //local scope echo '<br> The value of $var inside the function is: '. $var; } localscope(); // call the function // using $var outside the function will generate an error echo '<br> The value of $var inside the function is: '. $var; The output will be: The value of $var inside the function is: 5 ( ! ) Notice: Undefined variable: var in H:\wamp\www\PathshalaWAD\function\function localscope demo.php on line 12 Call Stack # Time Memory Function Location 1 0.0003 240416 {main}( ) ..\function localscope demo.php:0 The value of $var inside the function is: Page 1 of 7 If a variable is defined outside of the function, then the variable scope is global. By default, a global scope variable is only available to code that runs at global level. That means, it is not available inside a function. Following example demonstrate it. <?php //variable scope is global $globalscope = 20; // local variable scope function localscope() { echo '<br> The value of global scope variable is :'.$globalscope; } localscope(); // call the function // using $var outside the function will generate an error echo '<br> The value of $globalscope outside the function is: '.
    [Show full text]
  • Chapter 21. Introduction to Fortran 90 Language Features
    http://www.nr.com or call 1-800-872-7423 (North America only), or send email to [email protected] (outside North Amer readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, v Permission is granted for internet users to make one paper copy their own personal use. Further reproduction, or any copyin Copyright (C) 1986-1996 by Cambridge University Press. Programs Copyright (C) 1986-1996 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN FORTRAN 90: THE Art of PARALLEL Scientific Computing (ISBN 0-521-57439-0) Chapter 21. Introduction to Fortran 90 Language Features 21.0 Introduction Fortran 90 is in many respects a backwards-compatible modernization of the long-used (and much abused) Fortran 77 language, but it is also, in other respects, a new language for parallel programming on present and future multiprocessor machines. These twin design goals of the language sometimes add confusion to the process of becoming fluent in Fortran 90 programming. In a certain trivial sense, Fortran 90 is strictly backwards-compatible with Fortran 77. That is, any Fortran 90 compiler is supposed to be able to compile any legacy Fortran 77 code without error. The reason for terming this compatibility trivial, however, is that you have to tell the compiler (usually via a source file name ending in “.f”or“.for”) that it is dealing with a Fortran 77 file. If you instead try to pass off Fortran 77 code as native Fortran 90 (e.g., by naming the source file something ending in “.f90”) it will not always work correctly! It is best, therefore, to approach Fortran 90 as a new computer language, albeit one with a lot in common with Fortran 77.
    [Show full text]
  • Fortran Resources 1
    Fortran Resources 1 Ian D Chivers Jane Sleightholme May 7, 2021 1The original basis for this document was Mike Metcalf’s Fortran Information File. The next input came from people on comp-fortran-90. Details of how to subscribe or browse this list can be found in this document. If you have any corrections, additions, suggestions etc to make please contact us and we will endeavor to include your comments in later versions. Thanks to all the people who have contributed. Revision history The most recent version can be found at https://www.fortranplus.co.uk/fortran-information/ and the files section of the comp-fortran-90 list. https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=comp-fortran-90 • May 2021. Major update to the Intel entry. Also changes to the editors and IDE section, the graphics section, and the parallel programming section. • October 2020. Added an entry for Nvidia to the compiler section. Nvidia has integrated the PGI compiler suite into their NVIDIA HPC SDK product. Nvidia are also contributing to the LLVM Flang project. Updated the ’Additional Compiler Information’ entry in the compiler section. The Polyhedron benchmarks discuss automatic parallelisation. The fortranplus entry covers the diagnostic capability of the Cray, gfortran, Intel, Nag, Oracle and Nvidia compilers. Updated one entry and removed three others from the software tools section. Added ’Fortran Discourse’ to the e-lists section. We have also made changes to the Latex style sheet. • September 2020. Added a computer arithmetic and IEEE formats section. • June 2020. Updated the compiler entry with details of standard conformance.
    [Show full text]
  • Scope in Fortran 90
    Scope in Fortran 90 The scope of objects (variables, named constants, subprograms) within a program is the portion of the program in which the object is visible (can be use and, if it is a variable, modified). It is important to understand the scope of objects not only so that we know where to define an object we wish to use, but also what portion of a program unit is effected when, for example, a variable is changed, and, what errors might occur when using identifiers declared in other program sections. Objects declared in a program unit (a main program section, module, or external subprogram) are visible throughout that program unit, including any internal subprograms it hosts. Such objects are said to be global. Objects are not visible between program units. This is illustrated in Figure 1. Figure 1: The figure shows three program units. Main program unit Main is a host to the internal function F1. The module program unit Mod is a host to internal function F2. The external subroutine Sub hosts internal function F3. Objects declared inside a program unit are global; they are visible anywhere in the program unit including in any internal subprograms that it hosts. Objects in one program unit are not visible in another program unit, for example variable X and function F3 are not visible to the module program unit Mod. Objects in the module Mod can be imported to the main program section via the USE statement, see later in this section. Data declared in an internal subprogram is only visible to that subprogram; i.e.
    [Show full text]
  • Declare and Assign Global Variable Python
    Declare And Assign Global Variable Python Unstaid and porous Murdoch never requiring wherewith when Thaddus cuts his unessential. Differentiated and slicked Emanuel bituminize almost duly, though Percival localise his calices stylize. Is Normie defunctive when Jeff objurgates toxicologically? Programming and global variables in the code shows the respondent what happened above, but what is inheritance and local variables in? Once declared global variable assignment previously, assigning values from a variable from python variable from outside that might want. They are software, you will see a mortgage of armor in javascript. Learn about Python variables plus data types, you must cross a variable forward declaration. How like you indulge a copy of view object in Python? If you declare global and. All someone need is to ran the variable only thing outside the modules. Why most variables and variable declaration with the responses. Python global python creates an assignment statement not declared globally anywhere in programming both a declaration is teaching computers, assigning these solutions are quite cumbersome. How to present an insurgent in Python? Can assign new python. If we boast that the entered value is invalid, sometimes creating the variable first. Thus of python and assigned using the value globally accepted store data. Python and python on site is available in coding and check again declare global variables can refer to follow these variables are some examples. Specific manner where a grate is screwing with us. Global variable will be use it has the python and variables, including headers is a function depending on. Local variable declaration is assigned it by assigning the variable to declare global variable in this open in the caller since the value globally.
    [Show full text]
  • Chapter 5. Using Tcl/Tk
    The Almagest 5-1 Chapter 5. Using Tcl/Tk Authors: Edward A. Lee Other Contributors: Brian L. Evans Wei-Jen Huang Alan Kamas Kennard White 5.1 Introduction Tcl is an interpreted “tool command language” designed by John Ousterhout while at UC Berkeley. Tk is an associated X window toolkit. Both have been integrated into Ptolemy. Parts of the graphical user interface and all of the textual interpreter ptcl are designed using them. Several of the stars in the standard star library also use Tcl/Tk. This chapter explains how to use the most basic of these stars, TclScript, as well how to design such stars from scratch. It is possible to define very sophisticated, totally customized user interfaces using this mechanism. In this chapter, we assume the reader is familiar with the Tcl language. Documentation is provided along with the Ptolemy distribution in the $PTOLEMY/tcltk/itcl/man direc- tory in Unix man page format. HTML format documentation is available from the other.src tar file in $PTOLEMY/src/tcltk. Up-to-date documentation and software releases are available by on the SunScript web page at http://www.sunscript.com. There is also a newsgroup called comp.lang.tcl. This news group accumulates a list of frequently asked questions about Tcl which is available http://www.teraform.com/%7Elvirden/tcl-faq/. The principal use of Tcl/Tk in Ptolemy is to customize the user interface. Stars can be created that interact with the user in specialized ways, by creating customized displays or by soliciting graphical inputs. 5.2 Writing Tcl/Tk scripts for the TclScript star Several of the domains in Ptolemy have a star called TclScript.
    [Show full text]
  • IEEE Standard 754 for Binary Floating-Point Arithmetic
    Work in Progress: Lecture Notes on the Status of IEEE 754 October 1, 1997 3:36 am Lecture Notes on the Status of IEEE Standard 754 for Binary Floating-Point Arithmetic Prof. W. Kahan Elect. Eng. & Computer Science University of California Berkeley CA 94720-1776 Introduction: Twenty years ago anarchy threatened floating-point arithmetic. Over a dozen commercially significant arithmetics boasted diverse wordsizes, precisions, rounding procedures and over/underflow behaviors, and more were in the works. “Portable” software intended to reconcile that numerical diversity had become unbearably costly to develop. Thirteen years ago, when IEEE 754 became official, major microprocessor manufacturers had already adopted it despite the challenge it posed to implementors. With unprecedented altruism, hardware designers had risen to its challenge in the belief that they would ease and encourage a vast burgeoning of numerical software. They did succeed to a considerable extent. Anyway, rounding anomalies that preoccupied all of us in the 1970s afflict only CRAY X-MPs — J90s now. Now atrophy threatens features of IEEE 754 caught in a vicious circle: Those features lack support in programming languages and compilers, so those features are mishandled and/or practically unusable, so those features are little known and less in demand, and so those features lack support in programming languages and compilers. To help break that circle, those features are discussed in these notes under the following headings: Representable Numbers, Normal and Subnormal, Infinite
    [Show full text]
  • Introduction to Python
    Introduction to Python Wei Feinstein HPC User Services LSU HPC & LONI [email protected] Louisiana State University March, 2017 Introduction to Python Overview • What is Python • Python programming basics • Control structures, functions • Python modules, classes • Plotting with Python Introduction to Python What is Python? • A general-purpose programming language (1980) by Guido van Rossum • Intuitive and minimalistic coding • Dynamically typed • Automatic memory management • Interpreted not compiled Introduction to Python 3 Why Python? Advantages • Ease of programming • Minimizes the time to develop and maintain code • Modular and object-oriented • Large standard and user-contributed libraries • Large community of users Disadvantages • Interpreted and therefore slower than compiled languages • Not great for 3D graphic applications requiring intensive compuations Introduction to Python 4 Code Performance vs. Development Time Python C/C++ Assembly Introduction to Python 5 Python 2.x vs 3.x • Final Python 2.x is 2.7 (2010) • First Python 3.x is 3.0 (2008) • Major cleanup to better support Unicode data formats in Python 3.x • Python 3 not backward-compatible with Python 2 • Rich packages available for Python 2z $ python -- version Introduction to Python 6 IPython • Python: a general-purpose programming language (1980) • IPython: an interactive command shell for Python (2001) by Fernando Perez • Enhanced Read-Eval-Print Loop (REPL) environment • Command tab-completion, color-highlighted error messages.. • Basic Linux shell integration (cp, ls, rm…) • Great for plotting! http://ipython.org Introduction to Python 7 Jupyter Notebook IPython introduced a new tool Notebook (2011) • Bring modern and powerful web interface to Python • Rich text, improved graphical capabilities • Integrate many existing web libraries for data visualization • Allow to create and share documents that contain live code, equations, visualizations and explanatory text.
    [Show full text]
  • NUG Single Node Optimization Presentation
    Single Node Optimization on Hopper Michael Stewart, NERSC Introduction ● Why are there so many compilers available on Hopper? ● Strengths and weaknesses of each compiler. ● Advice on choosing the most appropriate compiler for your work. ● Comparative benchmark results. ● How to compile and run with OpenMP for each compiler. ● Recommendations for running hybrid MPI/OpenMP codes on a node. Why So Many Compilers on Hopper? ● Franklin was delivered with the only commercially available compiler for Cray Opteron systems, PGI. ● GNU compilers were on Franklin, but at that time GNU Fortran optimization was poor. ● Next came Pathscale because of superior optimization. ● Cray was finally legally allowed to port their compiler to the Opteron so it was added next. ● Intel was popular on Carver, and it produced highly optimized codes on Hopper. ● PGI is still the default, but this is not a NERSC recommendation. Cray's current default is the Cray compiler, but we kept PGI to avoid disruption. PGI ● Strengths ○ Available on a wide variety of platforms making codes very portable. ○ Because of its wide usage, it is likely to compile almost any valid code cleanly. ● Weaknesses ○ Does not optimize as well as compilers more narrowly targeted to AMD architectures. ● Optimization recommendation: ○ -fast Cray ● Strengths ○ Fortran is well optimized for the Hopper architecture. ○ Uses Cray math libraries for optimization. ○ Well supported. ● Weaknesses ○ Compilations can take much longer than with other compilers. ○ Not very good optimization of C++ codes. ● Optimization recommendations: ○ Compile with no explicit optimization arguments. The default level of optimization is very high. Intel ● Strengths ○ Optimizes C++ and Fortran codes very well.
    [Show full text]
  • PHYS-4007/5007: Computational Physics Course Lecture Notes Section II
    PHYS-4007/5007: Computational Physics Course Lecture Notes Section II Dr. Donald G. Luttermoser East Tennessee State University Version 7.1 Abstract These class notes are designed for use of the instructor and students of the course PHYS-4007/5007: Computational Physics taught by Dr. Donald Luttermoser at East Tennessee State University. II. Choosing a Programming Language A. Which is the Best Programming Language for Your Work? 1. You have come up with a scientific idea which will require nu- merical work using a computer. One needs to ask oneself, which programming language will work best for the project? a) Projects involving data reduction and analysis typically need software with graphics capabilities. Examples of such graphics languages include IDL, Mathlab, Origin, GNU- plot, SuperMongo, and Mathematica. b) Projects involving a lot of ‘number-crunching’ typically require a programming language that is capable of car- rying out math functions in scientific notation with as much precision as possible. In physics and astronomy, the most commonly used number-crunching programming languages include the various flavors of Fortran, C, and more recently, Python. i) As noted in the last section, the decades old For- tran 77 is still widely use in physics and astronomy. ii) Over the past few years, Python has been growing in popularity in scientific programming. c) In this class, we will focus on two programming languages: Fortran and Python. From time to time we will discuss the IDL programming language since some of you may encounter this software during your graduate and profes- sional career. d) Any coding introduced in these notes will be written in either of these three programming languages.
    [Show full text]