You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _episodes/00-environment-modules.md
+20-17Lines changed: 20 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ When Lola sits down to tackle her next project, she wants to get a feeling on wh
27
27
~~~
28
28
$ python3
29
29
~~~
30
-
{: .bash}
30
+
{: .language-bash}
31
31
32
32
~~~
33
33
bash: python3: command not found
@@ -55,7 +55,7 @@ Lena demonstrates that inside the folder where `fdate` was unzipped, it can be e
55
55
~~~
56
56
$ ./fdate
57
57
~~~
58
-
{: .bash}
58
+
{: .language-bash}
59
59
60
60
~~~
61
61
-----------------------------
@@ -69,7 +69,7 @@ However, when omitting the leading `./`, the command doesn't work anymore.
69
69
~~~
70
70
$ fdate
71
71
~~~
72
-
{: .bash}
72
+
{: .language-bash}
73
73
74
74
~~~
75
75
bash: fdate: command not found...
@@ -85,7 +85,7 @@ What is likely to happen in a good library: a sign will be put up which tells a
85
85
~~~
86
86
$ echo ${PATH}
87
87
~~~
88
-
{: .bash}
88
+
{: .language-bash}
89
89
90
90
which may yield something along the lines of:
91
91
@@ -101,7 +101,7 @@ To proceed and make `/home/lola/from_lena/fdate` available to `PATH`, Lena shows
101
101
~~~
102
102
$ export PATH=${PATH}:/home/lola/from_lena/
103
103
~~~
104
-
{: .bash}
104
+
{: .language-bash}
105
105
106
106
As you can see only directories (not paths to files) are added to `PATH` (similar to the example above where only signs to the fantasy corner and not to Harry Potter V are put up).
107
107
@@ -112,7 +112,7 @@ As you can see only directories (not paths to files) are added to `PATH` (simila
112
112
> ~~~~~
113
113
> $ export PATH=/home/lola/from_lena/:${PATH}
114
114
> ~~~~~
115
-
> {: .bash}
115
+
> {: .language-bash}
116
116
>
117
117
> This means though that you have trust, that `/home/lola/from_lena/` does not contain applications which would shadow applications which are already accessible through `PATH`.
118
118
>
@@ -155,7 +155,7 @@ As you can see only directories (not paths to files) are added to `PATH` (simila
155
155
> $ cd /tmp
156
156
> $ ls
157
157
> ~~~~~
158
-
> {: .bash}
158
+
> {: .language-bash}
159
159
>
160
160
> > ## Solution
161
161
> > `fdate.zip` can be downloaded from [here]({{ page.root }}/code/02_parallel_jobs/fdate.zip).
@@ -172,7 +172,7 @@ $ fdate
172
172
$ cd /tmp
173
173
$ fdate
174
174
~~~
175
-
{: .bash}
175
+
{: .language-bash}
176
176
177
177
~~~
178
178
-----------------------------
@@ -191,7 +191,7 @@ To have a look, what software is available through the `module` system, a user i
@@ -206,7 +206,7 @@ The structure of each entry is usually the same `<software>/<version>`, where `s
206
206
~~~
207
207
$ module load python/3.6.5
208
208
~~~
209
-
{: .bash}
209
+
{: .language-bash}
210
210
211
211
~~~
212
212
python version 3.6.5 for x86_64 architecture loaded.
@@ -218,7 +218,7 @@ The exact content of the above differs from system to system and depends on how
218
218
~~~
219
219
$ python --version
220
220
~~~
221
-
{: .bash}
221
+
{: .language-bash}
222
222
223
223
~~~
224
224
Python 3.6.5
@@ -233,7 +233,7 @@ Python 3.6.5
233
233
> ~~~
234
234
> $ python --version
235
235
> ~~~
236
-
> {: .bash}
236
+
> {: .language-bash}
237
237
>
238
238
{: .callout }
239
239
@@ -242,14 +242,14 @@ The real hallmark of the module system comes with the facility to switch off app
242
242
~~~
243
243
$ module unload python/3.6.5
244
244
~~~
245
-
{: .bash}
245
+
{: .language-bash}
246
246
247
247
When one tries again now, the above mentioned effect is gone again:
248
248
249
249
~~~
250
250
$ python --version
251
251
~~~
252
-
{: .bash}
252
+
{: .language-bash}
253
253
254
254
~~~
255
255
Python 2.7.15
@@ -259,12 +259,15 @@ Python 2.7.15
259
259
260
260
> ## The others do it too
261
261
>
262
-
> The idea of programmatically changing the environment of a running terminal is offered by many other software stacks. In the python eco system, `virtualenv` is a prime example. of such. From the [`virtualenv` docs](https://virtualenv.pypa.io/en/stable/userguide/#activate-script):
262
+
> The idea of programmatically changing the environment of a running terminal
263
+
> is offered by many other software stacks. In the python eco system,
264
+
> `virtualenv` is a prime example. of such. From the [`virtualenv`
> "... This will change your $PATH so its first entry is the virtualenv’s bin/ directory. (You have to use source because it changes your shell environment in-place.)"
[serial version] pi is 3.141728 from 50000000 samples
147
147
Wrote profile results to serial_numpi_annotated.py.lprof
148
148
~~~
149
-
{: .language-bash}
149
+
{: .language-bash}
150
150
151
151
You can see that the profiler just adds one line to the output, i.e. the last line. In order to view, the output we can use the `line_profile` module in python:
152
152
@@ -358,6 +358,8 @@ So this is a prime candidate for acceleration.
358
358
> > 48 else:
359
359
> > 49 sys.exit(1)
360
360
> > ~~~~~
361
+
> > {: .output}
362
+
> >
361
363
> > The `word_count` function takes the longest time. Inside it, `re.split` hogs runtime the most.
Copy file name to clipboardExpand all lines: setup.md
+19-10Lines changed: 19 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,45 @@ permalink: /setup/
6
6
7
7
## Software requirements
8
8
9
-
Please bring your laptop to the course. Your laptop should have a program called `ssh` or any clients thereof installed and ready for use.
9
+
Please bring your laptop to the course. Your laptop should have a program
10
+
called `ssh` or any clients thereof installed and ready for use.
10
11
11
12
### Linux
12
13
13
-
Please make sure that ssh is in your PATH or to install ssh with your distribution's package manager (like xterm, terminal, konsole, etc. available as well).
14
+
Please make sure that ssh is in your PATH or to install ssh with your
15
+
distribution's package manager (like xterm, terminal, konsole, etc. available
16
+
as well).
14
17
15
18
### macOS / OS X
16
19
17
-
`ssh` is typically preinstalled, however be sure to have a terminal program (like e.g. [`iTerm`](https://www.iterm2.com/) available as well).
20
+
`ssh` is typically preinstalled, however be sure to have a terminal program
21
+
(like e.g. [`iTerm`](https://www.iterm2.com/) available as well).
18
22
19
23
### Windows
20
24
21
-
It depends on your version of windows how and if you have to install a terminal and/or a ssh client. Typically, [putty](http://www.putty.org), [bitvise SSH](https://www.bitvise.com/ssh-client-download) or [mRemoteNG](https://mremoteng.org/) are a good choices.
25
+
It depends on your version of windows how and if you have to install a terminal
26
+
and/or a ssh client. Typically, [putty](http://www.putty.org), [bitvise
27
+
SSH](https://www.bitvise.com/ssh-client-download) or
28
+
[mRemoteNG](https://mremoteng.org/) are a good choices.
22
29
23
30
24
31
## Logging in
25
32
26
33
In this lesson, we will be working on the command-line on a remote computer.
27
-
This means that the commands we enter into the command-line will be run
28
-
on a different computer than our laptop/workstation.
34
+
This means that the commands we enter into the command-line will be run on a
35
+
different computer than our laptop/workstation.
29
36
30
-
The first step will be to connect to this computer.
31
-
This is known as a remote login.
37
+
The first step will be to connect to this computer. This is known as a remote
38
+
login.
32
39
33
40
If you run Mac OS X or any other Unix-based operating system on your machine,
34
41
you can log in remotely by opening a terminal and using the `ssh` command:
35
42
36
43
~~~
37
44
$ ssh username@{{ site.workshop_login_host }}
38
45
~~~
46
+
{: .language-bash}
39
47
40
-
Make sure to change `username` to the username you will have on the remote machine. Also, please change `{{ site.workshop_login_host }}` to what your instructors tells you.
41
-
48
+
Make sure to change `username` to the username you will have on the remote
49
+
machine. Also, please change `{{ site.workshop_login_host }}` to what your
0 commit comments