SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
Modern Fortran & Julia 
Arquiteturas Avancadas de Computadores 
Krissia de Zawadzki 
Instituto de F´ısica de S˜ao Carlos - Universidade de S˜ao Paulo 
10 de junho 2014 
Krissia de Zawadzki Modern Fortran  Julia 1 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Outline 
1 Motivation 
2 Modern Fortran 
3 Julia 
4 Programming with Julia 
5 Example of Julia code 
6 Summary 
Krissia de Zawadzki Modern Fortran  Julia 2 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Motivation 
Krissia de Zawadzki Modern Fortran  Julia 3 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Motivation 
MODERN FORTRAN 
3 multi-paradigm: 
structured imperative, generic 
3 typing discipline: strong, static, 
manifest 
3 modern: 90, 95, 2003, 2008 
3 John Backus, 1957 
JULIA 
3 multi-paradigm: 
multiple-dispatch, procedural 
functional, meta 
3 typing discipline: dynamic with 
optional type annotations, and 
type inference 
3 J. Bezanson, S. Karpinski, 
V.B.Shah, A. Edelman, 2012 
Krissia de Zawadzki Modern Fortran  Julia 4 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Motivation 
Krissia de Zawadzki Modern Fortran  Julia 5 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran - a historical review 
FORTRAN 
FORmula TRANslator 
1953 - John Backus: alternative to assembly 
language on IBM-704 mainframe 
1954 - IBM Mathematical Formula 
Translating System 
1956 - 1st FORTRAN manual 
1957 - 1st FORTRAN compiler 
”Much of my work has come from 
being lazy. I didn’t like writing 
programs, and so, when I was working 
on the IBM 701, writing programs for 
computing missile trajectories, I 
started work on a programming system 
to make it easier to write programs.” 
John Backus 
Krissia de Zawadzki Modern Fortran  Julia 6 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran - a historical review 
3 scienti
c computing 
3 high-level programming language 
3 reduced number of statements 
3 compilers able to generate faster and 
ecient codes 
Krissia de Zawadzki Modern Fortran  Julia 6 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran - a historical review 
FORTRAN versions 
3 FORTRAN, I, II, IBM1401, IV 
3 66 → ANSI industry-standard 
3 77 → structured programming, 
character-based data 
3 90 → array, modular and generic 
programming 
3 95 → high performance Fortran 
3 2003 → object-oriented programming 
3 2008 → concurrent programming 
Krissia de Zawadzki Modern Fortran  Julia 6 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran features 
Fortran features 
Character set and layout 
Letters (A to Z and a to z) and digits (0 to 9) 
names : started with letters, up to 31 letters, digits and underscores 
case-sensitive 
special characters = + − */(), .′ :!”%$;?, space 
any character allowed in comments 
tab and form-feed not allowed, no other positioning options 
lines - sequences of 132 characters 
comments with ! 
Krissia de Zawadzki Modern Fortran  Julia 7 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran features 
Fortran features 
fortran code 
START 
SPECIFICATIONS 
EXECUTION 
END 
machine 
instructions 
executable 
program 
run! 
compiler 
linker OS 
Krissia de Zawadzki Modern Fortran  Julia 7 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Early Fortran versions 
Early Fortran versions 
Statements: 
3 DIMENSION and EQUIVALENCE statements 
3 assignment statements 
3 arithmetic IF 
3 IF for exceptions 
3 GOTO, ASSIGN 
3 DO loops 
3 FORMAT, READ, READ INPUT TAPE, WRITE, WRITE OUTPUT 
TAPE, PRINT, and PUNCH 
3 READ TAPE, READ DRUM, WRITE TAPE, and WRITE DRUM 
3 END FILE, REWIND, and BACKSPACE 
3 PAUSE, STOP, and CONTINUE 
3 FREQUENCY statement 
Krissia de Zawadzki Modern Fortran  Julia 8 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Early Fortran versions 
Early Fortran versions 
FORTRAN II - 1958 
3 SUBROUTINE, FUNCTION and END 
3 CALL and RETURN 
3 COMMON 
7 recursion not allowed in subroutines (arch without support for 
stacks) 
FORTRAN III - 1958 
3 inline assembly code 
7 codes 704 FORTRAN and FORTRAN II, FORTRAN III unportable 
from machine 
7 never released 
Krissia de Zawadzki Modern Fortran  Julia 8 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Early Fortran versions 
Early Fortran versions 
IBM 1401 FORTRAN 
3 program in memory 
3 executable form not machine language - early Pascal code 
FORTRAN IV - 1961 
3 no machine-dependent features 
3 + LOGICAL data type and boolean expressions 
3 important educational tool 
3 WATFIV simplifying compile and link 
Krissia de Zawadzki Modern Fortran  Julia 8 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
FORTRAN 66 
FORTRAN 66 
3 American Standard Fortran 
3 Main, SUBROUTINE, FUNCTION and BLOCK DATA prog. 
units 
3 INTEGER, REAL, DOUBLE PRECISION, COMPLEX and 
LOGICAL 
3 COMMON, DIMENSION, and EQUIVALENCE statements 
3 GOTO, assigned GOTO, and computed GOTO statements 
3 Logical IF and arithmetic (three-way) IF statements 
3 READ, WRITE, BACKSPACE, REWIND, and ENDFILE 
statements for sequential I/O 
3 FORMAT statement 
3 CALL, RETURN, PAUSE, and STOP statements 
3 Identi
ers of up to six characters in length 
3 Comment lines 
Krissia de Zawadzki Modern Fortran  Julia 9 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
FORTRAN 77 
FORTRAN 77 
3 Block IF- END IF - ELSE - ELSE IF 
3 DO loop: negative increments, zero trip 
counts 
3 OPEN, CLOSE, and INQUIRE statements- 
I/O capability and direct access
le 
3 IMPLICIT statement 
3 CHARACTER data type 
3 PARAMETER - constants 
3 SAVE - persistent local vars 
3 LGE, LGT, LLE, LLT - lexical comparision of 
strings 
3 Holletith constants and date 
3 Overindexing of array 
3 extended range 
Krissia de Zawadzki Modern Fortran  Julia 10 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran 90 
Fortran 90 
3 free form source code - columns 
1 to 6 no longer special 
3 implicit none - check all variables 
declared with explicit type 
3 modules - partioning the code in 
small units 
3 internal routines - compiles 
check the correctness of args 
3 no need for GOTO - replaced by exit 
3 recursive routines 
3 allocate and deallocate - changing size of arrays 
3 array operations supported in arithmetic expressions 
and can be automatic 
3 derived types - used the same way of basic tpes 
3 overboarding - extend the language operators to 
derived types 
3 optional args in funcs and subroutines - args in 
arbitrary order 
3 kinds -determining the characteristics of basic types 
3 select/case - you can use a name for all control 
structures 
3 enhancements of I/O system - program can read or 
write a part of a record in one statement and the rest 
in another one 
Krissia de Zawadzki Modern Fortran  Julia 11 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran 95 
Fortran 95 
3 High Performance Fortran 
3 null() to initialize pointers explicity 
3 allocatable variables without save attribute - 
automatically deallocated 
3 technical reports 
3 pure - more opportunities of optimization - or 
elemental - work on individual elements of 
arrays - routines 
3 forall statement - enhance capabilities of array 
operations 
Krissia de Zawadzki Modern Fortran  Julia 12 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran 2003 
Fortran 2003 
3 Object-oriented programming 
3 procedures( funcs or 
subroutines) - get passed to the 
variables of a speci
c types 
3 derived types can be extended 
into new types 
3 select statement in polymorphic variables 
(classes) 
3 abstract interfaces 
3 procedure pointers as ordinary variavles 
3 intrinsic modules - rounding mode, fp 
exceptions, interfacing to C, dierent calling 
and naming conventions 
3 Memory management enhanced: lenght of 
character strings by allocate; arrays can be 
reallocated to correct size; allocations of 
memory from one variable to another 
movealloc 
3 stream access to
les - read and write 
formatted binary
les 
3 standard access to system environment 
variables 
Krissia de Zawadzki Modern Fortran  Julia 13 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Fortran 2008 
Fortran 2008 
3 coarrays - data avaliable on various copies 
3 contiguous arrays 
3 blocs - end blocks : local scope 
3 submodules and import - very large source
les 
3 exit statement can be used to jump to the end 
of if or select blocks 
3 do concurrent statement - the code can be run 
in parallel (thread concept) 
3 internal procedures now passed as actual args 
- access to varables in the routine that contain 
them 
3 new standard functions - Bessel functions and 
bit inquiry functions 
Krissia de Zawadzki Modern Fortran  Julia 14 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Modern Fortran features 
Modern Fortran features 
Modern style 
Free format, attributes 
implicit none 
do, exit, cycle, case 
single and double precision 
Dynamic data types 
allocatable arrays 
structures, derived types 
Module-oriented programming 
internal subprograms 
private, public, protected 
contains 
use 
Optional arguments  intent 
FORmula TRANSlation 
array syntax, where and forall 
statements 
extended  user-de
ned 
operators 
Functions: elemental, inquiry, 
mathematical 
Improvements 
Fortran pointers 
command line arguments 
Environment variables 
Interoperability with C 
3 performance considerations 
3 objected-oriented programming 
Krissia de Zawadzki Modern Fortran  Julia 15 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Performance 
Comparison of Data Structures 
Implementations 
3 what is the performance 
penalty of using Fortran 90 
data abstraction features? 
3 test problem solves Maxwell's 
Equations using the Yee-scheme 
3 style loops and data structures: 
dierent in f77 and f90 
Krissia de Zawadzki Modern Fortran  Julia 16 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Introduction 
Introduction to Julia 
3 2012, in
uenced by MATLAB, Scheme, 
Lisp, C, Fortran, Wolfram, Python, 
Perl, R, Ruby 
3 high-level dynamic programming 
language 
3 parametric types 
3 parallel and distributed computing 
3 direct calling of C, 
Fortran and Python 
libraries 
3 libraries for 

