Thursday Exercise 3 (optional)

From AIMSWiki

(Redirected from Thursday Exercise 3)
Table of contents

Overview

Install an STDSIM server, monitor it and connect to it.

Objective

Be the first to download work units from your own server.

Feedback

Report in your Team Wiki pages how you tried to meet the Objective and what problems you encountered.

Procedure

In http://shrike.aims.ac.za/stdsim-server.tar.gz the code for the server can be found. You may unpack this in any directory, including your home directory.

The following packages are needed to install the STDSIM server: ant, ant-optional, python-dev, python-libxml2, java-gcj-compat-dev (or again, find the installer for the Sun Java compiler (Java Development Kit, JDK).

First make a new project called stdsim_server, as told in previous courses.

A somewhat more extensive documentation is listed in docs/joris-overview-stdsim.odt

Look at the server code

The server you were given has an empty Java program to compute an empty result and making computations using a for loop. You can take a look at the source by looking at src/stdsim/stdsim2.java. This source file will list a few TODOs in the comment (search for TODO) by which you can structure your own program, should you want to. This is the only difference between the real STDSIM server install package and the package you have downloaded.

Other parts of the project are listed in src/make_work/, which includes the work generating daemon we will need later on.

In src/wrapper/ the wrapper from BOINC is written. This is actually very similar (almost completely) to the one you will see when doing

 svn co http://boinc.berkeley.edu/svn/trunk/boinc_samples/wrapper/

the only real difference is that the task struct is put in a new file, task.C.

Then there is the directory src/helper_scripts/ which includes to scripts that proved to be useful to automate small tasks. Look in the source to see the documentation and implementation. These are Bash scripts, so they will only work on Linux. This also means that you can read the source as if someone wrote them into the terminal directly.

Adding daemons to be run

In the project directory you have to add the following daemons to config.xml:

 work_generator -v -d input_dir
 sample_bitwise_validator -d 3 -app stdsim
 sample_assimilator -d 3  -app stdsim
 organize_results -v -d sample_results tmp_organize_results input_dir

Explaination

First we need a work generator. The generator is told to run as a Daemon with -d, which will automatically let it run with BOINC as well. We have specified -v to let it be more Verbose. Then we tell the work generator to look for input files in the input_dir. This directory will be scanned for files every minute.

Then we need a validator to compare results belonging to a single work unit. In the case of STDSIM a bitwise validator is good enough, the differences between the different platforms have no effect on the outcome of STDSIM (as far as we know).

Next, we have to run an assimilator moving canonical results to the directory sample_results. This is good enough as we'll further process the files using our own daemons.

Finally we run organize_results, again, verbose and as a BOINC daemon. It will move results from sample_results to tmp_organize_results and will try to find the input files for the results in the input directory so that they can be put in the same directory.

Install the server

As we use Apache Ant to install, the install file is build.xml. Take a look in this file, and look through the docs/joris-overview-stdsim.odt to see how it's made. In build.xml change the following line

 <property name="project-dir" value="/var/boinc/projects/stdsim"
      description="The place the BOINC server for this project is installed"/>

to point to your project directory.

First look what ant can do with this project with

 ant -p

Ant works with the command line

 ant <command>

Now clean up everything, compile everything and then install all the files

Hint: to install you need root or boincadm rights

Mini-Exercise: describing the app and bin directory

Take a look at the dist/app directory and compare that with the files on the client side in the projects and slots directories. Write the results in your wiki.

Hint: look something up about legacy applications.

Also write a few notes on the dist/bin directory.

Monitoring the server

Follow progress on the STDSIM server by going to the project directory and running

 bin/status

If anything is not runnning do

 vim log_*/<daemon_name>.log

and if everything is running, check

 tail -f log_*/*

To let work units be created, copy the file ctSAH121.rjif to <project_dir>/input_dir. Then run

 tail -f log_*/*

and look at what happens when work_generator notices the file.

Connect!

As a last step connect to your now running server.


Thursday Exercise 2 | BoincExercises | Thursday Exercise 4 (optional)