Wiki
Clone wikisaws / Home
The Scientific Application Web server (SAWs) turns any C, C++, or Fortran scientific or engineering application code into a webserver, allowing one to examine (and even modify) the state of the simulation with any browser from anywhere.
Point your browser to http://petsc.no-ip.org:8080 to see an example of the server in action.
Consider a long running CFD simulation. One could dump information about the state of the simulation to a log file every few minutes and then log into the computer and tail the log file to determine the current state of the simulation. But the log file may not even be up to date because the IO may not have yet been flushed, the log files can become very large with never used information, and the access process is cumbersome. With SAWs one simply registers a few variables in the simulation, for example, current time, time step size, CFL number, and even the solution; then these variables are available in a browser at any time, always with the latest values.
SAWs uses the standard RESTful (http://en.wikipedia.org/wiki/Representational_state_transfer) software architecture for the Web; the same system used by Google, Facebook, etc. SAWs presents a very simple application programing interface (API) for the C, C++, or Fortran in the application code and Javascript in the browser. Bash or Python scripts can also be easily written to interact with SAWs.
--------------------------
| Application code |
| +++++++++ |
---------------------- | + web + |
| Browser | <---- HTTP, JSON --------> server <--> variables|
| HTML and Javascript | | +++++++++ |
---------------------- | |
--------------------------
Sample code:
Serving a variable
SAWs_Initialize();
SAWs_Register("/Current-time",&t,1,SAWs_READ,SAWs_DOUBLE);
// run time integration routine
Accessing the variable
http://hostname:8080/SAWs/Current-time
The users manual may be found at https://bitbucket.org/saws/saws/src/master/doc/manual/SAWs.pdf
See src/SAWs.h for the complete C API of SAWs.
Please use the Issue tracker (https://bitbucket.org/saws/saws/issues) to report any problems with SAWs or to ask for help or clarification on its usage.
SAWs uses the open source Mongoose (http://code.google.com/p/mongoose/) as its embedded webserver and cJSON (http://sourceforge.net/projects/cjson) for parsing the JSON.
SAWs is developed by Matt Otten, Jed Brown, and Barry Smith at Argonne National Laboratory. SAWs is loosely based on the ALICE Memory Snooper (AMS) developed by Ibrahima Ba and Barry Smith in 1999.
Updated