oating-point, linear 
algebra, random number 
generation, FFT and 
regular expression 
matching 
Krissia de Zawadzki Modern Fortran  Julia 17 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Introduction 
Introduction to Julia 
Krissia de Zawadzki Modern Fortran  Julia 17 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Julia features 
Julia Features 
3 Multiple dispatch 
3 Dynamic type system 
3 Good performance 
3 Built-in package manager 
3 Lisp-like macros and metaprogramming facilities 
3 PyCall package - call python function 
3 Call C functions directly 
3 shell-like capabilities for managing other process 
3 paralellism and distributed computation 
3 Coroutines: lightweight greenthreading 
3 user types as fast as built-ins 
3 other types - generation, extensible conversions, etc are ecient 
3 Unicode support not limited to UTF-8 
3 MIT licensed : free and open source 
Krissia de Zawadzki Modern Fortran  Julia 18 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
High Performance JIT Compiler 
High Performance JIT Compiler 
LLVM-based just-in-time 
3 compilation during the execution 
3 ahead of time compilation (AOT) and 
interpretation 
3 optimized to the CPU and OS 
3 statistics about the program - rearrange 
and recompile for optimal performance 
3 global code and cache use optimizations 
3 performance often matches C! 
Krissia de Zawadzki Modern Fortran  Julia 19 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Julia packages 
Julia packages 
3 219 avaliable packages! 
3 mature package ecosystem 
3 easy install - 
Pkg.add(mypackage) 
PyCall, PyPlot, PySide, SymPy 
Calculus, Cartesian, Elliptic, 
Polynomial, TimeSeries 
RdRand, RandomMatrices 
BioSeq, ChemicalKinetics, 
GeneticAlgorithms, Phylogenetics 
MarketTechnicals 
Clustering, DecisionTree, 
DimensionalityReduction, 
SortingAlgorithms 
TextAnalysis 
Krissia de Zawadzki Modern Fortran  Julia 20 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Parallel and cloud computing with Julia 
Parallel and cloud computing with Julia 
3 worker processes - key building blocks for 
distributed computation 
3 message-passing ”one-side”!= from MPI 
3 remote references and remote calls 
3 data management 
3 code editing and sharing, data exploration 
and visualization 
3 networks and streams 
Krissia de Zawadzki Modern Fortran  Julia 21 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Getting started 
Getting started 
Krissia de Zawadzki Modern Fortran  Julia 22 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Integer types 
Integer types 
Krissia de Zawadzki Modern Fortran  Julia 23 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Float types 
Float types 
Krissia de Zawadzki Modern Fortran  Julia 24 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Math operations 
Math operations 
Krissia de Zawadzki Modern Fortran  Julia 25 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Strings 
Strings 
Krissia de Zawadzki Modern Fortran  Julia 26 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Functions 
Functions 
Krissia de Zawadzki Modern Fortran  Julia 27 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Control Flow 
Control Flow 
Krissia de Zawadzki Modern Fortran  Julia 28 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Parallel Julia - beginners 
Parallel Julia - beginners 
Krissia de Zawadzki Modern Fortran  Julia 29 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Parallel Julia - beginners: adding vectors 
Parallel Julia - beginners: adding vectors 
Krissia de Zawadzki Modern Fortran  Julia 30 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Laplace equation 
Example of Julia code - laplace equation 
Laplace Equation ∇2휙 = 0 bondary conditions! 
휙(푥 − Δ푥, 푦) − 2휙(푥, 푦) + 휙(푥 + Δ푥, 푦) 
Δ푥 
+ 
휙(푥, 푦 − Δ푦) − 2휙(푥, 푦) + 휙(푥, 푦 + Δ푦) 
Δ푦 
= 0 
휙푖푗 = 
휙푖−1,푗 + 휙푖+1,푗 + 휙푖,푗−1 + 휙푖,푗+1 
4 
Krissia de Zawadzki Modern Fortran  Julia 31 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Julia code 
Example of Julia code 
Julia code: solve lap.jl 
Krissia de Zawadzki Modern Fortran  Julia 32 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Julia code 
Example of Julia code 
C code: laplace.c 
Krissia de Zawadzki Modern Fortran  Julia 33 / 38
Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary 
Tests - bondary conditions:1 
Example of Julia code 
푚[0, 0 : 푁] = 푚[푁, 0 : 푁] = −1 and 푚[0 : 푁, 0] = 푚[0 : 푁,푁] = 1 
Krissia de Zawadzki Modern Fortran  Julia 34 / 38

