SETIView/2 Cache


SETIView/2 Cache is SETI@Home work unit caching program for OS/2.


Contents


Description

I have a modem connection to the Internet. And my system was taking about 25 hours to process a work unit. This lead to a lot of slack time as it might complete a work unit in the middle of the night and not get a new one until I connected when I returned from work the next night. Then I saw some Windows based cache programs. One was a set of batch files that I thought could be run under OS/2. But, when I looked at them, I thought they were too complicated. So I decided to write my own. It started simple, but now it's probably as complicated as the ones I rejected!

The features of SVCache are:

As to the name: this doesn't have any real relation to my SETIView/2 program. But, I decided to keep the same "brand". I am intending to add a "cache" view to SETIView/2, but that will take a bit of time.


Prerequesites


Installation

The installation and configuration is manual. Here are the steps:

  1. Create a directory that will be the parent for the cache directories.
  2. Create a subdirectory for each work unit to be cached.
  3. Create a file called "SVCACHE.OK" in each subdirectory that will hold a work unit.
  4. Copy the "user_info.sah" file into each subdirectory. If you don't do this, the first time that SVCBuf.CMD is run, you will be prompted for the email address to be used to retrieve work units from the SETI@Home server
  5. If you have an existing incomplete work unit, copy it into one of the subdirectories.
  6. Put the programs in either the PATH or the cache parent directory.
  7. Modify the programs according to the configuration section.
  8. Make sure you have HOSTNAME set in your CONFIG.SYS. If you are running this on multiple machines using the same cache directories, make sure this is unique for each machine.

Optional: Create program objects for SVCRun.CMD and SVCBuf.CMD. Or arrange for these to be run automatically. SVCBuf.CMD needs to be run when you are connected to the Internet.


Configuration

At the moment configuration is pretty bad. It has to be done by modifying the REXX programs. At the top of each program, there are some variables to be set. These follow the line:

/* Customise here */

The changes are to be put inside the double quotation marks.

In SVCRun.CMD and SVCBuf.CMD the changes needed are:

SVCBuf.CMD also has the following:


Usage

To run SVCache, change to the cache parent directory and:

SVCache.* Files

There are some special files used in the cache directories:

How It Works

There are two parts to running SVCache - processing the work units and processing the cache.

Processing The Work Units

When SVCRun.CMD is run, it will:

  1. Scan through all subdirectories for a work unit to process.
  2. Creates the SVCache.HOST. The machines hostname and operating system is recorded in the file.
  3. Process the work unit until it is finished or CTRL-C is pressed.
  4. Update SVCACHE.HOST to remove the hostname. This allows another machine to process the work unit if it isn't finished.
  5. Wait 30 seconds before restarting this process. If you want to stop SVCRun completely, press CTRL-C before the 30 seconds is up.

SVCRun chooses a work unit that meets these rules:

  1. An SVCACHE.HOST file exists, and its hostname and operating system are the same as for the current machine.
  2. The work unit that has been processed the most. This is determined from the state.sah file.
  3. The oldest work unit. This is based on the file "work_unit.sah".

The file SVCache.HOST records:

Returning and Fetching Work Units

The other part in running SVCache is returning completed work units and fetching new ones. This is done by SVCBuf. When it is started it:

  1. Waits the amount of time specified in the variable start_delay.
  2. Changes to a subdirectory.
  3. Checks if one of the files SVCache.OK, SVCache.STOP or SVCache.START exist in the directory. If none of them are there, the directory is not processed, and SVCBuf proceeds to the next directory.
  4. If one of the files exist, SVCBuf looks to see if the file RESULTS.SAH exists. If it does, the work unit has been completed and is to be returned.
  5. If the file SVCache.STOP exists, this means that once the current work unit is complete. SVCBuf will create a file called stop_after_send.txt. This tells SETI@Home not to retrieve a new work unit after returning the current one.
  6. If SVCache.START exist, then a new work unit is to be retrieved for this directory. This generally means a directory is being added to the cache.
  7. If SVCache.OK exists, SVCBuf checks for SETI@Home work unit files. If they don't exist, a new work unit will be retrieved.
  8. Depending in the status found in the previous steps, SVCBuf runs SETI@Home to return the completed work unit and retrieve a new. This is run with the parameter -stop_after_xfer so that the new work unit will not be processed.
  9. After running SETI@Home, SVCBuf deletes the SVCache.HOST file.
  10. SVCBuf then moves on to the next directory.

Sharing Work Units Between Machines

A work unit can be processed by more than one machine as long as they:

This means that if you have more than one OS/2 machine, they can process the work units from the same cache. And if you shutdown one of them, the others can finish processing the work unit.

To completely enable this, I run SVCRun.CMD REMOVEHOSTNAMEon my part-time OS/2 machine when shutting it down. This removes the hostname from the SVCache.HOST file. It is run from the XShutdown folder in XWorkPlace.

SETILog2.CMD

SETILog2.CMD is used to log the results of a processed work unit in a file to matche the format produced by SETILog. This is a CSV file that can be loaded into a spreadsheet or SETIWatch. SETILog2.CMD will also store the result, user_info and state SAH files for later examination.

SETILog2.CMD will take the following parameters:

Note: SETIWatch and SETILog are Windows programs to monitor and log SETI@Home work units. They are available from SETIWatch home page.

Running Under Windows

SVCache has been tested to run under Windows 2000 using the Regina Rexx interpreter. Version 3.0 beta was used. It should run correctly under any version of Windows that Regina supports, and that can run Windows command line SETI@Home client.

To use SVCache under Windows, you will need:

You will need to install the two packages according to the instructions at the above web-sites or inside the packages and verify they are working. Then, running SVCache is the same as running it under OS/2, except that the programs are run through the Regina interpreter. So they must be run with a command like:

REGINA SVCRun.CMD

Note: I've done just enough with Regina to get this working on my laptop under Windows 2000. If you have any problems, I will see what I can do, but, if the problem is in Regina, I probably won't be much help.

Hints


Other Stuff

Future Enhancements

Known Problems

None!

Bug Reporting

If you find any bugs, please tell me at the contact address below. Tell me:

Version History

Note: This is a release history. Each file also has a change history included in the block comment at its start.

Copyright

Except for SETILog2.CMD, this is Copyright (c) 2001-2002 David Forrester. All rights reserved.

SETILog2.CMD is based on someone elses work. But, I've lost all references to who this is. If it's yours, please tell me and I'll either remove it, or, give you the appropriate recognition.

WARNING!

This software is provided as is. No warranty is given by the author, expressed or implied. Use this software at your own risk. The author assumes no responsibility for any damage from the use of this software.

This software is freeware which means that it is free for use and distribution.

Contacts

If you find any bugs, have any suggestions or simply want to say how wonderful or terrible SVCache is, drop me an e-mail

Author: David Forrester
e-mail: davidfor@terrigal.net.au
www: OS2World web site