ABOUT GPUVerifyRise4Fun 
This is a python based web service that interacts with Microsoft's Rise4Fun[1] 
online tool platform to allow use of the GPUVerify tool.

DEPENDENCIES

- Python 2.7.*
- Flask >=0.10
- Tornado >= 3.1
- psutil >= 1.0.1
- GPUVerify (development or deployed version)

You can get hold of Flask and tornado by running

$ pip install flask 
$ pip install tornado
$ pip install psutil

You may want to use the virtualenv python package to isolate these dependencies
from the rest of your system.

CONFIGURATION

A template file "config.py.template" is provided. You should copy this to
"config.py" and edit this. This "config.py" is not under version control allowing
different users to have different configurations without conflict.

You need to set the paths in config.py approapriately for your configuration.
These should be absolute paths.

RUNNING

GPUVerifyRise4Fun has two different servers. A development web server (built in
Flask development server) and a production (Tornado) web server.

To use the development web server run

$ python webservice.py 

To use the production web server run

$ python production_server.py

To see each server's options use "--help" as the first argument.

EDITING/ADDING SAMPLES

CUDA kernels live in cuda/samples and OpenCL kernels live in opencl/samples.
Feel free to edit these. Please note the server will need to be restarted for
the changes to be detected.

To add new kernels just add a kernel with the right file extension to the
correct directory and restart the server and they will be detected.

ADDING/EDITING TUTORIALS

Tutorials for CUDA live in cuda/tutorial and tutorials for opencl live in
opencl/tutorial. Each tutorial should be placed in its own folder along with any
example kernels used in the tutorial.

Running as a service
The "service/" folder contains scripts for integrating GPUVerifyRise4Fun into
a linux service manager like upstart (COMPLETE) or systemd (TODO)

OBSERVERS

The GPUVerifyRise4Fun service implements the observer design pattern that
allows observers to be notified about the results of executing a kernel.
This could be used for example to save a kernel that causes GPUVerify to
crash.

To implement an observer do the following

1. Add a <your_observer>.py file to observers/ . Inside this file you should
   implement a class that descends from gvapi.GPUVerifyObserver that implements
   the receive(...) method

2. In webservice.py import your observer (e.g. import observers.Example)
3. Register your observer with the tool inside the init() function using
   the _tool.registerObserver() method.

An example is provided (observers/example.py) but is commented out in webservice.py
