Python wrapper for running instances of trisurf-ng
Samo Penic
2017-01-07 d7e21ad16473dbc2b12f20c6ef34a09f73863912
networkedExample.py
@@ -19,10 +19,26 @@
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)
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,}
tsmgr.start(hosts, analyses=analyses)