Commit ac54faf9 authored by jclamber's avatar jclamber
Browse files

add unsio db to g3cpu_parse

git-svn-id: http://svn.oamp.fr/repos/uns_projects/trunk@112 f264a43e-d52d-4b82-913b-c2bd5215a18a
parent 4cda6b69
......@@ -4,6 +4,9 @@ import matplotlib.pyplot as plt
# cnd line
import sys, getopt,os.path
sys.path.append('/home/jcl/works/SVN/uns_projects/trunk/py/modules/')
from uns_simu import *
import argparse
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# main
......@@ -52,11 +55,25 @@ def main(argv):
for f in file.split(","):
try:
cpu_file,mylegend=f.split(":") # parse filename:legend
except ValueError:
f_label=f
cpu_file=f
else:
f_label=mylegend
# try database
if (os.path.basename(cpu_file)!="cpu.txt"):
simname=cpu_file
sql3 = UnsSimu()
r = sql3.getInfo(simname)
sql3.printInfo(simname)
if (r):
cpu_file=r['dir']+"/SNAPS/cpu.txt"
print "cpu_file = ",cpu_file
else:
print "Simulation [",cpu_file,"] does not exist in unsio database..."
sys.exit()
time,cpu,ncores=parseCPU(cpu_file,dt,tf,tl)
f_label=f_label+" cpus=%d"%ncores
......@@ -184,6 +201,7 @@ def printHelp(prog,file,dt,tf,tl,out):
Notes :
inputfile : cpu.txt file from gadget3 simulation [%s]
or simulation belonging to unsio database
you can give several files separated by ","
you can set a legend by giving a name after a ":"
cpu.txt:mdf001
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment