2010-12-06 23:30:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Assume /dev/shm is easy to fill up
|
|
|
|
mkdir -p /dev/shm/parallel
|
|
|
|
|
|
|
|
echo '### Test $TMPDIR'
|
|
|
|
TMPDIR=/dev/shm/parallel stdout timeout -k 1 6 parallel head -c 2000m '<'{} >/dev/null ::: /dev/zero &
|
2011-08-20 22:39:14 +00:00
|
|
|
seq 1 200 | parallel -j1 "df /dev/shm | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
|
|
|
|
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>; if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n"; exit }'
|
2010-12-06 23:30:08 +00:00
|
|
|
wait
|
2011-08-20 19:13:25 +00:00
|
|
|
sleep 0.1
|
2010-12-06 23:30:08 +00:00
|
|
|
|
|
|
|
echo '### Test --tmpdir'
|
|
|
|
stdout timeout -k 1 6 parallel --tmpdir /dev/shm/parallel head -c 2000m '<'{} >/dev/null ::: /dev/zero &
|
2011-08-20 22:39:14 +00:00
|
|
|
seq 1 200 | parallel -j1 "df /dev/shm | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
|
|
|
|
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>; if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n"; exit }'
|
2010-12-06 23:30:08 +00:00
|
|
|
wait
|
2011-08-20 19:13:25 +00:00
|
|
|
sleep 0.1
|
2010-12-06 23:30:08 +00:00
|
|
|
|
|
|
|
echo '### Test $TMPDIR and --tmpdir'
|
|
|
|
TMPDIR=/tmp stdout timeout -k 1 6 parallel --tmpdir /dev/shm/parallel head -c 2000m '<'{} >/dev/null ::: /dev/zero &
|
2011-08-20 22:39:14 +00:00
|
|
|
seq 1 200 | parallel -j1 "df /dev/shm | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
|
|
|
|
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>; if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n"; exit }'
|
2010-12-06 23:30:08 +00:00
|
|
|
wait
|
2011-08-20 19:13:25 +00:00
|
|
|
sleep 0.1
|