Index: ../trunk-jpl/src/m/solve/solve.py =================================================================== --- ../trunk-jpl/src/m/solve/solve.py (revision 14871) +++ ../trunk-jpl/src/m/solve/solve.py (revision 14872) @@ -1,72 +1,3 @@ -import datetime -import os -import shutil -from pairoptions import * -from process_solve_options import * -from EnumDefinitions import * -from EnumToString import EnumToString -from ismodelselfconsistent import * -from marshall import * -from ispetsc import * -from waitonlock import * -from loadresultsfromcluster import * - -def solve(md,solutionenum,*args): - """ - SOLVE - apply solution sequence for this model - - Usage: - md=solve(md,solutionenum,varargin) - where varargin is a list of paired arguments of string OR enums - - solution types available comprise: - - DiagnosticSolutionEnum - - PrognosticSolutionEnum - - ThermalSolutionEnum - - SteadystateSolutionEnum - - TransientSolutionEnum... - - BalancethicknessSolutionEnum - - BedSlopeSolutionEnum - - SurfaceSlopeSolutionEnum - - HydrologySolutionEnum - - FlaimSolutionEnum - - extra options: - - loadonly : does not solve. only load results - - Examples: - md=solve(md,DiagnosticSolutionEnum); - """ - - #recover and process solve options - options=pairoptions('solution_type',solutionenum,*args) - options=process_solve_options(options) - - #recover some fields - md.private.solution=options['solution_type'] - cluster=md.cluster - - #check model consistency - print "checking model consistency" - if solutionenum == FlaimSolutionEnum(): - md.private.isconsistent=True - md.mesh.checkconsistency(md,solutionenum) - md.flaim.checkconsistency(md,solutionenum) - if not md.private.isconsistent: - raise RuntimeError("Model not consistent, see messages above.") - else: - ismodelselfconsistent(md) - - #First, build a runtime name that is unique - c=datetime.datetime.now() - md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid()) - - #if running qmu analysis, some preprocessing of dakota files using models - #fields needs to be carried out. - if md.qmu.isdakota: - md=preqmu(md,options) - - #flaim analysis if options['solution_type'] == FlaimSolutionEnum(): md=flaim_sol(md,options) [md.private.solution]=EnumToString(options['solution_type']) @@ -82,11 +13,6 @@ md.toolkits.ToolkitsFile(md.miscellaneous.name+'.toolkits') # toolkits file cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof) # queue file - #we need to make sure we have PETSC support, otherwise, we run with only one cpu: - if not ispetsc(): - print "PETSC support not included, running on 1 cpu only!" - cluster.np=1 - #Stop here if batch mode if strcmpi(options['batch'],'yes'): print 'batch mode requested: not launching job interactively'