Mais conteúdo relacionado

Mais procurados (19)

First session quiz
First session quizFirst session quiz
First session quiz
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
 
C programming session7
C programming  session7C programming  session7
C programming session7
 
Quiz 9
Quiz 9Quiz 9
Quiz 9
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
C programming first_session
C programming first_sessionC programming first_session
C programming first_session
 
C programming session9 -
C programming  session9 -C programming  session9 -
C programming session9 -
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
 
02 copy file_fill_sp16
02 copy file_fill_sp1602 copy file_fill_sp16
02 copy file_fill_sp16
 
Compiler unit 4
Compiler unit 4Compiler unit 4
Compiler unit 4
 
Al2ed chapter5
Al2ed chapter5Al2ed chapter5
Al2ed chapter5
 
EMBEDDED C
EMBEDDED CEMBEDDED C
EMBEDDED C
 
C programming session5
C programming  session5C programming  session5
C programming session5
 
Assembler
AssemblerAssembler
Assembler
 
PM1
PM1PM1
PM1
 
C programming part2
C programming part2C programming part2
C programming part2
 
Compiler Design Unit 1
Compiler Design Unit 1Compiler Design Unit 1
Compiler Design Unit 1
 
4 compiler lab - Syntax Ana
4 compiler lab - Syntax Ana4 compiler lab - Syntax Ana
4 compiler lab - Syntax Ana
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 

