-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·39 lines (33 loc) · 821 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·39 lines (33 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
counter=0
COUNT="$1"
cores=$(($COUNT + 1))
declare -r HEX_DIGITS="0123456789ABCDEF"
if [ $# -eq 1 ]; then
while [ $counter -lt "$1" ]
do
# získame randomně čislo
dec_value=$(((RANDOM % 255) + 1))
hex_value=""
# převod s DEC do HEX
until [ $dec_value == 0 ]; do
rem_value=$((dec_value % 16))
dec_value=$((dec_value / 16))
hex_digit=${HEX_DIGITS:$rem_value:1}
hex_value="${hex_digit}${hex_value}"
done
# pišeme náhodná čisla do souboru
echo -n -e "\\x${hex_value}" >> ./numbers
counter=$(($counter + 1))
done
else
echo "Must be only 1 parametr - count of numbers to create"
exit 0
fi
# překlad s zdrojaku
mpicc --prefix /usr/local/share/OpenMPI -o es es.c
# spusteni
mpirun --prefix /usr/local/share/OpenMPI -np $(($cores)) es
# úklid
rm -f es
rm -f ./numbers