From 52e871dbc7bf5b61003718cd3342b5ce5d882c6a Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Fri, 20 Jan 2017 20:47:09 +0000 Subject: [PATCH] Fix in trisurf.py in getLastVTU not returning the result if directory does not exist or is empty. --- networkedExample.py | 29 ++++++++++++++++++++++++----- 1 files changed, 24 insertions(+), 5 deletions(-) diff --git a/networkedExample.py b/networkedExample.py index b444447..1464aff 100755 --- a/networkedExample.py +++ b/networkedExample.py @@ -2,7 +2,7 @@ from trisurf import trisurf from trisurf import tsmgr - +from trisurf import analyses #Ok... Configure your keys: @@ -19,10 +19,29 @@ run3.setSubdir("run2") - Runs=[run2, run3] -hosts=({'name':'Hestia','address':'kabinet.penic.eu', 'runs':Runs, 'username':'samo'}, - {'name':'altea','address':'127.0.0.1', 'runs':Runs, 'username':'samo'}) +#this is how analyses are defined +def analyze(run, **kwargs): + host=kwargs.get('host', None) + print("Demo analysis") + print("Analysis on host "+host['name']+" for run "+run.Dir.fullpath()+" completed") + print("here comes info on the run variable:") + print(run) + print("here comes info on the host variable:") + print(host) + print("here comes info on the hosts variable:") + print(kwargs.get('hosts',None)) + print("here comes info on the args variable:") + print(kwargs.get('args',None)) -tsmgr.start(hosts) +def testWebAnalysis(run, **kwargs): + print("Simulations are located in "+run.Dir.fullpath()) + print("\n\nStatistics file:") + print(run.Statistics.readText()) + +hosts=({'name':'natalie','address':'kabinet.penic.eu', 'runs':Runs, 'username':'samo', 'remotebasepath':'simulations-test/subdir/subdir'}, + {'name':'Hestia','address':'127.0.0.1', 'runs':Runs, 'username':'samo'}) +analyses={'analysis1':analyze,'webReport':testWebAnalysis,'runningavg':analyses.plotrunningavginteractive} + +tsmgr.start(hosts, analyses=analyses) -- Gitblit v1.9.3