Destaque

Unveiling the physics of hair shapes - journal club 2014
Unveiling the physics of hair shapes - journal club 2014Unveiling the physics of hair shapes - journal club 2014
Unveiling the physics of hair shapes - journal club 2014Krissia Zawadzki
 
Early History of Fortran: The Making of a Wonder | Turing100@Persistent
Early History of Fortran: The Making of a Wonder | Turing100@PersistentEarly History of Fortran: The Making of a Wonder | Turing100@Persistent
Early History of Fortran: The Making of a Wonder | Turing100@PersistentPersistent Systems Ltd.
 
Cied 5053 historical_presentation_pascal_amy_jackson
Cied 5053 historical_presentation_pascal_amy_jacksonCied 5053 historical_presentation_pascal_amy_jackson
Cied 5053 historical_presentation_pascal_amy_jacksonaljacks123
 
Information technology
Information technologyInformation technology
Information technologyApie248
 
Programar En Fortran
Programar En FortranProgramar En Fortran
Programar En FortranSaul Bernal
 
Cuántos tipos de presentadores electrónicos existen fijos
Cuántos tipos de presentadores electrónicos existen fijosCuántos tipos de presentadores electrónicos existen fijos
Cuántos tipos de presentadores electrónicos existen fijosmemojair
 
Tipos de presentadores electronicos
Tipos de presentadores electronicosTipos de presentadores electronicos
Tipos de presentadores electronicosDaniiel Larregui
 
History of computer
History of computerHistory of computer
History of computerMNButt
 
PGI CUDA FortranとGPU最適化ライブラリの一連携法
PGI CUDA FortranとGPU最適化ライブラリの一連携法PGI CUDA FortranとGPU最適化ライブラリの一連携法
PGI CUDA FortranとGPU最適化ライブラリの一連携法智啓 出川
 
Evolution and classification of computers
Evolution and classification of computersEvolution and classification of computers
Evolution and classification of computersAVINASH ANAND
 
02. History - Evolution of Computers
02. History - Evolution of Computers02. History - Evolution of Computers
02. History - Evolution of ComputersAkhila Dakshina
 
Blaise pascal
Blaise pascalBlaise pascal
Blaise pascalewolterb
 
Normas Para Presentar Trabajos
Normas Para Presentar TrabajosNormas Para Presentar Trabajos
Normas Para Presentar TrabajosGestioPolis com
 
Blaise pascal
Blaise pascalBlaise pascal
Blaise pascalsbrierton
 
Feasibility study of setting up a computer store chapter 1-5
Feasibility study of setting up a computer store chapter 1-5Feasibility study of setting up a computer store chapter 1-5
Feasibility study of setting up a computer store chapter 1-5Christofer De Los Reyes
 
Uni cambridge
Uni cambridgeUni cambridge
Uni cambridgeN/A
 

Destaque (20)

Unveiling the physics of hair shapes - journal club 2014
Unveiling the physics of hair shapes - journal club 2014Unveiling the physics of hair shapes - journal club 2014
Unveiling the physics of hair shapes - journal club 2014
 
Early History of Fortran: The Making of a Wonder | Turing100@Persistent
Early History of Fortran: The Making of a Wonder | Turing100@PersistentEarly History of Fortran: The Making of a Wonder | Turing100@Persistent
Early History of Fortran: The Making of a Wonder | Turing100@Persistent
 
Cied 5053 historical_presentation_pascal_amy_jackson
Cied 5053 historical_presentation_pascal_amy_jacksonCied 5053 historical_presentation_pascal_amy_jackson
Cied 5053 historical_presentation_pascal_amy_jackson
 
Information technology
Information technologyInformation technology
Information technology
 
Mancheter
MancheterMancheter
Mancheter
 
Blaise Pascal Biography
Blaise Pascal BiographyBlaise Pascal Biography
Blaise Pascal Biography
 
Programar En Fortran
Programar En FortranProgramar En Fortran
Programar En Fortran
 
History of computers
History of computersHistory of computers
History of computers
 
Activity 3 history of computer
Activity 3   history of computerActivity 3   history of computer
Activity 3 history of computer
 
Cuántos tipos de presentadores electrónicos existen fijos
Cuántos tipos de presentadores electrónicos existen fijosCuántos tipos de presentadores electrónicos existen fijos
Cuántos tipos de presentadores electrónicos existen fijos
 
Tipos de presentadores electronicos
Tipos de presentadores electronicosTipos de presentadores electronicos
Tipos de presentadores electronicos
 
History of computer
History of computerHistory of computer
History of computer
 
PGI CUDA FortranとGPU最適化ライブラリの一連携法
PGI CUDA FortranとGPU最適化ライブラリの一連携法PGI CUDA FortranとGPU最適化ライブラリの一連携法
PGI CUDA FortranとGPU最適化ライブラリの一連携法
 
Evolution and classification of computers
Evolution and classification of computersEvolution and classification of computers
Evolution and classification of computers
 
02. History - Evolution of Computers
02. History - Evolution of Computers02. History - Evolution of Computers
02. History - Evolution of Computers
 
Blaise pascal
Blaise pascalBlaise pascal
Blaise pascal
 
