--- a/src/HOL/Library/Sum_Of_Squares/neos_csdp_client Tue Sep 08 09:57:33 2009 +0200
+++ b/src/HOL/Library/Sum_Of_Squares/neos_csdp_client Tue Sep 01 11:19:49 2009 +0200
@@ -9,9 +9,10 @@
NEOS_HOST="neos.mcs.anl.gov"
NEOS_PORT=3332
+neos=xmlrpclib.Server("http://%s:%d" % (NEOS_HOST, NEOS_PORT))
+
jobNumber = 0
password = ""
-neos = None
inputfile = None
outputfile = None
# interrupt handler
@@ -34,8 +35,6 @@
sys.stderr.write("Usage: neos_csdp_client <input_filename> <output_filename>\n")
sys.exit(19)
-neos=xmlrpclib.Server("http://%s:%d" % (NEOS_HOST, NEOS_PORT))
-
xml_pre = "<document>\n<category>sdp</category>\n<solver>csdp</solver>\n<inputMethod>SPARSE_SDPA</inputMethod>\n<dat><![CDATA["
xml_post = "]]></dat>\n</document>\n"
xml = xml_pre
@@ -74,9 +73,9 @@
if len(result) > 1:
solution = result[1].strip()
if solution != "":
- output = open(sys.argv[2],"w")
- output.write(solution)
- output.close()
+ outputfile = open(sys.argv[2],"w")
+ outputfile.write(solution)
+ outputfile.close()
# extract return code
p = re.compile(r"^Error: Command exited with non-zero status (\d+)$", re.MULTILINE)