Caching units on a Linux system
[b]Originally posted by MrTFWitt [/b]
Create an account for seti processing if you havent done so already.
Either use linuxconf or the following lines will do it
groupadd seti
useradd -g seti -d /home/seti -s /bin/ksh -c “Seti User” -m seti
passwd seti
The next thing to do is put the setiathome binary in the right place
cp setiathome ~seti
If you have already run seti on this system you will have a user_info.sah.
copy that into the same directory
cp user_info.sah ~seti
If not you will have to do a login as a returning user to create one
su - seti
./setiathome -login
Right so thats a userid and a working install of seti, now we need to create the cache and leech some units.
Setup script:
#!/bin/bash
cd ~seti
if [ ! -f setiathome -o ! -f user_info.sah ]
then
echo expected to find setiathome and user_info.sah in this directory
exit 1
fi
Proxy=www.adventurevision.com:5517
Clients=20
i=0
while [ "$Clients" -gt "$i" ]
do
dirname=`echo $i|awk '{printf("sc%2.2d",$1)}'`
if [ -d ~seti/$dirname ]
then
if [ ! -f ~seti/$dirname/work_unit.sah ]
then
cd ~seti/$dirname
../setiathome -stop_after_xfer -proxy $Proxy
fi
else
echo Creating ~seti/$dirname
mkdir ~seti/$dirname
cp user_info.sah ~seti/$dirname
cd ~seti/$dirname
../setiathome -stop_after_xfer -proxy $Proxy
fi
i=`expr $i + 1`
done
Cut and paste the above into a file
save the file as setup and type chmod u+x setup to set the execute bit.
There are a couple of lines you can change
Proxy= If you are on NTL pick a proxy that lets you see Berkeley !
Clients= 99 is the maximum unless you change the awk statement.
Now your cache is chocka with units its time for some crunching.
Cut and paste the following into a file called runit saved in the seti users directory
#!/bin/bash
cd ~seti
while :
do
for unit in `find . -name work_unit.sah`
do
cd `dirname $unit`
echo Starting on `pwd`
~seti/setiathome -stop_after_process
cd ~seti
done
sleep 10
done
then type chmod u+x runit
Launch this with nohup ./runit & and it will keep running after you logoff.
To run at boot time add the following to /etc/rc.local
su - seti -c “nohup /home/seti/runit &”
Uploading units can be done with this snippet
#!/bin/bash
cd ~seti
Proxy=www.adventurevision.com:5517
for unit in `find . -name result.sah`
do
cd `dirname $unit`
echo Sending `pwd`
~seti/setiathome -stop_after_xfer -proxy $Proxy
cd ~seti
done
Right those that are still awake will be asking about progress checking. This will tell you a bit more detail on completed units and time per unit. Nowt flash as laziness was setting in when I did this bit.
#!/bin/ksh
for file in `find . -name state.sah` `find . -name wtemp.sah`
do
cpu=`grep "^cpu=" $file |cut -d "=" -f2|cut -d"." -f1`
prog=`grep "^prog=" $file |cut -d "=" -f2`
if [ ! -z ${cpu} ]
then
time=$cpu
hours=`expr $time / 3600`
time=`expr $time - \( 3600 \* $hours \)`
mins=`expr $time / 60`
time=`expr $time - \( 60 \* $mins \)`
secs=$time
timestring=`echo $hours $mins $secs |awk '{printf("%2.2d:%2.2d:%2.2d
",$1,$2,$3 )}'`
echo $file $timestring $prog
fi
done
All feedback welcome, I’ve tested most of this but not from square one on a clean build like many of you will be doing.
Oh and I used Redhat 7.2 with the INSTALL EVERYthing button selected.