2015-03-07 16:49:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-03-16 18:51:08 +00:00
|
|
|
make stopvm
|
2018-02-22 21:53:38 +00:00
|
|
|
TMPDIR=${TMPDIR:-/tmp}
|
2015-04-22 23:12:00 +00:00
|
|
|
mkdir -p $TMPDIR
|
2015-03-07 16:49:16 +00:00
|
|
|
# Jobs that eat more than 2 GB RAM
|
2017-11-22 22:29:03 +00:00
|
|
|
|
|
|
|
gendata() {
|
|
|
|
# Generate a lot of text data fast
|
|
|
|
yes "`seq 3000`" | head -c $1
|
|
|
|
}
|
|
|
|
export -f gendata
|
|
|
|
|
|
|
|
perl5.14parallel() {
|
|
|
|
# Run GNU Parallel under perl 5.14 which does not support 64-bit very well
|
2019-07-23 07:00:09 +00:00
|
|
|
# Remove setpgrp_func because 5.14 may use another func
|
|
|
|
rm -f ~/.parallel/tmp/sshlogin/*/setpgrp_func
|
2017-11-22 22:29:03 +00:00
|
|
|
PATH=input-files/perl-v5.14.2:$PATH
|
|
|
|
PERL5LIB=input-files/perl-v5.14.2/lib input-files/perl-v5.14.2/perl `which parallel` "$@"
|
2019-07-23 07:00:09 +00:00
|
|
|
rm -f ~/.parallel/tmp/sshlogin/*/setpgrp_func
|
2017-11-22 22:29:03 +00:00
|
|
|
}
|
|
|
|
export -f perl5.14parallel
|
|
|
|
|
|
|
|
par_2gb_records_N() {
|
|
|
|
echo '### bug #44358: 2 GB records cause problems for -N'
|
2018-11-25 18:06:06 +00:00
|
|
|
echo '5 GB version: Eats 12.5 GB RAM + 4 GB Swap'
|
2017-11-22 22:29:03 +00:00
|
|
|
(gendata 5000MB; echo FOO;
|
|
|
|
gendata 3000MB; echo FOO;
|
|
|
|
gendata 1000MB;) |
|
|
|
|
perl5.14parallel --pipe --recend FOO -N2 --block 1g -k LANG=c wc -c
|
|
|
|
|
|
|
|
echo '2 GB version: eats 10 GB'
|
|
|
|
(gendata 2300MB; echo FOO;
|
|
|
|
gendata 2300MB; echo FOO;
|
|
|
|
gendata 1000MB;) |
|
|
|
|
perl5.14parallel --pipe --recend FOO -N2 --block 1g -k LANG=c wc -c
|
|
|
|
|
|
|
|
echo '### -L >4GB';
|
2018-11-25 18:06:06 +00:00
|
|
|
echo 'Eats 12.5 GB RAM + 6 GB Swap';
|
2017-11-22 22:29:03 +00:00
|
|
|
(head -c 5000MB /dev/zero; echo FOO;
|
|
|
|
head -c 3000MB /dev/zero; echo FOO;
|
|
|
|
head -c 1000MB /dev/zero;) |
|
|
|
|
parallel --pipe -L2 --block 1g -k LANG=c wc -c
|
|
|
|
}
|
|
|
|
|
|
|
|
par_2gb_record_reading() {
|
|
|
|
echo '### Trouble reading a record > 2 GB for certain versions of Perl (substr($a,0,2G+1)="fails")'
|
|
|
|
echo '### perl -e $buf=("x"x(2**31))."x"; substr($buf,0,2**31+1)=""; print length $buf'
|
|
|
|
echo 'Eats 4 GB'
|
|
|
|
perl -e '$buf=("x"x(2**31))."x"; substr($buf,0,2**31+1)=""; print ((length $buf)."\n")'
|
|
|
|
|
|
|
|
echo 'Eats 4.7 GB'
|
|
|
|
(gendata 2300MB; echo ged) |
|
|
|
|
perl5.14parallel -k --block 2G --pipe --recend ged md5sum
|
|
|
|
echo 'Eats 4.7 GB'
|
|
|
|
(gendata 2300MB; echo ged) |
|
|
|
|
perl5.14parallel -k --block 2G --pipe --recend ged cat | wc -c
|
|
|
|
}
|
|
|
|
|
|
|
|
export -f $(compgen -A function | grep par_)
|
|
|
|
compgen -A function | grep par_ | sort |
|
|
|
|
parallel -j1 --tag -k --joblog +/tmp/jl-`basename $0` '{} 2>&1'
|
|
|
|
|
|
|
|
|
|
|
|
make startvm
|