the serveur will be in maintenance mode Thursday February 25 from 7:00 to 12:00 ( git and registry will be unreacheable)

Commit 533288aa authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

add process_analysis

parent 0218fc48
#!/usr/bin/env python
from __future__ import print_function
import os,time
import sys
from multiprocessing import Process
import Queue
import multiprocessing
import numpy as np
import argparse
import matplotlib
matplotlib.use('Agg')
#sys.path=['/home/jcl/works/GIT/uns_projects/py/modules/','/home/jcl/works/GIT/uns_projects/py/modules/simulations']+sys.path
from simulations.cuns_analysis import *
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# commandLine, parse the command line
def commandLine():
dbname=None
ncores=None
# help
parser = argparse.ArgumentParser(description="Parallel pipeline analysis program",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# options
parser.add_argument('simname', help='Simulation name')
parser.add_argument('script', help='Analysis script')
parser.add_argument('--ncores', help='Use ncores, None means all',default=ncores,type=int)
parser.add_argument('--dbname',help='UNS database file name', default=dbname)
parser.add_argument('--verbose',help='verbose mode', default=False)
print ("Matplotlib backend Using:",matplotlib.get_backend(),file=sys.stderr)
# parse
args = parser.parse_args()
# start main funciton
process(args)
# -----------------------------------------------------
# process, is the core function
def process(args):
try:
analysis=CUnsAnalysis(simname=args.simname, script=args.script,verbose_debug=args.verbose)
except Exception as x :
print (x.message)
else:
analysis.compute(args.ncores)
# -----------------------------------------------------
# main program
if __name__ == '__main__':
commandLine()
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