Normas Para Presentar Trabajos
Normas Para Presentar TrabajosNormas Para Presentar Trabajos
Normas Para Presentar Trabajos
 
Blaise pascal
Blaise pascalBlaise pascal
Blaise pascal
 
Feasibility study of setting up a computer store chapter 1-5
Feasibility study of setting up a computer store chapter 1-5Feasibility study of setting up a computer store chapter 1-5
Feasibility study of setting up a computer store chapter 1-5
 
Uni cambridge
Uni cambridgeUni cambridge
Uni cambridge
 

Semelhante a Seminar Fortran and Julia

GJIMT BCA P4UGCA1932U3L6.pptx
GJIMT BCA P4UGCA1932U3L6.pptxGJIMT BCA P4UGCA1932U3L6.pptx
GJIMT BCA P4UGCA1932U3L6.pptxParamjit24
 
Grape generative fuzzing
Grape generative fuzzingGrape generative fuzzing
Grape generative fuzzingFFRI, Inc.
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules RestructuredDoiT International
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructuredAmi Mahloof
 
Recursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, BangaloreRecursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, BangaloreBhasker Kode
 
Tracer Evaluation
Tracer EvaluationTracer Evaluation
Tracer EvaluationQiao Han
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...inside-BigData.com
 
MSc CST (5yr Integrated Course ) Syllabus - Madras University
MSc CST (5yr Integrated Course ) Syllabus - Madras UniversityMSc CST (5yr Integrated Course ) Syllabus - Madras University
MSc CST (5yr Integrated Course ) Syllabus - Madras UniversityGriffinder VinHai
 
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Maksim Shudrak
 
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...Felipe Prado
 
EST 102 C P.pptx
EST 102 C P.pptxEST 102 C P.pptx
EST 102 C P.pptxsreekala47
 
Fletcher Framework for Programming FPGA
Fletcher Framework for Programming FPGAFletcher Framework for Programming FPGA
Fletcher Framework for Programming FPGAGanesan Narayanasamy
 
Nodes and Networks for HPC computing
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computingrinnocente
 
Beyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureBeyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureJayaram Sankaranarayanan
 
Introduction to FPGA acceleration
Introduction to FPGA accelerationIntroduction to FPGA acceleration
Introduction to FPGA accelerationMarco77328
 

Semelhante a Seminar Fortran and Julia (20)

GJIMT BCA P4UGCA1932U3L6.pptx
GJIMT BCA P4UGCA1932U3L6.pptxGJIMT BCA P4UGCA1932U3L6.pptx
GJIMT BCA P4UGCA1932U3L6.pptx
 
Python-content-1.pdf
Python-content-1.pdfPython-content-1.pdf
Python-content-1.pdf
 
Grape generative fuzzing
Grape generative fuzzingGrape generative fuzzing
Grape generative fuzzing
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules Restructured
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Open64 compiler
Open64 compilerOpen64 compiler
Open64 compiler
 
Recursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, BangaloreRecursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, Bangalore
 
Diploma in Information Technology
Diploma in Information TechnologyDiploma in Information Technology
Diploma in Information Technology
 
Tracer Evaluation
Tracer EvaluationTracer Evaluation
Tracer Evaluation
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
 
MSc CST (5yr Integrated Course ) Syllabus - Madras University
MSc CST (5yr Integrated Course ) Syllabus - Madras UniversityMSc CST (5yr Integrated Course ) Syllabus - Madras University
MSc CST (5yr Integrated Course ) Syllabus - Madras University
 
Diploma in computer applications
Diploma in computer applicationsDiploma in computer applications
Diploma in computer applications
 
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
 
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
DEF CON 27 - MAKSIM SHUDRAK - zero bugs found hold my beer afl how to improve...
 
EST 102 C P.pptx
EST 102 C P.pptxEST 102 C P.pptx
EST 102 C P.pptx
 
Fletcher Framework for Programming FPGA
Fletcher Framework for Programming FPGAFletcher Framework for Programming FPGA
Fletcher Framework for Programming FPGA
 
Nodes and Networks for HPC computing
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computing
 
Beyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software ArchitectureBeyond PITS, Functional Principles for Software Architecture
Beyond PITS, Functional Principles for Software Architecture
 
Introduction to FPGA acceleration
Introduction to FPGA accelerationIntroduction to FPGA acceleration
Introduction to FPGA acceleration
 
CPLD & FPGA
CPLD & FPGACPLD & FPGA
CPLD & FPGA
 

