Commit d4b4a324 authored by paugier's avatar paugier
Browse files

Small updates before the first day

parent 2183495a
Pipeline #75742 failed with stage
in 28 seconds
......@@ -46,6 +46,7 @@ ipynb/index.html: ipynb/index.rst
jupyter-nbconvert $< --reveal-prefix='./reveal.js' --to slides --template $(TPL_FILE)
presentations: $(IPYNBPRES) ipynb/index.html
echo $(IPYNBPRES)
serve: $(IPYNBPRES) ipynb/index.html
cd $(IPYNBDIR) && python3 -m http.server
......@@ -10,7 +10,7 @@ Before considering performances, we will address the problem of evaluating
performance, a.k.a. profiling Python code.
Formated output of the notebooks is available here: https://python-uga.gricad-pages.univ-grenoble-alpes.fr/training-hpc
Formated output of the notebooks is available here: https://python-uga.gricad-pages.univ-grenoble-alpes.fr/training-hpc
## Format et dates
......@@ -36,30 +36,30 @@ sur 2 semaines
## Planning
- Introduction, rappels langage Python et gestion de src [1j : 12/06] (Pierre,
Raphaël et Loïc)
Franck)
- Numpy / Scipy [0.5j : 13/06] (Loïc et Raphaël)
- Numpy / Scipy [0.5j : 13/06] (Pierre, Franck)
- fancy indexing, masking
- presentation of the example "dtw_cort_dist"
- broadcast
- vectorizing
- Visualization - Matplotlib and other tools [0.25j : 13/06] (Loïc et Raphaël)
- Visualization - Matplotlib and other tools [0.25j : 13/06] (Matthieu, Pierre)
- matplotlib object oriented (axes, features...) (Loïc)
- figures et animations (Loïc)
- voir graph plotting python jackc (Raphaël)
- point bokeh, plotly, seaborn (Raphaël)
- matplotlib object oriented (axes, features...) (Pierre)
- figures et animations (Matthieu)
- voir graph plotting python jackc (Matthieu)
- point bokeh, plotly, seaborn (Matthieu)
- Pandas [0.25j : 13/06] (Eric - Raphaël)
- Pandas [0.25j : 13/06] (Pierre)
- load, query, display, export
- Packaging, documentation and testing [0.5j : 17/06] (Raphaël et Pierre)
- Packaging, documentation and testing [0.5j : 17/06] (Pierre)
- General introduction HPC with Python [0.25j] (Pierre)
- Profiling [0.25j] (Pierre et Franck)
- Profiling [0.25j] (Franck, Pierre)
See the book "High performance Python".
......@@ -70,13 +70,13 @@ Raphaël et Loïc)
- kcachegrind
- Memory (memory_profiler, ...)
- Wrapping low level code and/or compiled code [0.5j] (Franck et Loic)
- Wrapping low level code and/or compiled code [0.5j] (Franck)
Mainly for legacy code...
ctypes, cffi, cython, cppyy, pybind11, f2py, pyo3, swig
- Different ways to speed up native Python code [0.5j] (Pierre - Franck)
- Different ways to speed up native Python code [0.5j] (Pierre, Franck)
- using on the fly compiler (like e.g. numba)
- using static compilers (like e.g. pythran)
......@@ -85,26 +85,23 @@ Raphaël et Loïc)
- Tools for parallelisation [0.25j]
threading / multiprocessing / concurrent.futures / OpenMP / mpi4py / GPU /joblib / dask (Pierre - Franck)
threading / multiprocessing / concurrent.futures / OpenMP / mpi4py / GPU /joblib / dask (Franck)
- Déploiement sur cluster et mésocentre (lien singularity, charlie cloud) [0.25j] (Franck - Raphaël)
- Déploiement sur cluster et mésocentre (lien singularity, charlie cloud) [0.25j] (Franck)
- Travaux sur projets personnels [0.5j au moins]
### Présence formateurs
- m: matin
- a: après-midi
| | m 12 | a 12 | m 13 | a 13 | m 17 | a 17 | m 18 | a 18 | m 19 | a 19 |
| | m 23 | a 23 | m 24 | a 24 | m 27 | a 27 | m 28 | a 28 | m 30 | a 30 |
|---------|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|
| Eric | (x) | (x) | (x) | (x) | (x) | | (x) | (x) | (x) | (x) |
| Franck | | | | | | x | x | x | x | x |
| Loïc | | | x | x | | x | | | | |
| Raphaël | | | x | x | x | | | | | x |
| Pierre | x | x | | | x | x | (x) | x | x | (x) |
| Cyrille | | | | | | | | | | |
| Franck | x | x | x | x | x | x | x | | x | x |
| Pierre | x | x | x | x | x | x | x | x | | |
| Matthieu| | | x | x | | | x | x | x | x |
## To be done before the first day of the training session
......
......@@ -3,17 +3,6 @@ import sys
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python version >= 3.6 required.")
try:
import conda
except ImportError:
print(
"Problem: the conda package not importable.\n"
"Please run this script in the base conda environment"
)
sys.exit(1)
else:
print("Good! conda package importable!")
try:
import numpy, scipy, matplotlib, pandas
except ImportError:
......
# Setup your environment
We will have to use Python 3 (with Miniconda3), a good Python IDE (like
Spyder) and a version-control tool (Mercurial, or Git if you know it and really
like it).
In the following, we give indications about how to install these tools and how
to get the repository of this course locally on your computer. Please, if you
encounter problems, fill an issue
[here](https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc/issues)
to explain what you did and what are the errors (please copy / paste the error
log).
Be careful to execute all the commands in the given order, read the outputs of
the commands and answer to the questions asked by the programs!
Note that you can copy/paste the commands! On Linux, you can use the middle
button of the mouse to paste the text that has been previously selected. It's
very convenient! Try to use that!
**Note for Windows users**
You can now install Ubuntu inside Windows. It is called the [Windows Subsystem
for Linux (WSL)](https://ubuntu.com/wsl). There are some specific instructions
for WSL in the file
[notes_wsl.md](https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc/-/blob/master/notes_wsl.md).
#### Install Miniconda and Python
The first step is to install miniconda3 (see
[here](https://docs.conda.io/en/latest/miniconda.html)). On Linux, one just
need to execute these commands in a terminal:
```bash
# wget is used to download a file
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
# this file (Miniconda3-latest-Linux-x86_64.sh) contains bash code and has to
# be executed with the command `bash`
bash Miniconda3-latest-Linux-x86_64.sh
```
You have to answer to different questions. In particular, answer "yes" to the
last question about the initialization of conda. When it's done, close the
terminal (with `ctrl-d`) and reopen a new terminal (with `ctrl-alt-t`). The
string "(base)" should be in the line in the terminal.
If the string "(base)" is not in the line in a new terminal, you might try to
run `$HOME/miniconda3/bin/conda init` and then reopen a new terminal (with
`ctrl-alt-t`).
You have to activate the `conda-forge` conda channel with:
```bash
conda config --add channels conda-forge
```
#### Install few packages in your base conda environment
```bash
# download a requirement file
wget https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc/-/raw/master/requirements.txt
conda install mamba
# install with conda
mamba install --file requirements.txt -y
```
#### Install and setup Mercurial
To install and setup Mercurial, you can do:
```bash
pip install conda-app -U
```
Note: if you get an error, you may need to rerun the command with the option `--no-cache-dir`.
When `conda-app` has been installed, use it to install Mercurial!
```bash
conda-app install mercurial
```
This last command can take some time. **Be patient!** When it's done, close the
terminal (`ctrl-d`) and reopen a new terminal (`ctrl-alt-t`)! Then, you should
be able to run the following commands without errors:
```bash
hg version
which hg
```
The last command should reply a path containing `miniconda`. You now needs to
create a configuration file for Mercurial. You can open it with the text editor
`gedit` with the command:
```bash
gedit ~/.hgrc &
```
Fill the file with the following text. Copy/paste it, adapt it to your case and
don't forget to save the file!
```
[ui]
username=myusername <email@adress.org>
editor=nano
tweakdefaults = True
[extensions]
hgext.extdiff =
# To use Mercurial with GitHub and Gitlab
hggit =
[extdiff]
cmd.meld =
```
Warning: Mercurial **has to be correctly setup**! Since we will use [the Gitlab
instance of UGA](https://gricad-gitlab.univ-grenoble-alpes.fr), the Mercurial
extension hg-git has to be activated so the line `hggit =` in the configuration
file is mandatory.
You can check that Mercurial is correctly configured by executing `hg version
-v`.
To learn more on Mercurial, see [here](
https://fluiddyn.readthedocs.io/en/latest/mercurial_heptapod.html).
#### Clone this repository
Once everything is installed and setup, you should be able to clone the
repository of the training with:
```bash
hg clone https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc.git
```
Please tell me by [creating an issue in the main repository of this
course](https://gricad-gitlab.univ-grenoble-alpes.fr/python-uga/training-hpc/issues)
if it does not work.
Once the repository is cloned you should have a new directory `training-hpc`
(use the command `ls` to see it) and you should be able to enter into it with
`cd training-hpc`.
# to be used with:
# conda install --file requirements.txt
# utilities
python==3.7.3
python==3.8
ipython
# ide
spyder
jupyter
nbconvert>=5.5
invoke
# jupyter
jupyterlab
jupyterlab-spellchecker
jupyterlab_code_formatter
ipympl
bash_kernel
nbconvert>=6
# base numerics
numpy
scipy
matplotlib
pandas
h5py
#vizu
# utilities
invoke
# visualization
# pyviz # (not available in conda-forge)
# wrapper
cffi
......@@ -26,4 +33,4 @@ transonic
# parallel
mpi4py
dask
joblib
\ No newline at end of file
joblib
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