Changeset 12827
- Timestamp:
- 07/30/12 14:41:52 (13 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/clusters/generic.py
r12754 r12827 1 """2 GENERIC cluster class definition3 4 Usage:5 cluster=generic('name','astrid','np',3);6 cluster=generic('name',oshostname(),'np',3,'login','username');7 """8 9 1 import socket 10 2 import os … … 19 11 20 12 class generic(object): 13 """ 14 GENERIC cluster class definition 15 16 Usage: 17 cluster=generic('name','astrid','np',3); 18 cluster=generic('name',oshostname(),'np',3,'login','username'); 19 """ 20 21 21 def __init__(self,*args): # {{{ 22 22 -
issm/trunk-jpl/src/m/classes/pairoptions.py
r12661 r12827 1 """ 2 PAIROPTIONS class definition 1 from WriteData import * 2 3 class pairoptions(object): 4 """ 5 PAIROPTIONS class definition 3 6 4 Usage: 5 pairoptions=pairoptions(); 6 pairoptions=pairoptions('module',true,'solver',false); 7 """ 8 9 from WriteData import * 10 11 class pairoptions(object): 7 Usage: 8 pairoptions=pairoptions(); 9 pairoptions=pairoptions('module',true,'solver',false); 10 """ 11 12 12 def __init__(self,*arg): 13 13 self.functionname = '' -
issm/trunk-jpl/src/m/model/MatlabProcessPatch.py
r12733 r12827 1 """ 2 PROCESSPATCH - create a structure from a patch 1 def MatlabProcessPatch(structure): 2 """ 3 PROCESSPATCH - create a structure from a patch 3 4 4 Usage: 5 Result=ProcessPatch(Result); 6 """ 7 8 def MatlabProcessPatch(structure): 5 Usage: 6 Result=ProcessPatch(Result); 7 """ 9 8 10 9 #loop over steps -
issm/trunk-jpl/src/m/model/WriteData.py
r12676 r12827 1 """2 WRITEDATA - write model field in binary file3 4 Usage:5 WriteData(fid,*args)6 """7 8 1 import numpy 9 2 import math … … 12 5 13 6 def WriteData(fid,*args): 7 """ 8 WRITEDATA - write model field in binary file 9 10 Usage: 11 WriteData(fid,*args) 12 """ 13 14 14 #process options 15 15 options=pairoptions(args) -
issm/trunk-jpl/src/m/model/ismodelselfconsistent.py
r12757 r12827 1 """ 2 ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem. 3 4 Usage: 5 ismodelselfconsistent(md), 6 """ 1 def ismodelselfconsistent(md): 2 """ 3 ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem. 7 4 8 def ismodelselfconsistent(md): 5 Usage: 6 ismodelselfconsistent(md), 7 """ 9 8 10 9 #initialize consistency as true -
issm/trunk-jpl/src/m/model/loadresultsfromcluster.py
r12733 r12827 1 """2 LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster3 4 Usage:5 md=loadresultsfromcluster(md,runtimename);6 """7 8 1 import os 9 2 import platform … … 12 5 13 6 def loadresultsfromcluster(md,runtimename=False): 7 """ 8 LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster 9 10 Usage: 11 md=loadresultsfromcluster(md,runtimename); 12 """ 14 13 15 14 #retrieve cluster, to be able to call its methods -
issm/trunk-jpl/src/m/model/loadresultsfromdisk.py
r12733 r12827 1 """2 LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"3 4 Usage:5 md=loadresultsfromdisk(md=False,filename=False);6 """7 8 1 import os 9 2 10 3 def loadresultsfromdisk(md,filename): 4 """ 5 LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename" 6 7 Usage: 8 md=loadresultsfromdisk(md=False,filename=False); 9 """ 11 10 12 11 #check number of inputs/outputs -
issm/trunk-jpl/src/m/model/marshall.py
r12733 r12827 1 """2 MARSHALL - outputs a compatible binary file from @model md, for certain solution type.3 4 The routine creates a compatible binary file from @model md5 This binary file will be used for parallel runs in JPL-package6 7 Usage:8 marshall(md)9 """10 11 1 from WriteData import * 12 2 13 3 def marshall(md): 4 """ 5 MARSHALL - outputs a compatible binary file from @model md, for certain solution type. 6 7 The routine creates a compatible binary file from @model md 8 This binary file will be used for parallel runs in JPL-package 9 10 Usage: 11 marshall(md) 12 """ 13 14 14 print "marshalling file '%s.bin'." % md.miscellaneous.name 15 15 -
issm/trunk-jpl/src/m/model/petscversion.py
r12766 r12827 1 """2 PETSCVERSION - recover petsc version number, inside config.h file3 4 Usage:5 PETSC_VERSION=petscversion();6 """7 8 1 import os 9 2 from issmdir import * … … 11 4 12 5 def petscversion(): 6 """ 7 PETSCVERSION - recover petsc version number, inside config.h file 8 9 Usage: 10 PETSC_VERSION=petscversion(); 11 """ 13 12 14 13 #default -
issm/trunk-jpl/src/m/model/process_solve_options.py
r12676 r12827 1 """2 DEFAULT_SOLVE_OPTIONS - set up default options for solve phase3 4 Usage:5 options=process_solve_options(options)6 7 See also: SOLVE8 """9 10 1 import os 11 2 12 3 def process_solve_options(options): 4 """ 5 DEFAULT_SOLVE_OPTIONS - set up default options for solve phase 6 7 Usage: 8 options=process_solve_options(options) 9 10 See also: SOLVE 11 """ 13 12 14 13 outoptions={} -
issm/trunk-jpl/src/m/model/solve.py
r12755 r12827 1 """2 SOLVE - apply solution sequence for this model3 4 Usage:5 md=solve(md,solutionenum,varargin)6 where varargin is a list of paired arguments of string OR enums7 8 solution types available comprise:9 - DiagnosticSolutionEnum10 - PrognosticSolutionEnum11 - ThermalSolutionEnum12 - SteadystateSolutionEnum13 - TransientSolutionEnum...14 - BalancethicknessSolutionEnum15 - BedSlopeSolutionEnum16 - SurfaceSlopeSolutionEnum17 - HydrologySolutionEnum18 - FlaimSolutionEnum19 20 extra options:21 - loadonly : does not solve. only load results22 23 Examples:24 md=solve(md,DiagnosticSolutionEnum);25 """26 27 1 import datetime 28 2 import os … … 30 4 31 5 def solve(md,solutionenum,*args): 6 """ 7 SOLVE - apply solution sequence for this model 8 9 Usage: 10 md=solve(md,solutionenum,varargin) 11 where varargin is a list of paired arguments of string OR enums 12 13 solution types available comprise: 14 - DiagnosticSolutionEnum 15 - PrognosticSolutionEnum 16 - ThermalSolutionEnum 17 - SteadystateSolutionEnum 18 - TransientSolutionEnum... 19 - BalancethicknessSolutionEnum 20 - BedSlopeSolutionEnum 21 - SurfaceSlopeSolutionEnum 22 - HydrologySolutionEnum 23 - FlaimSolutionEnum 24 25 extra options: 26 - loadonly : does not solve. only load results 27 28 Examples: 29 md=solve(md,DiagnosticSolutionEnum); 30 """ 32 31 33 32 #recover and process solve options -
issm/trunk-jpl/src/m/model/waitonlock.py
r12676 r12827 1 """2 WAITONLOCK - wait for a file3 4 This routine will return when a file named 'filename' is written to disk.5 If the time limit given in input is exceeded, return 06 7 Usage:8 flag=waitonlock(md,executionpath)9 """10 11 1 import os 12 2 import socket … … 15 5 16 6 def waitonlock(md,executionpath,login,port): 7 """ 8 WAITONLOCK - wait for a file 9 10 This routine will return when a file named 'filename' is written to disk. 11 If the time limit given in input is exceeded, return 0 12 13 Usage: 14 flag=waitonlock(md,executionpath) 15 """ 17 16 18 17 #Get filename (lock file) and options -
issm/trunk-jpl/src/m/utils/Cluster/parallelrange.py
r12652 r12827 1 1 #! /usr/bin/env python 2 """ 3 PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks. 2 def parallelrange(rank,numprocs,globalsize): 3 """ 4 PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks. 4 5 5 Usage: 6 i1,i2=parallelrange(rank,numprocs,globalsize) 7 """ 8 9 def parallelrange(rank,numprocs,globalsize): 6 Usage: 7 i1,i2=parallelrange(rank,numprocs,globalsize) 8 """ 10 9 11 10 #We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution. -
issm/trunk-jpl/src/m/utils/OS/ismumps.py
r12762 r12827 1 """2 %ISMUMPS - figure out if MUMPS package was compiled with ISSM3 %4 % Usage:5 % flag=ismumps();6 """7 8 1 import os 9 2 from issmdir import * … … 11 4 12 5 def ismumps(): 6 """ 7 ISMUMPS - figure out if MUMPS package was compiled with ISSM 8 9 Usage: 10 flag=ismumps(); 11 """ 13 12 14 13 configfile=os.path.join(issmdir(),'bin','config.h') #should find it in the install target -
issm/trunk-jpl/src/m/utils/OS/ispetsc.py
r12762 r12827 1 """2 %ISPETSC - figure out if PETSC package was compiled with ISSM3 %4 % Usage:5 % flag=ispetsc();6 """7 8 1 import os 9 2 from issmdir import * … … 11 4 12 5 def ispetsc(): 6 """ 7 ISPETSC - figure out if PETSC package was compiled with ISSM 8 9 Usage: 10 flag=ispetsc(); 11 """ 13 12 14 13 configfile=os.path.join(issmdir(),'bin','config.h') #should find it in the install target -
issm/trunk-jpl/src/m/utils/OS/issmscpin.py
r12743 r12827 1 """2 SCPIN get packages from host, using scp on unix, and pscp on windows3 4 usage: scpin(host,packages,path)5 6 7 """8 9 1 import socket 10 2 import platform … … 15 7 16 8 def scpin(host, login,port,path, packages): 9 """ 10 SCPIN get packages from host, using scp on unix, and pscp on windows 11 12 usage: scpin(host,packages,path) 13 14 15 """ 17 16 18 17 #first get hostname -
issm/trunk-jpl/src/m/utils/OS/issmscpout.py
r12743 r12827 1 """2 SCPOUT send packages to a host, using scp on unix, and pscp on windows3 4 usage: scpout(host,path,packages)5 6 7 """8 9 1 import socket 10 2 import platform … … 15 7 16 8 def issmscpout(host,path,login,port,packages): 9 """ 10 SCPOUT send packages to a host, using scp on unix, and pscp on windows 11 12 usage: scpout(host,path,packages) 13 14 15 """ 17 16 18 17 #get hostname -
issm/trunk-jpl/src/m/utils/OS/issmssh.py
r12743 r12827 1 """2 ISSMSSH - wrapper for OS independent ssh command.3 4 usage:5 issmssh(host,command)6 """7 8 1 import socket 9 2 import platform … … 13 6 14 7 def issmssh(host,login,port,command): 8 """ 9 ISSMSSH - wrapper for OS independent ssh command. 10 11 usage: 12 issmssh(host,command) 13 """ 15 14 16 15 #first get hostname -
issm/trunk-jpl/src/m/utils/Shell/issmdir.py
r12733 r12827 1 """2 ISSMDIR - Get ISSM_DIR environment variable3 4 Usage:5 ISSM_DIR=issmdir()6 """7 8 1 import platform 9 2 import os … … 11 4 12 5 def issmdir(): 6 """ 7 ISSMDIR - Get ISSM_DIR environment variable 8 9 Usage: 10 ISSM_DIR=issmdir() 11 """ 13 12 14 13 if not 'Windows' in platform.system():
Note:
See TracChangeset
for help on using the changeset viewer.