Último

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Último (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Seminar Fortran and Julia

  • 1. Modern Fortran & Julia Arquiteturas Avancadas de Computadores Krissia de Zawadzki Instituto de F´ısica de S˜ao Carlos - Universidade de S˜ao Paulo 10 de junho 2014 Krissia de Zawadzki Modern Fortran Julia 1 / 38
  • 2. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Outline 1 Motivation 2 Modern Fortran 3 Julia 4 Programming with Julia 5 Example of Julia code 6 Summary Krissia de Zawadzki Modern Fortran Julia 2 / 38
  • 3. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Motivation Krissia de Zawadzki Modern Fortran Julia 3 / 38
  • 4. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Motivation MODERN FORTRAN 3 multi-paradigm: structured imperative, generic 3 typing discipline: strong, static, manifest 3 modern: 90, 95, 2003, 2008 3 John Backus, 1957 JULIA 3 multi-paradigm: multiple-dispatch, procedural functional, meta 3 typing discipline: dynamic with optional type annotations, and type inference 3 J. Bezanson, S. Karpinski, V.B.Shah, A. Edelman, 2012 Krissia de Zawadzki Modern Fortran Julia 4 / 38
  • 5. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Motivation Krissia de Zawadzki Modern Fortran Julia 5 / 38
  • 6. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran - a historical review FORTRAN FORmula TRANslator 1953 - John Backus: alternative to assembly language on IBM-704 mainframe 1954 - IBM Mathematical Formula Translating System 1956 - 1st FORTRAN manual 1957 - 1st FORTRAN compiler ”Much of my work has come from being lazy. I didn’t like writing programs, and so, when I was working on the IBM 701, writing programs for computing missile trajectories, I started work on a programming system to make it easier to write programs.” John Backus Krissia de Zawadzki Modern Fortran Julia 6 / 38
  • 7. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran - a historical review 3 scienti
  • 8. c computing 3 high-level programming language 3 reduced number of statements 3 compilers able to generate faster and ecient codes Krissia de Zawadzki Modern Fortran Julia 6 / 38
  • 9. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran - a historical review FORTRAN versions 3 FORTRAN, I, II, IBM1401, IV 3 66 → ANSI industry-standard 3 77 → structured programming, character-based data 3 90 → array, modular and generic programming 3 95 → high performance Fortran 3 2003 → object-oriented programming 3 2008 → concurrent programming Krissia de Zawadzki Modern Fortran Julia 6 / 38
  • 10. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran features Fortran features Character set and layout Letters (A to Z and a to z) and digits (0 to 9) names : started with letters, up to 31 letters, digits and underscores case-sensitive special characters = + − */(), .′ :!”%$;?, space any character allowed in comments tab and form-feed not allowed, no other positioning options lines - sequences of 132 characters comments with ! Krissia de Zawadzki Modern Fortran Julia 7 / 38
  • 11. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran features Fortran features fortran code START SPECIFICATIONS EXECUTION END machine instructions executable program run! compiler linker OS Krissia de Zawadzki Modern Fortran Julia 7 / 38
  • 12. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Early Fortran versions Early Fortran versions Statements: 3 DIMENSION and EQUIVALENCE statements 3 assignment statements 3 arithmetic IF 3 IF for exceptions 3 GOTO, ASSIGN 3 DO loops 3 FORMAT, READ, READ INPUT TAPE, WRITE, WRITE OUTPUT TAPE, PRINT, and PUNCH 3 READ TAPE, READ DRUM, WRITE TAPE, and WRITE DRUM 3 END FILE, REWIND, and BACKSPACE 3 PAUSE, STOP, and CONTINUE 3 FREQUENCY statement Krissia de Zawadzki Modern Fortran Julia 8 / 38
  • 13. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Early Fortran versions Early Fortran versions FORTRAN II - 1958 3 SUBROUTINE, FUNCTION and END 3 CALL and RETURN 3 COMMON 7 recursion not allowed in subroutines (arch without support for stacks) FORTRAN III - 1958 3 inline assembly code 7 codes 704 FORTRAN and FORTRAN II, FORTRAN III unportable from machine 7 never released Krissia de Zawadzki Modern Fortran Julia 8 / 38
  • 14. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Early Fortran versions Early Fortran versions IBM 1401 FORTRAN 3 program in memory 3 executable form not machine language - early Pascal code FORTRAN IV - 1961 3 no machine-dependent features 3 + LOGICAL data type and boolean expressions 3 important educational tool 3 WATFIV simplifying compile and link Krissia de Zawadzki Modern Fortran Julia 8 / 38
  • 15. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary FORTRAN 66 FORTRAN 66 3 American Standard Fortran 3 Main, SUBROUTINE, FUNCTION and BLOCK DATA prog. units 3 INTEGER, REAL, DOUBLE PRECISION, COMPLEX and LOGICAL 3 COMMON, DIMENSION, and EQUIVALENCE statements 3 GOTO, assigned GOTO, and computed GOTO statements 3 Logical IF and arithmetic (three-way) IF statements 3 READ, WRITE, BACKSPACE, REWIND, and ENDFILE statements for sequential I/O 3 FORMAT statement 3 CALL, RETURN, PAUSE, and STOP statements 3 Identi
  • 16. ers of up to six characters in length 3 Comment lines Krissia de Zawadzki Modern Fortran Julia 9 / 38
  • 17. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary FORTRAN 77 FORTRAN 77 3 Block IF- END IF - ELSE - ELSE IF 3 DO loop: negative increments, zero trip counts 3 OPEN, CLOSE, and INQUIRE statements- I/O capability and direct access
  • 18. le 3 IMPLICIT statement 3 CHARACTER data type 3 PARAMETER - constants 3 SAVE - persistent local vars 3 LGE, LGT, LLE, LLT - lexical comparision of strings 3 Holletith constants and date 3 Overindexing of array 3 extended range Krissia de Zawadzki Modern Fortran Julia 10 / 38
  • 19. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran 90 Fortran 90 3 free form source code - columns 1 to 6 no longer special 3 implicit none - check all variables declared with explicit type 3 modules - partioning the code in small units 3 internal routines - compiles check the correctness of args 3 no need for GOTO - replaced by exit 3 recursive routines 3 allocate and deallocate - changing size of arrays 3 array operations supported in arithmetic expressions and can be automatic 3 derived types - used the same way of basic tpes 3 overboarding - extend the language operators to derived types 3 optional args in funcs and subroutines - args in arbitrary order 3 kinds -determining the characteristics of basic types 3 select/case - you can use a name for all control structures 3 enhancements of I/O system - program can read or write a part of a record in one statement and the rest in another one Krissia de Zawadzki Modern Fortran Julia 11 / 38
  • 20. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran 95 Fortran 95 3 High Performance Fortran 3 null() to initialize pointers explicity 3 allocatable variables without save attribute - automatically deallocated 3 technical reports 3 pure - more opportunities of optimization - or elemental - work on individual elements of arrays - routines 3 forall statement - enhance capabilities of array operations Krissia de Zawadzki Modern Fortran Julia 12 / 38
  • 21. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran 2003 Fortran 2003 3 Object-oriented programming 3 procedures( funcs or subroutines) - get passed to the variables of a speci
  • 22. c types 3 derived types can be extended into new types 3 select statement in polymorphic variables (classes) 3 abstract interfaces 3 procedure pointers as ordinary variavles 3 intrinsic modules - rounding mode, fp exceptions, interfacing to C, dierent calling and naming conventions 3 Memory management enhanced: lenght of character strings by allocate; arrays can be reallocated to correct size; allocations of memory from one variable to another movealloc 3 stream access to
  • 23. les - read and write formatted binary
  • 24. les 3 standard access to system environment variables Krissia de Zawadzki Modern Fortran Julia 13 / 38
  • 25. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Fortran 2008 Fortran 2008 3 coarrays - data avaliable on various copies 3 contiguous arrays 3 blocs - end blocks : local scope 3 submodules and import - very large source
  • 26. les 3 exit statement can be used to jump to the end of if or select blocks 3 do concurrent statement - the code can be run in parallel (thread concept) 3 internal procedures now passed as actual args - access to varables in the routine that contain them 3 new standard functions - Bessel functions and bit inquiry functions Krissia de Zawadzki Modern Fortran Julia 14 / 38
  • 27. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Modern Fortran features Modern Fortran features Modern style Free format, attributes implicit none do, exit, cycle, case single and double precision Dynamic data types allocatable arrays structures, derived types Module-oriented programming internal subprograms private, public, protected contains use Optional arguments intent FORmula TRANSlation array syntax, where and forall statements extended user-de
  • 28. ned operators Functions: elemental, inquiry, mathematical Improvements Fortran pointers command line arguments Environment variables Interoperability with C 3 performance considerations 3 objected-oriented programming Krissia de Zawadzki Modern Fortran Julia 15 / 38
  • 29. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Performance Comparison of Data Structures Implementations 3 what is the performance penalty of using Fortran 90 data abstraction features? 3 test problem solves Maxwell's Equations using the Yee-scheme 3 style loops and data structures: dierent in f77 and f90 Krissia de Zawadzki Modern Fortran Julia 16 / 38
  • 30. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Introduction Introduction to Julia 3 2012, in uenced by MATLAB, Scheme, Lisp, C, Fortran, Wolfram, Python, Perl, R, Ruby 3 high-level dynamic programming language 3 parametric types 3 parallel and distributed computing 3 direct calling of C, Fortran and Python libraries 3 libraries for oating-point, linear algebra, random number generation, FFT and regular expression matching Krissia de Zawadzki Modern Fortran Julia 17 / 38
  • 31. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Introduction Introduction to Julia Krissia de Zawadzki Modern Fortran Julia 17 / 38
  • 32. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Julia features Julia Features 3 Multiple dispatch 3 Dynamic type system 3 Good performance 3 Built-in package manager 3 Lisp-like macros and metaprogramming facilities 3 PyCall package - call python function 3 Call C functions directly 3 shell-like capabilities for managing other process 3 paralellism and distributed computation 3 Coroutines: lightweight greenthreading 3 user types as fast as built-ins 3 other types - generation, extensible conversions, etc are ecient 3 Unicode support not limited to UTF-8 3 MIT licensed : free and open source Krissia de Zawadzki Modern Fortran Julia 18 / 38
  • 33. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary High Performance JIT Compiler High Performance JIT Compiler LLVM-based just-in-time 3 compilation during the execution 3 ahead of time compilation (AOT) and interpretation 3 optimized to the CPU and OS 3 statistics about the program - rearrange and recompile for optimal performance 3 global code and cache use optimizations 3 performance often matches C! Krissia de Zawadzki Modern Fortran Julia 19 / 38
  • 34. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Julia packages Julia packages 3 219 avaliable packages! 3 mature package ecosystem 3 easy install - Pkg.add(mypackage) PyCall, PyPlot, PySide, SymPy Calculus, Cartesian, Elliptic, Polynomial, TimeSeries RdRand, RandomMatrices BioSeq, ChemicalKinetics, GeneticAlgorithms, Phylogenetics MarketTechnicals Clustering, DecisionTree, DimensionalityReduction, SortingAlgorithms TextAnalysis Krissia de Zawadzki Modern Fortran Julia 20 / 38
  • 35. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Parallel and cloud computing with Julia Parallel and cloud computing with Julia 3 worker processes - key building blocks for distributed computation 3 message-passing ”one-side”!= from MPI 3 remote references and remote calls 3 data management 3 code editing and sharing, data exploration and visualization 3 networks and streams Krissia de Zawadzki Modern Fortran Julia 21 / 38
  • 36. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Getting started Getting started Krissia de Zawadzki Modern Fortran Julia 22 / 38
  • 37. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Integer types Integer types Krissia de Zawadzki Modern Fortran Julia 23 / 38
  • 38. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Float types Float types Krissia de Zawadzki Modern Fortran Julia 24 / 38
  • 39. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Math operations Math operations Krissia de Zawadzki Modern Fortran Julia 25 / 38
  • 40. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Strings Strings Krissia de Zawadzki Modern Fortran Julia 26 / 38
  • 41. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Functions Functions Krissia de Zawadzki Modern Fortran Julia 27 / 38
  • 42. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Control Flow Control Flow Krissia de Zawadzki Modern Fortran Julia 28 / 38
  • 43. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Parallel Julia - beginners Parallel Julia - beginners Krissia de Zawadzki Modern Fortran Julia 29 / 38
  • 44. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Parallel Julia - beginners: adding vectors Parallel Julia - beginners: adding vectors Krissia de Zawadzki Modern Fortran Julia 30 / 38
  • 45. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Laplace equation Example of Julia code - laplace equation Laplace Equation ∇2휙 = 0 bondary conditions! 휙(푥 − Δ푥, 푦) − 2휙(푥, 푦) + 휙(푥 + Δ푥, 푦) Δ푥 + 휙(푥, 푦 − Δ푦) − 2휙(푥, 푦) + 휙(푥, 푦 + Δ푦) Δ푦 = 0 휙푖푗 = 휙푖−1,푗 + 휙푖+1,푗 + 휙푖,푗−1 + 휙푖,푗+1 4 Krissia de Zawadzki Modern Fortran Julia 31 / 38
  • 46. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Julia code Example of Julia code Julia code: solve lap.jl Krissia de Zawadzki Modern Fortran Julia 32 / 38
  • 47. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Julia code Example of Julia code C code: laplace.c Krissia de Zawadzki Modern Fortran Julia 33 / 38
  • 48. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Tests - bondary conditions:1 Example of Julia code 푚[0, 0 : 푁] = 푚[푁, 0 : 푁] = −1 and 푚[0 : 푁, 0] = 푚[0 : 푁,푁] = 1 Krissia de Zawadzki Modern Fortran Julia 34 / 38
  • 49. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Tests - bondary conditions:2 Example of Julia code 푚[0,푁/3 : 2푁/3] = 푚[푁,푁/3 : 2푁/3] = −1; 푚[푁/3 : 2푁/3, 0] = 푚[푁/3 : 2푁/3,푁] = 1 Krissia de Zawadzki Modern Fortran Julia 35 / 38
  • 50. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Tests - bondary conditions:3 Example of Julia code 푚[0, 0 : 푁] = −1; 푚[푁, 0 : 푁] = 0; 푚[0 : 푁, 0] = 1 and 푚[0 : 푁,푁] = 2 Krissia de Zawadzki Modern Fortran Julia 36 / 38
  • 51. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary Summary 3 Programming languages develop basically with applications demand 3 Fortran has released the high-level programming paradigm in 60's and since then has been continuosly updated in order to serve new scienti
  • 52. c applications 3 Current trends: New languages integrating high performance with graphics potential and parallelism 3 Julia is the bet of enthusiastic programmers! It combines high performance with easy syntax and oers a variety of scienti
  • 53. c packages! Krissia de Zawadzki Modern Fortran Julia 37 / 38
  • 54. Motivation Modern Fortran Julia Programming with Julia Example of Julia code Summary References 3 Markus, Arjen; Modern Fortran in Practice; Cambridge University Press 3 http://people.ds.cam.ac.uk/nmm1/Fortran/index.html 3 /www.tacc.utexas.edu/documents/13601/162125/fortran class.pdf 3 http://julialang.org/ 3 https://github.com/JuliaLang/julia/issues/273 3 http://learnxinyminutes.com/docs/julia/ Krissia de Zawadzki Modern Fortran Julia 38 / 38
  • 55. Krissia de Zawadzki Modern Fortran Julia 1 / 3
  • 56. Julia around the world Julia around the world Krissia de Zawadzki Modern Fortran Julia 2 / 3
  • 57. Parallel Linear Algebra with Julia Parallel Linear Algebra with Julia Two parallel tiled LA algoritms: Cholesky decomposition 퐴 symmetric positive matrix → lower-triangular matrix 퐿: 퐿퐿′ = 퐴 QR decomposition 퐴 being 푚 × 푛 matrix, with 푚 ≥ 푛 → 푚 × 푚 unitary matrix 푄 and 푚 × 푛 upper triangular matrix 푅 : 푄푅 = 퐴 Krissia de Zawadzki Modern Fortran Julia 3 / 3
  • 58. Parallel Linear Algebra with Julia Parallel Linear Algebra with Julia 2 processors, 16 tiles Krissia de Zawadzki Modern Fortran Julia 3 / 3