Header Ads Widget

Ab initio Calculations Using Exciting Code

Last Posts

10/recent/ticker-posts

Setup a Calculation Service (Lithium version)

 web.png

The calculation service consists of an simple HTTP server that can receive the commands from an exciting@web server and start the calculation in a job manager.

The server itself is a python script: webserver.py. When you launch it, it will just tell you that it has started the server and the port where it is reachable. When the server receives a POST request from the exciting@web client, it will try to execute the exciting program with the requested input data by calling the startcalc.sh shellscript. This script merely tries to change into the calculation directory created by webserver.py and submit the job with the use of an queuing system, e.g., torque.

#!/bin/bash 
cd $1
qsub -e stderr -o stdout ../torquejob.sh > job

You may use this example torquejob.sh

This is enough to start jobs, but we also want to be able to survey the job remotely. The getstatus script is called by webserver.py when the client requests the job status. This small script gets the jop ID of the requested calculation and queries the job management system for its status. This status is displayed on the jobs page of exciting@web. The other services available via webserver.py include getting the info.xml, download the results, and delete the data on the server.

The getstatus script must be executable ((chmod 755) and it is dependent on the specifics of the queuing system.

HTTP API

These are the commands the calculation service understands

command HTTP request
start calculation POST input.xml content to http://$host:$port/$sha1hash(input.xml)/ returns: POST OK
get info.xml GET http://$host:$port/$sha1hash(input.xml)/ returns: content of info.xml
get status GET http://$host:$port/$sha1hash(input.xml)/status returns: XML with job status
get sdtout stderr GET http://$host:$port/$sha1hash(input.xml)/stdout returns: XML files list with stdout and sdterr
get results GET http://$host:$port/$sha1hash(input.xml)/import returns: XML files list with all xml data
delete GET http://$host:$port/$sha1hash(input.xml)/delete returns: error code

Security

It is maybe important o note hat this version of the webserver.py includes no authentication mechanism. A mechanism for using an API key is provisioned in the exciting@web client but currently not checked by this server. Usually the service should be used in a trusted environment, or access should be restricted by other means (firewall).

 

http://exciting.wikidot.com/setup-a-calculation-service 

Post a Comment

0 Comments