Skip to content

Commit 5e1647e

Browse files
authored
Merge pull request #2 from gjbex/development
Rework material
2 parents 2f3e472 + e35a758 commit 5e1647e

24 files changed

+1972
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For information on the training, see the website
1414
illustrate concepts.
1515
1. [`environment.yml`](environment.yml): conda environment file intended to be
1616
cross-platform.
17-
1. [`python_for_data_science_linux64_conda_specs.txt`](python_for_data_science_linux64_conda_specs.txt):
17+
1. [`python_for_machine_learning_linux64_conda_specs.txt`](python_for_machine_learning_linux64_conda_specs.txt):
1818
conda environment specification file specific for 64-bit Linux to precisely
1919
reproduce the environment on which the code was developed.
2020
1. [License](LICENSE): license information for the material in this repository.

docs/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
The Python programming language is increasingly popular. It is a
2+
versatile language for general purpose programming and accessible
3+
for novice programmers. However, it is also the de facto go-to
4+
language for machine learning applciations. This training
5+
introduces modules that are useful in that context.
6+
7+
8+
## Learning outcomes
9+
10+
When you complete this training you will
11+
12+
* understand what supervised and unsupervised learning are;
13+
* understand the workflow required for supervised learning;
14+
* be able to implement that workflow in scikit-learn;
15+
* know how to use algorithms in scikit-learn such as ridge regression
16+
and naive Bayes classification;
17+
* be able to apply k-means clustering;
18+
* understand the main concepts in deep neural networks;
19+
* be able to apply a convolutional neural network (CNN) to an image
20+
classification task;
21+
* understand the concepts underpinning word embeddings;
22+
* be able to use recurrent network architectures such as
23+
long short term memory (LSTM) to natural language problems;
24+
* be aware of best practices and pitfalls in machine learning.
25+
26+
27+
## Schedule
28+
29+
Total duration: 4 hours.
30+
31+
| Subject | Duration |
32+
|---------------------------------------------|----------|
33+
| introduction and motivation | 20 min. |
34+
| scikit-learn: regression | 40 min. |
35+
| scikit-learn: classification | 30 min. |
36+
| science-learn: clustering | 20 min. |
37+
| coffee break | 10 min. |
38+
| introduction to neural networks | 10 min. |
39+
| Keras: image classification with CNNs | 40 min. |
40+
| Keras: sentiment classification with LSTM | 40 min. |
41+
| hyperparameter optimization | 30 min. |
42+
| wrap up | 10 min. |
43+
44+
45+
## Training materials
46+
47+
Slides are available in the
48+
[GitHub repository](https://github.com/gjbex/Python-for-machine-learning),
49+
as well as example code and hands-on material.
50+
51+
52+
## Target audience
53+
54+
This training is for you if you need to use Python for machine learning
55+
pplcations.
56+
57+
58+
## Prerequisites
59+
60+
You will need experience programming in Python. This is not a training that starts
61+
from scratch. Familiarity with numpy is not required, but would be beneficial.
62+
Familiarity with numpy, pandas and matplotlib is strongly recommended.
63+
64+
If you plan to do Python programming in a Linux or HPC environment you should
65+
be familiar with these as well.
66+
67+
68+
## Trainer(s)
69+
70+
* Geert Jan Bex ([[email protected]](mailto:[email protected]))

environment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: python_for_machine_learning
2+
channels:
3+
- defaults
4+
dependencies:
5+
- keras
6+
- scikit-learn
7+
- pandas
8+
- jupyterlab
9+
- nodejs
10+
- matplotlib
11+
- seaborn
12+
- holoviews
13+
- ipywidgets
14+
- hyperopt

python_for_machine_learning.pptx

-5.13 KB
Binary file not shown.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# This file may be used to create an environment using:
2+
# $ conda create --name <env> --file <this file>
3+
# platform: linux-64
4+
@EXPLICIT
5+
https://repo.anaconda.com/pkgs/main/linux-64/_libgcc_mutex-0.1-main.conda
6+
https://repo.anaconda.com/pkgs/main/linux-64/_tflow_select-2.3.0-mkl.conda
7+
https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-mkl.conda
8+
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2019.11.28-hecc5488_0.tar.bz2
9+
https://repo.anaconda.com/pkgs/main/linux-64/intel-openmp-2019.4-243.conda
10+
https://repo.anaconda.com/pkgs/main/linux-64/ld_impl_linux-64-2.33.1-h53a641e_7.conda
11+
https://repo.anaconda.com/pkgs/main/linux-64/libgfortran-ng-7.3.0-hdf63c60_0.conda
12+
https://repo.anaconda.com/pkgs/main/linux-64/libstdcxx-ng-9.1.0-hdf63c60_0.conda
13+
https://repo.anaconda.com/pkgs/main/linux-64/libgcc-ng-9.1.0-hdf63c60_0.conda
14+
https://repo.anaconda.com/pkgs/main/linux-64/mkl-2019.4-243.conda
15+
https://repo.anaconda.com/pkgs/main/linux-64/c-ares-1.15.0-h7b6447c_1001.conda
16+
https://repo.anaconda.com/pkgs/main/linux-64/expat-2.2.6-he6710b0_0.conda
17+
https://repo.anaconda.com/pkgs/main/linux-64/gmp-6.1.2-h6c8ec71_1.conda
18+
https://repo.anaconda.com/pkgs/main/linux-64/icu-58.2-h9c2bf20_1.conda
19+
https://repo.anaconda.com/pkgs/main/linux-64/jpeg-9b-h024ee3a_2.conda
20+
https://repo.anaconda.com/pkgs/main/linux-64/libffi-3.2.1-hd88cf55_4.conda
21+
https://repo.anaconda.com/pkgs/main/linux-64/libsodium-1.0.16-h1bed415_0.conda
22+
https://repo.anaconda.com/pkgs/main/linux-64/libuuid-1.0.3-h1bed415_2.conda
23+
https://repo.anaconda.com/pkgs/main/linux-64/libxcb-1.13-h1bed415_1.conda
24+
https://repo.anaconda.com/pkgs/main/linux-64/ncurses-6.1-he6710b0_1.conda
25+
https://repo.anaconda.com/pkgs/main/linux-64/nodejs-10.13.0-he6710b0_0.conda
26+
https://conda.anaconda.org/conda-forge/linux-64/openssl-1.1.1d-h516909a_0.tar.bz2
27+
https://repo.anaconda.com/pkgs/main/linux-64/pcre-8.43-he6710b0_0.conda
28+
https://repo.anaconda.com/pkgs/main/linux-64/xz-5.2.4-h14c3975_4.conda
29+
https://repo.anaconda.com/pkgs/main/linux-64/yaml-0.1.7-had09818_2.conda
30+
https://repo.anaconda.com/pkgs/main/linux-64/zlib-1.2.11-h7b6447c_3.conda
31+
https://repo.anaconda.com/pkgs/main/linux-64/glib-2.63.1-h5a9c865_0.conda
32+
https://repo.anaconda.com/pkgs/main/linux-64/hdf5-1.10.4-hb1b8bf9_0.conda
33+
https://repo.anaconda.com/pkgs/main/linux-64/libedit-3.1.20181209-hc058e9b_0.conda
34+
https://repo.anaconda.com/pkgs/main/linux-64/libpng-1.6.37-hbc83047_0.conda
35+
https://repo.anaconda.com/pkgs/main/linux-64/libprotobuf-3.11.2-hd408876_0.conda
36+
https://repo.anaconda.com/pkgs/main/linux-64/libxml2-2.9.9-hea5a465_1.conda
37+
https://repo.anaconda.com/pkgs/main/linux-64/pandoc-2.2.3.2-0.conda
38+
https://repo.anaconda.com/pkgs/main/linux-64/readline-7.0-h7b6447c_5.conda
39+
https://repo.anaconda.com/pkgs/main/linux-64/tk-8.6.8-hbc83047_0.conda
40+
https://repo.anaconda.com/pkgs/main/linux-64/zeromq-4.3.1-he6710b0_3.conda
41+
https://repo.anaconda.com/pkgs/main/linux-64/zstd-1.3.7-h0b5b093_0.conda
42+
https://repo.anaconda.com/pkgs/main/linux-64/dbus-1.13.12-h746ee38_0.conda
43+
https://repo.anaconda.com/pkgs/main/linux-64/freetype-2.9.1-h8a8886c_1.conda
44+
https://repo.anaconda.com/pkgs/main/linux-64/gstreamer-1.14.0-hb453b48_1.conda
45+
https://repo.anaconda.com/pkgs/main/linux-64/libtiff-4.1.0-h2733197_0.conda
46+
https://repo.anaconda.com/pkgs/main/linux-64/sqlite-3.30.1-h7b6447c_0.tar.bz2
47+
https://repo.anaconda.com/pkgs/main/linux-64/fontconfig-2.13.0-h9420a91_0.conda
48+
https://repo.anaconda.com/pkgs/main/linux-64/gst-plugins-base-1.14.0-hbbd80ab_1.conda
49+
https://repo.anaconda.com/pkgs/main/linux-64/python-3.7.6-h0371630_2.conda
50+
https://repo.anaconda.com/pkgs/main/linux-64/astor-0.8.0-py37_0.conda
51+
https://repo.anaconda.com/pkgs/main/noarch/attrs-19.3.0-py_0.tar.bz2
52+
https://repo.anaconda.com/pkgs/main/linux-64/backcall-0.1.0-py37_0.conda
53+
https://conda.anaconda.org/conda-forge/linux-64/certifi-2019.11.28-py37_0.tar.bz2
54+
https://conda.anaconda.org/conda-forge/noarch/cloudpickle-1.2.2-py_1.tar.bz2
55+
https://repo.anaconda.com/pkgs/main/noarch/decorator-4.4.1-py_0.tar.bz2
56+
https://repo.anaconda.com/pkgs/main/noarch/defusedxml-0.6.0-py_0.tar.bz2
57+
https://repo.anaconda.com/pkgs/main/linux-64/entrypoints-0.3-py37_0.conda
58+
https://conda.anaconda.org/conda-forge/linux-64/future-0.18.2-py37_0.tar.bz2
59+
https://repo.anaconda.com/pkgs/main/linux-64/gast-0.2.2-py37_0.conda
60+
https://repo.anaconda.com/pkgs/main/linux-64/ipython_genutils-0.2.0-py37_0.conda
61+
https://repo.anaconda.com/pkgs/main/noarch/json5-0.8.5-py_0.tar.bz2
62+
https://repo.anaconda.com/pkgs/main/linux-64/kiwisolver-1.1.0-py37he6710b0_0.conda
63+
https://repo.anaconda.com/pkgs/main/linux-64/markupsafe-1.1.1-py37h7b6447c_0.conda
64+
https://repo.anaconda.com/pkgs/main/linux-64/mistune-0.8.4-py37h7b6447c_0.conda
65+
https://repo.anaconda.com/pkgs/main/noarch/more-itertools-8.0.2-py_0.conda
66+
https://repo.anaconda.com/pkgs/main/linux-64/olefile-0.46-py37_0.conda
67+
https://repo.anaconda.com/pkgs/main/linux-64/pandocfilters-1.4.2-py37_1.conda
68+
https://repo.anaconda.com/pkgs/main/noarch/param-1.9.2-py_0.tar.bz2
69+
https://repo.anaconda.com/pkgs/main/noarch/parso-0.5.2-py_0.conda
70+
https://repo.anaconda.com/pkgs/main/linux-64/pickleshare-0.7.5-py37_0.conda
71+
https://repo.anaconda.com/pkgs/main/noarch/prometheus_client-0.7.1-py_0.tar.bz2
72+
https://repo.anaconda.com/pkgs/main/linux-64/ptyprocess-0.6.0-py37_0.conda
73+
https://conda.anaconda.org/conda-forge/linux-64/pymongo-3.10.1-py37he1b5a44_0.tar.bz2
74+
https://repo.anaconda.com/pkgs/main/noarch/pyparsing-2.4.6-py_0.conda
75+
https://repo.anaconda.com/pkgs/main/noarch/pytz-2019.3-py_0.tar.bz2
76+
https://repo.anaconda.com/pkgs/main/linux-64/pyyaml-5.2-py37h7b6447c_0.conda
77+
https://repo.anaconda.com/pkgs/main/linux-64/pyzmq-18.1.0-py37he6710b0_0.conda
78+
https://repo.anaconda.com/pkgs/main/linux-64/qt-5.9.7-h5867ecd_1.conda
79+
https://repo.anaconda.com/pkgs/main/linux-64/send2trash-1.5.0-py37_0.conda
80+
https://repo.anaconda.com/pkgs/main/linux-64/sip-4.19.8-py37hf484d3e_0.conda
81+
https://repo.anaconda.com/pkgs/main/linux-64/six-1.13.0-py37_0.tar.bz2
82+
https://repo.anaconda.com/pkgs/main/linux-64/termcolor-1.1.0-py37_1.conda
83+
https://repo.anaconda.com/pkgs/main/noarch/testpath-0.4.4-py_0.tar.bz2
84+
https://repo.anaconda.com/pkgs/main/linux-64/tornado-6.0.3-py37h7b6447c_0.conda
85+
https://conda.anaconda.org/conda-forge/noarch/tqdm-4.41.1-py_0.tar.bz2
86+
https://repo.anaconda.com/pkgs/main/linux-64/wcwidth-0.1.7-py37_0.conda
87+
https://repo.anaconda.com/pkgs/main/linux-64/webencodings-0.5.1-py37_1.conda
88+
https://repo.anaconda.com/pkgs/main/noarch/werkzeug-0.16.0-py_0.tar.bz2
89+
https://repo.anaconda.com/pkgs/main/linux-64/wrapt-1.11.2-py37h7b6447c_0.conda
90+
https://repo.anaconda.com/pkgs/main/linux-64/absl-py-0.8.1-py37_0.conda
91+
https://repo.anaconda.com/pkgs/main/linux-64/cycler-0.10.0-py37_0.conda
92+
https://repo.anaconda.com/pkgs/main/noarch/google-pasta-0.1.8-py_0.tar.bz2
93+
https://repo.anaconda.com/pkgs/main/linux-64/jedi-0.15.2-py37_0.conda
94+
https://repo.anaconda.com/pkgs/main/linux-64/mkl-service-2.3.0-py37he904b0f_0.conda
95+
https://repo.anaconda.com/pkgs/main/noarch/packaging-20.0-py_0.conda
96+
https://repo.anaconda.com/pkgs/main/linux-64/pexpect-4.7.0-py37_0.conda
97+
https://repo.anaconda.com/pkgs/main/linux-64/pillow-7.0.0-py37hb39fc2d_0.conda
98+
https://repo.anaconda.com/pkgs/main/linux-64/pyqt-5.9.2-py37h05f1152_2.conda
99+
https://repo.anaconda.com/pkgs/main/linux-64/pyrsistent-0.15.6-py37h7b6447c_0.conda
100+
https://repo.anaconda.com/pkgs/main/noarch/python-dateutil-2.8.1-py_0.tar.bz2
101+
https://repo.anaconda.com/pkgs/main/noarch/pyviz_comms-0.7.2-py_0.tar.bz2
102+
https://repo.anaconda.com/pkgs/main/linux-64/setuptools-44.0.0-py37_0.conda
103+
https://repo.anaconda.com/pkgs/main/linux-64/terminado-0.8.3-py37_0.conda
104+
https://repo.anaconda.com/pkgs/main/linux-64/traitlets-4.3.3-py37_0.conda
105+
https://repo.anaconda.com/pkgs/main/noarch/zipp-0.6.0-py_0.tar.bz2
106+
https://repo.anaconda.com/pkgs/main/linux-64/bleach-3.1.0-py37_0.conda
107+
https://repo.anaconda.com/pkgs/main/linux-64/grpcio-1.16.1-py37hf8bcb03_1.conda
108+
https://repo.anaconda.com/pkgs/main/linux-64/importlib_metadata-1.3.0-py37_0.conda
109+
https://repo.anaconda.com/pkgs/main/noarch/jinja2-2.10.3-py_0.tar.bz2
110+
https://repo.anaconda.com/pkgs/main/noarch/joblib-0.14.1-py_0.conda
111+
https://repo.anaconda.com/pkgs/main/linux-64/jupyter_core-4.6.1-py37_0.conda
112+
https://repo.anaconda.com/pkgs/main/linux-64/markdown-3.1.1-py37_0.conda
113+
https://conda.anaconda.org/conda-forge/noarch/networkx-2.4-py_0.tar.bz2
114+
https://repo.anaconda.com/pkgs/main/linux-64/numpy-base-1.17.4-py37hde5b4d6_0.conda
115+
https://repo.anaconda.com/pkgs/main/linux-64/protobuf-3.11.2-py37he6710b0_0.conda
116+
https://repo.anaconda.com/pkgs/main/noarch/pygments-2.5.2-py_0.tar.bz2
117+
https://repo.anaconda.com/pkgs/main/linux-64/wheel-0.33.6-py37_0.tar.bz2
118+
https://repo.anaconda.com/pkgs/main/linux-64/jsonschema-3.2.0-py37_0.conda
119+
https://repo.anaconda.com/pkgs/main/linux-64/jupyter_client-5.3.4-py37_0.conda
120+
https://repo.anaconda.com/pkgs/main/linux-64/pip-19.3.1-py37_0.tar.bz2
121+
https://repo.anaconda.com/pkgs/main/noarch/prompt_toolkit-3.0.2-py_0.tar.bz2
122+
https://repo.anaconda.com/pkgs/main/linux-64/ipython-7.11.1-py37h39e3cac_0.conda
123+
https://repo.anaconda.com/pkgs/main/linux-64/nbformat-4.4.0-py37_0.conda
124+
https://repo.anaconda.com/pkgs/main/linux-64/ipykernel-5.1.3-py37h39e3cac_0.conda
125+
https://repo.anaconda.com/pkgs/main/linux-64/nbconvert-5.6.1-py37_0.conda
126+
https://repo.anaconda.com/pkgs/main/linux-64/notebook-6.0.2-py37_0.conda
127+
https://repo.anaconda.com/pkgs/main/noarch/jupyterlab_server-1.0.6-py_0.tar.bz2
128+
https://repo.anaconda.com/pkgs/main/linux-64/widgetsnbextension-3.5.1-py37_0.conda
129+
https://repo.anaconda.com/pkgs/main/noarch/ipywidgets-7.5.1-py_0.tar.bz2
130+
https://repo.anaconda.com/pkgs/main/noarch/jupyterlab-1.2.4-pyhf63ae98_0.conda
131+
https://repo.anaconda.com/pkgs/main/linux-64/bokeh-1.4.0-py37_0.conda
132+
https://repo.anaconda.com/pkgs/main/linux-64/h5py-2.9.0-py37h7918eee_0.conda
133+
https://repo.anaconda.com/pkgs/main/linux-64/matplotlib-3.1.1-py37h5429711_0.conda
134+
https://repo.anaconda.com/pkgs/main/linux-64/mkl_fft-1.0.15-py37ha843d7b_0.tar.bz2
135+
https://repo.anaconda.com/pkgs/main/linux-64/mkl_random-1.1.0-py37hd6b4f25_0.conda
136+
https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.17.4-py37hc1035e2_0.conda
137+
https://repo.anaconda.com/pkgs/main/noarch/holoviews-1.12.7-py_0.tar.bz2
138+
https://repo.anaconda.com/pkgs/main/noarch/keras-applications-1.0.8-py_0.tar.bz2
139+
https://repo.anaconda.com/pkgs/main/noarch/opt_einsum-3.1.0-py_0.tar.bz2
140+
https://repo.anaconda.com/pkgs/main/linux-64/pandas-0.25.3-py37he6710b0_0.tar.bz2
141+
https://repo.anaconda.com/pkgs/main/linux-64/scipy-1.3.2-py37h7c811a0_0.conda
142+
https://repo.anaconda.com/pkgs/main/noarch/tensorboard-1.15.0-pyhb230dea_0.conda
143+
https://conda.anaconda.org/conda-forge/noarch/hyperopt-0.2.2-py_0.tar.bz2
144+
https://repo.anaconda.com/pkgs/main/noarch/keras-preprocessing-1.1.0-py_1.tar.bz2
145+
https://repo.anaconda.com/pkgs/main/linux-64/patsy-0.5.1-py37_0.conda
146+
https://repo.anaconda.com/pkgs/main/linux-64/scikit-learn-0.22.1-py37hd81dba3_0.conda
147+
https://repo.anaconda.com/pkgs/main/linux-64/keras-base-2.2.4-py37_0.conda
148+
https://repo.anaconda.com/pkgs/main/linux-64/statsmodels-0.10.1-py37hdd07704_0.conda
149+
https://repo.anaconda.com/pkgs/main/linux-64/tensorflow-base-1.15.0-mkl_py37he1670d9_0.conda
150+
https://repo.anaconda.com/pkgs/main/noarch/seaborn-0.9.0-pyh91ea838_1.tar.bz2
151+
https://repo.anaconda.com/pkgs/main/noarch/tensorflow-estimator-1.15.1-pyh2649769_0.conda
152+
https://repo.anaconda.com/pkgs/main/linux-64/tensorflow-1.15.0-mkl_py37h28c19af_0.conda
153+
https://repo.anaconda.com/pkgs/main/linux-64/keras-2.2.4-0.conda

source-code/REEADME.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#| Source code
2+
3+
This is source code that is either used in the presentation, or was developed
4+
to create it. There is some material not covered in the presentation as well.
5+
6+
## Requirements
7+
8+
* Python version: at least 3.7
9+
* Packages (names listed that can be used with `pip` or `conda` to install):
10+
* pandas
11+
* xlrd
12+
* seaborn
13+
* matplotlib
14+
* scipy
15+
* jupyter
16+
* scikit-learn
17+
* keras
18+
* hyperopt
19+
20+
## What is it?
21+
* [`keras`](keras): illustration of using Keras for machine learning.
22+
* [`parameter-optimization`](parameter-optimization): example of parameter
23+
optimization kusing hyperopt, although the examples do not optimize
24+
hyperparameters in machine learning, that would be very similar.
25+
* [`scikit-learn`](scikit-learn): examples of scikit-learn for machine learning,
26+
examples are provided forsupervised (regression and classification) and
27+
unsupervised (clustering) learnign, as well as dimensionality reduction for
28+
visualization of high-demensional data.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.exe
2+
*.pbs.*
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CXX = g++
2+
CXXFLAGS = -fopenmp -std=c++14 -O2 -g -Wall -Wextra
3+
LDLIBS = -lm
4+
5+
all: julia_omp.exe
6+
7+
%.exe: %.o
8+
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDLIBS)
9+
10+
clean:
11+
$(RM) $(wildcard *.exe) $(wildcard *.o)
12+
$(RM) core $(wildcard core.*)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# JuliaJobs
2+
3+
Illustration of optimizing application parameters by running jobs.
4+
5+
## What is it?
6+
7+
1. `julia_omp.cpp`: C++ application that compute the Julia set
8+
fractal, using OpenMP for parallelization. The parallel
9+
for-loop schedule is `runtime`, and hence can be controled
10+
using the `OMP_SCHEDULE` environment variable. Timing
11+
information is writting to standard error.
12+
1. `Makefile`: make file to build the Julia set application.
13+
1. `julia.pbs`: PBS script to run the Julia set applciation
14+
as a job.
15+
1. `julia_optimize.py`: Python script to find optimal OpenMP
16+
schedule, chunk size and number of threads for the Julia set
17+
application.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
#PBS -A lp_sys
3+
#PBS -l pmem=2gb
4+
#PBS -l walltime=00:05:00
5+
#PBS -j oe
6+
7+
cd $PBS_O_WORKDIR
8+
9+
source switch_to_2018a
10+
module load foss
11+
12+
# verify that OpenMP environment variables have been passed
13+
# using -v options
14+
if [[ -z "$schedule" ]]
15+
then
16+
(>&2 echo "### error: OpenMP schedule not set")
17+
exit 1
18+
fi
19+
if [[ -z "$chunk" ]]
20+
then
21+
(>&2 echo "### error: OpenMP chunk not set")
22+
exit 1
23+
fi
24+
25+
OMP_SCHEDULE="${schedule},${chunk}"
26+
(>&2 echo "### info: OMP_SCHEDULE=\'${OMP_SCHEDULE}\'")
27+
28+
if [[ -z "$OMP_NUM_THREADS" ]]
29+
then
30+
(>&2 echo "### error: OpenMP number of threads not set")
31+
exit 2
32+
else
33+
(>&2 echo "### info: OMP_NUM_THREADS=\'${OMP_NUM_THREADS}\'")
34+
fi
35+
36+
# ensure the executable is op to date
37+
make all
38+
if [[ $? -ne 0 ]]
39+
then
40+
(>&2 echo "### error: make failed")
41+
exit 3
42+
fi
43+
44+
# determine time file name
45+
time_file="julia.pbs.time${PBS_JOBID/\.*/}"
46+
47+
# run application on a sufficiently large matrix, disregarding
48+
# output, timing information is writting to a file
49+
for i in $(seq 3)
50+
do
51+
./julia_omp.exe 4096 > /dev/null 2>> "${time_file}"
52+
done

0 commit comments

Comments
 (0)