Skip to content

Commit f4cf406

Browse files
missions 13 - 19 parcomp
1 parent b0fe54e commit f4cf406

98 files changed

Lines changed: 2133 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

missions/parcomp/03_firstactualtiming/goal/en.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ The time command will output three measurments:
2121
- sys: CPU time spent by the operating system to run the command
2222

2323
The `user` part will be lower than `elapsed` if the command has
24-
spent some time waiting or sleep, and will be greater than `elapsed`
24+
spent some time waiting or sleeping, and will be greater than `elapsed`
2525
if it used multiple CPUs at the same time. The `sys` part refers to
2626
operations performed in `kernel mode` such as malloc or fread/fwrite.

missions/parcomp/06_xargsserial/goal/en.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ command on each item in the list.
2222

2323
For instance, you can run the following command to see the output.
2424

25-
ls d?.txt | xargs -I {} echo "I found {} here! I repeat. I found {}here!"
25+
ls d?.txt | xargs -I {} echo "I found {} here! I repeat. I found {} here!"
2626

2727
The `-I` argument denotes the place holder that can subsequently be used in the
2828
command passed as argument. Any character sequence can be used, but {} is often

missions/parcomp/07_xargsparallel/goal/en.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ command again.
88
Now run the same line (including the `time`) but add `-P4` as first argument
99
to `xargs` and observe the results.
1010

11-
12-
1311
Useful commands
1412
===============
1513

missions/parcomp/09_fifo/goal/en.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ start.
77

88
Linux actualy allows creating "fake" files that can be written to and
99
read from at the same time. The command that reads is blocked until the
10-
command that writes has writtent a line. This way, both commands can
10+
command that writes has written a line. This way, both commands can
1111
operate at the same time.
1212

13-
To fulfil this mission, create such a file, called a 'fifo' file named
13+
To fulfill this mission, create such a file, called a 'fifo' file named
1414
`tmp.fifo` with the `mkfifo` command and use it instead of the regular
1515
file `tmp.txt` in the previous mission. Make sure to run the first
1616
command *in the background* to allow the second one to start as soon

missions/parcomp/10_pipe/goal/en.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ time { COMMAND1 | COMMAND2 ; }
2121
this will measure the time needed to run both commands in cases
2222
the second command is consuming output from the first one.
2323

24-
mkfifo FILE
25-
creates a "fake" fifo file that can be writtent to and read from
26-
at the same time.
27-
2824
Remarks
2925
-------
3026

missions/parcomp/12_make/goal/en.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Mission goal
22
============
33

4-
For this final mission, we will look at the case where we have both
4+
For this mission, we will look at the case where we have both
55
multiple data files and multiple commands, and we suppose we have
66
to use intermediate files.
77

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
SH_FILES=$(wildcard *.sh)
2+
EXCEPTIONS=
3+
OTHER_FILES=
4+
5+
LANGUAGES=$(wildcard i18n/*.po)
6+
LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES))
7+
SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES))
8+
SORT=--sort-output
9+
OPTIONS=--indent --no-wrap --no-location
10+
11+
all: i18n/en.po $(LANGUAGES)
12+
13+
add-locations: SORT=--add-location --sort-by-file
14+
add-locations: all
15+
16+
i18n/en.po: i18n/template.pot FORCE
17+
@echo "msgen $@"
18+
@msgen $(OPTIONS) $(SORT) i18n/template.pot --output=$@
19+
@echo "# AUTOMATICALLY GENERATED -- DO NOT EDIT" | cat - $@ > $@~
20+
@mv $@~ $@
21+
22+
$(LANGUAGES):%.po: i18n/template.pot FORCE
23+
@echo "msgmerge $@"
24+
@msgmerge --update $(OPTIONS) $(SORT) $@ i18n/template.pot
25+
26+
i18n/template.pot: $(SH_FILES) $(OTHER_FILES) FORCE
27+
@mkdir -p i18n/
28+
@echo "generating i18n/template.pot"
29+
@xgettext --from-code=UTF-8 --omit-header $(OPTIONS) $(SORT) --join-existing --output i18n/template.pot $(SH_FILES) $(OTHER_FILES)
30+
@echo "done"
31+
32+
new: i18n/template.pot
33+
@read -p "language code: " lang; \
34+
[ -e "./i18n/$$lang.po" ] && echo "file i18n/$$lang.po already exists" && exit; \
35+
echo "file i18n/$$lang.po created"; \
36+
msgcat $(OPTIONS) --output i18n/$$lang.po i18n/template.pot
37+
38+
clean:
39+
rm -f i18n/*~
40+
41+
.PHONY: all clean new FORCE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
3+
ml parallel
4+
5+
gsh check
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash -x
2+
3+
4+
5+
6+
if which parallel &>/dev/null
7+
then
8+
true
9+
else
10+
echo "Hum. The `parallel` command cannot be found. Is the module properly loaded?"
11+
false
12+
fi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Mission goal
2+
============
3+
4+
This time, we will look at a command which is not part of the set
5+
of basics Linux commands. Its name is GNU Parallel and is installed
6+
as an environment module on the clusters. The goal of this mission
7+
is to find this module and load it so that the `parallel` program
8+
is avaiable in the command line.
9+
10+
Useful commands
11+
===============
12+
13+
module spider PROGRAM
14+
this command will look for PROGRAM across all software installed
15+
on the cluster. It should already be familiar to any cluster
16+
user. If not, please refer to the CECI documentation, the
17+
CISM/CECI Youtube Channel, or the gameshell/module game.
18+
19+
20+
Remarks
21+
-------
22+
23+
The `parallel` module might not be in the default release, so make
24+
sure to load the correct one before loading the module.

0 commit comments

Comments
 (0)