Clone wiki

saws / 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 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 ( 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

        // run time integration routine

 Accessing the variable


The users manual may be found at

See src/SAWs.h for the complete C API of SAWs.

Please use the Issue tracker ( to report any problems with SAWs or to ask for help or clarification on its usage.

SAWs uses the open source Mongoose ( as its embedded webserver and 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.