Commits

stevejb committed 12e5078

mostly about making numerical_diff_fps_runner work with solve_isC-icpc

Comments (0)

Files changed (4)

partial_derivative/numerical_diff_fps_runner.py

 
 ##################################################
 ## CONSTANTS 
-H = 0.0001
+H = 0.00000000001
 ##################################################
 
 import os
+import sys
+sys.path.append(os.getcwd())
+
 import optparse
 import uuid
 from OrderedDict import * 
 ##################################################
 
 ### this is a custom tailored function
-def getMomentForAllPoints(uuid, moment):
+def getMomentForAllPoints(uuid, moment, CSV_POSTFIX):
     PTS_LIST = ['point-A', 'point-B', 'point-C', 'point-D']
-    IFEXT = '___results.csv'
+    IFEXT = CSV_POSTFIX
     
     outdict = OrderedDict()
-
+    print("getMomentForAllPoints")
     for pt in PTS_LIST:
         pttmp = uuid + "_" + pt + IFEXT
         fo = open(pttmp, 'r')
+        print("OPENING: " + pttmp + " and looking for " + moment)
+
         for line in fo:
             lineAry = line.split(",")
             if lineAry[0] == moment:
                 outdict[pt] = float(lineAry[1])
+                print("FOUND IT!")
         fo.close()
 
     return outdict
 parser.add_option('-m', help='specify a comma-separated list of output moments', dest='momentNameList')
 parser.add_option('-e', help='specify an executable name', dest='EXECNAME')
 parser.add_option('-o', help='specify an output file (CSV) [REQUIRED]', dest='ofile')
+parser.add_option('-d', help='specify ddw mode', dest='ddwmode')
 (opts, args) = parser.parse_args()
 ##################################################
 
+ddwmode = False
+if opts.ddwmode:
+    ddwmode = True
+    print("DDW MODE ON")
+
+
 paramNameList = opts.paramNameList
 xvec = opts.xvec
 momentList = opts.momentNameList
 EXECNAME = opts.EXECNAME
 ofile = opts.ofile
+ofile += "_Htiny_.csv"
 
 # paramNameList = "a,b"
 # xvec = "1.5,3.0"
 # momentList = "mean,var"
 # EXECNAME = "testpoly"
-CSV_POSTFIX = "results.csv"
+CSV_POSTFIX = "___--tr--fs-moments2.csv"
+if ddwmode:
+    CSV_POSTFIX = "___--trans-only--fs-moments2.csv"
 UUID_PREFIX = "RESULTS"
+SOLVER_EXTRAS = "--log_gamma --log_sigma_v"
 
 ##################################################
 
         exec_detailed += " --uuid_i='" + ugkey_pt + "'"
     
         exec_full = exec_base_str + exec_detailed
+        if ddwmode:
+            exec_full += " --add_ddw='1' --do_smm_for_ddw"
+        exec_full += " " + SOLVER_EXTRAS
         execStrDict[ugkey_pt] = exec_full
 
 
 count = 0        
 for run_this_string in execStrDict.values():
     print(str(count) + ":  About to run: " + run_this_string)
+    count += 1
+
+count = 0        
+for run_this_string in execStrDict.values():
+    print(str(count) + ":  Running: " + run_this_string)
     subprocess.check_output(run_this_string, shell=True)
+    count += 1
 
-exit
+
 
 
 ##
 ##
 
 for esd in execStrDict.keys():
-    rfile = esd + "___results.csv"
+    rfile = esd + CSV_POSTFIX
     if os.path.exists(rfile):
         print "Found: " + rfile
     else:
 
     udict = OrderedDict()
 
+    print("POPULATING UDICT")
     ## populate udict such that I can do udict[moment][point-{A,B,C,D}
     for mm in range(len(momentAry)):
         moment_tmp = momentAry[mm]
-        udict[moment_tmp] = getMomentForAllPoints(ugkey_tmp, moment_tmp)
+        udict[moment_tmp] = getMomentForAllPoints(ugkey_tmp, moment_tmp, CSV_POSTFIX)
+        print(str(udict[moment_tmp]))
 
     ## calculate the moments
     for mm in range(len(momentAry)):

siman_solve/Makefile

 # Loader flags
 LDADD=-lm -lgsl -lgslcblas
 
-all:	siman_solve nm_solve nm_solve_smmddw nm_solve_smmddw_loggamma nm_solve_d11 nm_solve_lgll_d15 nm_solve_lgll_d13 nm_solve_lgll_d11 nm_solve_smmddw_loggamma_d13 nm_solve_smmddw_loggamma_d15
+all:	siman_solve nm_solve nm_solve_smmddw nm_solve_smmddw_loggamma nm_solve_d11 nm_solve_lgll_d15 nm_solve_lgll_d13 nm_solve_lgll_d11 nm_solve_smmddw_loggamma_d13 nm_solve_smmddw_loggamma_d15 nm_solve_smmddw_loggamma_d11
 
 siman_solve:	siman_solve.o
 	gcc -o siman_solve siman_solve.o -L/usr/local/lib -lm -lgsl -lgslcblas
 	gcc -o nm_solve_smmddw_loggamma_d15 nm_solve_smmddw_loggamma_d15.o -L/usr/local/lib -lm -lgsl -lgslcblas
 
 nm_solve_smmddw_loggamma_d15.o:	nm_solve_smmddw_loggamma_d15.c
+
+nm_solve_smmddw_loggamma_d11:	nm_solve_smmddw_loggamma_d11.o
+	gcc -o nm_solve_smmddw_loggamma_d11 nm_solve_smmddw_loggamma_d11.o -L/usr/local/lib -lm -lgsl -lgslcblas
+
+nm_solve_smmddw_loggamma_d11.o:	nm_solve_smmddw_loggamma_d11.c

siman_solve/runscript_ddw_dataq_lslg_s2.sh

File contents unchanged.
 
         case 'h':
           par.rho = strtod(optarg, NULL);
+	  if(par.rho < 0.0) {
+	    par.rho = par.rho * -1.0;	    
+	  }
           // cout << "RHO: " << par.rho << endl;
           break;