I have some basic questions of calling a Fortran model from GAE.
I uploaded a Fortran77 code to an test Environment, and then compiled it to a .so file using f2py commend. In the following steps, I will need to send input values which come from user inputs by filling a Django powered form on a GAE hosted website. What confused me is that:
-
Since I have already uploaded the complied file to PiCloud, do I still need to publish the library (function?)? If so, how should I do it (import the uploaded library then publish)?
-
How do I execute the function (do the calculation)? For a python function, I can use something like:
“response_val = urlfetch.fetch(url=url_val, method=urlfetch.GET, headers=http_headers)
output_val = json.loads(response_val.content)[‘result’]”
However, there is no “_env=environ_name” model in fetch, so any suggestion?
Thanks in advance and any suggestion is welcomed!
Have you followed the procedure for publishing Python functions in PiCloud?
It should go something like below (assuming that your module is in the Python path and can be imported without problem):
As shown, cloud.rest.publish() will return a URL where you can send your requests or function calls using GAE’s urlfetch.
An example for calling your published function through REST is given in the docs:
Source: PiCloud REST docs: http://docs.picloud.com/rest.html