Skip to content

Commit

Permalink
read files
Browse files Browse the repository at this point in the history
  • Loading branch information
womullan committed Oct 17, 2023
1 parent 6179a2a commit 28910e9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
19 changes: 19 additions & 0 deletions summittests/readFile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# just read the file noop
# see https://github.com/lsst-dm/s3daemon/blob/main/README.md


if [ $1 ]
then
f="$1"
else
echo "Specify file "
exit 1
fi

start=`date +%s`
while IFS= read -r line
do
: # nothing
done <"$f"
end=`date +%s`
echo Reading $f `expr $end - $start` seconds
38 changes: 38 additions & 0 deletions summittests/readTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Simple read 20 files each in own thread for a node for camera
# this is just to see the times for the read as opposed to send
# see https://github.com/lsst-dm/s3daemon/blob/main/README.md


source envvars.sh
source venv/bin/activate



repeat=2
if [ $1 ]
then
repeat="$1"
fi
echo "Just read repeat $repeat"

files=`ls ~tonyj/Test/MC*/* | head -${count}`

fcount=0
l=0

while [[ l -le repeat ]]
do
l=$((l + 1))
for f in $files; do
key=`echo $f | cut -d'/' -f6 | sed 's/.fits//g'`

./readFile.sh $f &

fcount=$((fcount + 1))
if [ $((fcount % 20)) == 0 ]
then
sleep 20s
echo "Sleeping"
fi
done
done
Empty file removed summittests/sed
Empty file.

0 comments on commit 28910e9

Please sign in to comment.