Commit ce951814 authored by Nitin Shukla's avatar Nitin Shukla
Browse files

Slide

parent 32ea9f83
%% Cell type:markdown id: tags:
## Learning outcome
# A fresh approach to high-performance computing with JuliaLang
- What is Julia and Why Julia?
#### N. Shukla
CINECA,Via Magnanelli 6/3 Casalecchio di Reno (BO)
Bologna, Italy
### Email:
n.shukla@cineca.it
-------
N. Shukla |CINECA, Bologna, Italy | July-2021
%% Cell type:markdown id: tags:
### Learning outcome
- How it all begun: What, When and Why?
- Ways to run Julia code
* Installing Julia
* Using the REPL
* Using Jupyter notebooks: Installing IJulia
- Julia Basics
*
* Install Juno for Atom
-------
%% Cell type:code id: tags:
%% Cell type:markdown id: tags:
``` julia
```
### Target audience
- Level of the content is aimed for beginners/intermediate students
- but interesting bonus remarks are added here and there for the more advanced students too!
- These notebooks should provide multiple [links](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks#julia) to more advanced material and for [further reading](https://en.wikibooks.org/wiki/Introducing_Julia)
-----------------------------------
%% Cell type:markdown id: tags:
### What is Julia?
Julia is a high-level, high-performance dynamic programming language for numerical computing.
##### A summary of features:
- Free and open source!
- [Multiple dispatch](http://en.wikipedia.org/wiki/Multiple_dispatch)
- Dynamic types
- Good performance approaching that of statically-compiled languages like C
- Built-in package manager
- Lisp-like macros and other metaprogramming facilities
- Call [Python functions](https://github.com/stevengj/PyCall.jl)
- Call [C and Fortran functions](https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/) directly
- User-defined types are as fast and compact as built-ins because Julia is homoiconic
-----------------------------------
%% Cell type:markdown id: tags:
### When?
Work on Julia was started in 2009, by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman.
Here is a quote from the creators of Julia from their first official blog article “Why We Created Julia (https://julialang.org/blog/2012/02/why-we-created-julia/)”
![](pic/fig0.jpg)
#### Version 1.8.0-DEV.43 (2021-06-17)
-----------------------------------
%% Cell type:markdown id: tags:
### Why do need another programming language?
"We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled"
## Open source
Julia is open source, developed now by a community.
Licensed under MIT license.
- open and permissive license
This means it *is* and *will be* open source.
%% Cell type:markdown id: tags:
![](pic/fig1.jpg)
%% Cell type:markdown id: tags:
-----------------------------------
## Julia combines performance and productivity
![](pic/fig2.jpg)
1. JIT compiled
* every statement is run using compiled functions which are either compile
* LLVM-based JIT compilers (Low level virtual machine just-in-time) have been optimized for far longer than Julia
2. Julia is fast
* type-stability through specialization via multiple-dispatch is what allows Julia to be very easy for a compiler to make into efficient code but also allow the code to be very concise and "look like a scripting language".
* Julia is NOT a interactive langauge, is compiled
### A simple [benchmark](https://julialang.org/benchmarks/) relative to C:
![benchmarks](pic/benchmarks.svg)
-----------------------------------
%% Cell type:markdown id: tags:
## Setting up Julia Environment
Strongly recommended to install Julia in their local computers.
### Installations:
Download Julia (Window/Linux, Mac): https://julialang.org/downloads/
#### Platform Specific Instructions for Official Binaries
https://julialang.org/downloads/platform/#installation_notes
%% Cell type:markdown id: tags:
#### Installing Julia in Windows:
Step-1. Select an appropriate version: 32-bit or 64-bit
![](pic/fig3.jpg)
%% Cell type:markdown id: tags:
Step 2. Install Julia in C:\julia.
(You need to make the installation folder consistent with the path you set in Step 3.)
![](pic/fig4.jpg)
Step 3. Open a Command Prompt and enter the following command:
setx PATH "%PATH%;C:\julia\bin"
https://julialang.org/downloads/platform/
%% Cell type:markdown id: tags:
### Installing Julia in OSX:¶
##### Pretty straight forward:
On macOS, a julia-1.6.1-mac64.dmg file is provided, which contains Julia-1.6.app. Installation is the same as any other Mac software: drag the Julia-1.6.app to Applications Folder's Shortcut. The Julia download runs on macOS 10.9 Mavericks and later releases. You can build from source for macOS 10.6 Snow Leopard (possibly earlier versions as well) and 32-bit but neither are fully supported.
### Homebrew on macOS
brew install --cask julia
%% Cell type:markdown id: tags:
### Installing Julia in Linux:¶
It is strongly recommended that the official generic binaries from the downloads page be used to install Julia on Linux and FreeBSD. The following set of commands downloads the latest version of Julia into a directory named julia-1.6.1.
* wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.1-linux-x86_64.tar.gztar * zxvf julia-1.6.1-linux-x86_64.tar.gz
#### Fedora
sudo dnf install julia
#### Debian/Ubuntu Linux
sudo dnf install
#### juliaArch Linux
sudo pacman -S base-devel git
git clone https://aur.archlinux.org/julia-bin.git
cd julia-binmakepkg -si
%% Cell type:markdown id: tags:
-----------------------------------
### Introduction to the REPL (Read–eval–print loop)
Once you start the Julia executable you will see something like this:
![](pic/fig5.jpg)
-----------------------------------
%% Cell type:markdown id: tags:
### Installing Package/Library in Julia
1. Installing is easy, bit like python
* julia> `import Pkg; Pkg.add("BenchmarkTools")`
* julia> `using Pkg; Pkg.add("BenchmarkTools") `
Complete list on Pkg.JuliaLang.org
%% Cell type:markdown id: tags:
### Using Jupyter notebooks: Installing IJulia
julia> ` Pkg.add("Ijulia") `
From REPL; you can also use `]` install the pkg; add("Library")
## Getting help
The built-in `help` environment can be activated by pressing `?` inside the interactive julia interpreter (REPL).
## How to use shell commands
Type `;` and then you can use (UNIX) shell commands.
%% Cell type:code id: tags:
``` julia
;ls
```
%% Cell type:code id: tags:
``` julia
println("Hello world, I am Julia")
```
%% Cell type:code id: tags:
``` julia
print("Let's start the journey")
```
......
%% Cell type:markdown id: tags:
## Learning outcome
# A fresh approach to high-performance computing with JuliaLang
#### N. Shukla
CINECA,Via Magnanelli 6/3 Casalecchio di Reno (BO)
Bologna, Italy
### Email:
n.shukla@cineca.it
-------
N. Shukla |CINECA, Bologna, Italy | July-2021
%% Cell type:markdown id: tags:
### Learning outcome
- How it all begun: What, When and Why?
- Ways to run Julia code
* Installing Julia
* Using the REPL
* Using Jupyter notebooks: Installing IJulia
* Install Juno for Atom
-----------------------------------
-------
%% Cell type:markdown id: tags:
## Target audience
### Target audience
- Level of the content is aimed for beginners/intermediate students
- but interesting bonus remarks are added here and there for the more advanced students too!
- These notebooks should provide multiple [links](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks#julia) to more advanced material and for [further reading](https://en.wikibooks.org/wiki/Introducing_Julia)
......@@ -58,11 +72,10 @@
%% Cell type:markdown id: tags:
### Why do need another programming language?
%% Cell type:markdown id: tags:
"We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled"
## Open source
Julia is open source, developed now by a community.
......@@ -104,27 +117,28 @@
## Setting up Julia Environment
Strongly recommended to install Julia in their local computers.
-----------------------------------
%% Cell type:markdown id: tags:
### Installations:
Download Julia (Window/Linux, Mac): https://julialang.org/downloads/
#### Platform Specific Instructions for Official Binaries
https://julialang.org/downloads/platform/#installation_notes
%% Cell type:markdown id: tags:
#### Installing Julia in Windows:
Step-1. Select an appropriate version: 32-bit or 64-bit
%% Cell type:markdown id: tags:
![](pic/fig3.jpg)
%% Cell type:markdown id: tags:
Step 2. Install Julia in C:\julia.
(You need to make the installation folder consistent with the path you set in Step 3.)
![](pic/fig4.jpg)
......@@ -148,25 +162,24 @@
### Installing Julia in Linux:¶
It is strongly recommended that the official generic binaries from the downloads page be used to install Julia on Linux and FreeBSD. The following set of commands downloads the latest version of Julia into a directory named julia-1.6.1.
%% Cell type:markdown id: tags:
* wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.1-linux-x86_64.tar.gz
* tar zxvf julia-1.6.1-linux-x86_64.tar.gz
* wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.1-linux-x86_64.tar.gztar * zxvf julia-1.6.1-linux-x86_64.tar.gz
### Fedora
#### Fedora
sudo dnf install julia
#### Debian/Ubuntu Linux
sudo dnf install julia
sudo dnf install
#### juliaArch Linux
sudo pacman -S base-devel git
git clone https://aur.archlinux.org/julia-bin.git
cd julia-binmakepkg -si
### Arch Linux
* sudo pacman -S base-devel git
* git clone https://aur.archlinux.org/julia-bin.git
* cd julia-bin
* makepkg -si
%% Cell type:markdown id: tags:
-----------------------------------
### Introduction to the REPL (Read–eval–print loop)
......@@ -197,16 +210,15 @@
From REPL; you can also use `]` install the pkg; add("Library")
## Getting help
The built-in `help` environment can be activated by pressing `?` inside the interactive julia interpreter (REPL).
%% Cell type:markdown id: tags:
## How to use shell commands
Type `;` and then you can use (UNIX) shell commands.
%% Cell type:code id: tags:
``` julia
;ls
```
......
reveal.js @ ade23457
Subproject commit ade234576e8ddd683cf16d0d8bb0236f37cf1a99
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment