ó ‹÷Îgc@s™dZddddddddd d d d d dgZddlZddlZddlZddlZeƒZdefd„ƒYZda d„Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd efd„ƒYZd efd„ƒYZd efd„ƒYZdefd „ƒYZd!efd"„ƒYZd efd#„ƒYZdefd$„ƒYZd%efd&„ƒYZdS('sE!Provides information about the cluster on which this job is running.tClustertwheretlongnametnamet group_quotast acl_supporttno_access_controltuse_acl_for_rstdatatncepprodtMSUOriontNOAAJettNOAAGAEAtNOAAHerat NOAAWCOSSiÿÿÿÿNcBs)eZdZdd„Zed„ƒZRS(s/!Stores information about a computer cluster. cCsˆt|ƒ|_t|ƒ|_|tk r<t|ƒ|_nt|ƒ|_t|ƒ|_|dkr{|jou|j}n||_ dS(sº!Sets all public member variables. All are mandatory except use_acl_for_rstdata. The default for use_acl_for_rstdata is the logical AND of group_quotas and acl_support.N( tboolRRt DO_NOT_SETt productiontstrRRtNoneR(tselfRRRRRR((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyt__init__s  cCs|jS(N(R(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyt partitionDsN(t__name__t __module__t__doc__RRtpropertyR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRs .cCs |adS(sÌ!Sets the current cluster (module-level "here" variable) to the given value. Bad things may happen if this is not a subclass of Cluster. #@param there A Cluster object for this local cluster.N(there(tthere((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyt set_clusterLscCs!td krtjjdƒr*tƒaqtjjdƒrHtƒaqtjjdƒrŠtjjdƒrŠtjjdƒrŠtƒaqtjjdƒrÆtƒatjjdƒrt ƒaqqtjjdƒrät ƒaqtjjdƒrt ƒaqt t t t d d ƒantS( s¿!Guesses what cluster the program is running on, and if it cannot, returns a cluster named "noname" with reasonable defaults. The result is stored in the module scope "here" variable.s/lfs3s/glades/datas/scratchs/homes /scratch1s /lfs/h2/emcs /lustre/f2tnonameN(RRtostpathtexistsR tUCARYellowstonet WisconsinS4R t NOAATheiatWCOSS2R RtFalse(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRTs$   $    cCstdkrtƒntjS(s]!Synonym for here.longname. Will call the "where()" function if "here" is uninitialized.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRms cCstdkrtƒntjS(sY!Synonym for here.name. Will call the "where()" function if "here" is uninitialized.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRss cCstdkrtƒntjS(sa!Synonym for here.group_quotas. Will call the "where()" function if "here" is uninitialized.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRys cCstdkrtƒntjS(s`!Synonym for here.acl_support. Will call the "where()" function if "here" is uninitialized.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRs cCs'tdkrtƒntjo&tj S(s¯!True if the cluster provides no means to control access to files. This is true if the cluster uses group ids for quotas, and provides no access control list support.N(RRRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR…s cCstdkrtƒntjS(sh!Synonym for here.use_acl_for_rstdata. Will call the "where()" function if "here" is uninitialized.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRŒs cCs,tdkrtƒntjo+dtjkS(s,!Are we on NCEP production? @returns True if the present machine is the NCEP production machine. Note that this function may read a text file when it is called, and the return value may change during the execution of the program if the program is running during a production switch.tncepN(RRRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR’s cCstdkrtƒntjS(sR!Returns system-specific information about what part of the system you are on.N(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRœs cBseZdZd„ZRS(s@!The NOAA Jet Cluster Represents the NOAA Jet cluster, which has non-functional ACL support. Will report that ACLs are supported, but should not be used. Also, group quotas are in use. That means that there is no means by which to restrict access control, so no_access_control() will return True.cCs)tt|ƒjtttddtƒdS(s!constructor for NOAAJettjetsjet.rdhpcs.noaa.govN(tsuperR RtTrueR%(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRªs(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR ¢scBseZdZd„ZRS(sƒ!Represents the NOAA GAEA cluster. Allows ACLs to be used for restricted data, and specifies that group quotas are not in use.cCs&tt|ƒjtttddƒdS(s!constructor for NOAAGAEAtgaeasgaea.rdhpcs.noaa.govN(R(R RR%R)(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR²s(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR ¯scBseZdZd„ZRS(sn!Represents the NOAA Hera cluster. Does not allow ACLs, assumes no group quotas (fileset quotas instead).cCs&tt|ƒjtttddƒdS(Ntherashera.rdhpcs.noaa.gov(R(R RR%(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRºs(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR ·sR!cBseZdZd„ZRS(sT!Represents the Yellowstone cluster. Does not allow ACLs, assumes group quotas.cCs&tt|ƒjtttddƒdS(s !Constructor for UCARYellowstonet yellowstonesyellowstone.ucar.eduN(R(R!RR)R%(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRÁs(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR!¾sR"cBseZdZd„ZRS(sK!Represents the S4 cluster. Does not allow ACLs, assumes group quotas.cCs&tt|ƒjtttddƒdS(s!Constructor for WisconsinS4ts4ss4.ssec.wisc.eduN(R(R"RR)R%(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRÉs(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR"ÆscBseZdZd„ZRS(smRepresents the MSU Orion cluster. Does not allow ACLs, assumes no group quotas (fileset quotas instead).cCs&tt|ƒjtttddƒdS(Ntorionsorion.hpc.msstate.edu(R(R RR%(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRÑs(RRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR ÎscBs8eZdZdddd„Zd„Zed„ƒZRS(sk!Represents the NOAA WCOSS clusters, Tide, Gyre and the test system Eddy. Automatically determines which WCOSS the program is on based on the first letter of socket.gethostname(). Will report no ACL support, and no group quotas. Hence, the cluster should use group IDs for access control. The production accessor is no longer a public member variable: it is now a property, which may open the /etc/prod file. The result of the self.production property is cached for up to prod_cache_time seconds. That time can be specified in the constructor, and defaults to 30 seconds.icCsTtt|ƒjttt||dƒ||_d|_d|_t |ƒ|_ dS(s÷!Creates a NOAAWCOSS object, and optionally specifies the time for which the result of self.production should be cached. Default: 30 seconds. @param prod_cache_time how long to cache the prod vs. dev information, in secondss.ncep.noaa.goviN( R(R RR%Rt_phaseRt _productiont _lastprodtintt_prod_cache_time(Rtprod_cache_timeRtphase((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRãs     cCsd|_d|_d|_dS(sh!Clears the cached value of self.production so the next call will return up-to-date information.iN(RR0R1R/(R((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pytuncacheïs  cCsttjƒƒ}|jdks7||j|jkrýt}tjj dƒrÛt ddƒx}xn|D]f}t j d|ƒrh|j ƒjdƒddkrÎ|j ƒjdƒdj ƒ|jk}PqÎqhqhWWdQXn||_ttjƒƒ|_|S|jSdS( sš!Is this the WCOSS2 production machine? The name of the WCOSS2 production machine: cactus or dogwood luna as determined by the /lfs/h1/ops/prod/config/prodmachinefile file. @returns True or False: is this the WCOSS2 production machine? @note The return value may change during the execution of this program if a production switch happened. A cached value is returned if the values is not too old. To force a refresh, call uncache() first. @warning The check requires opening and parsing the /etc/prod file, so the runtime is likely several milliseconds when the cache times out.s'/lfs/h1/ops/prod/config/prodmachinefiletrts[a-z]+t:itprimaryiN(R2ttimeR0RR1R3R%RRR topentretmatchtstriptsplitR(Rtnowtprodtftline((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRös ( N(RRRRRR6RR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR Õs  R$cBseZdZdd„ZRS(sW!This subclass of NOAAWCOSS handles the new Cray portions of WCOSS: Luna and Surge.cCso|dkrRtjƒdd!}|dkr4d}qR|dkrId}qRd}ntt|ƒjd|ƒdS( s!Create a new WCOSS2 object describing this cluster as a Cray machine. @property name The name of the cluster. Default is to check the hostname with socket.gethosname() and decide "dogwood" vs. "cactus" based on the first letter of the hostname. iitctcactuststdogwoodRN(Rtsockett gethostnameR(R$R(RRthost1((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyRs    N(RRRRR(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyR$s(Rt__all__R:RHRR<tobjectRRRRRRRRRRRRRRR R R R!R"R R R$(((s=/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/cluster.pyts2 0 7          C