File: modules/TrLock.pm Version: 2.15;
TrLock ... TrLock.pm Run locking for JETtransp
- Elements of the Lock object :-Use: Err
TrEnv
TrStat
Util
strictRoutine Comment Arguments Dump Dump RunLock Filenm returns .lock or .stat my( $f, $d ) = @_ ; FindMID Find MDS+ ID lock ( Arg = mpi id, df 0 ) FlagRunning Update status hash to show locking step is running Fnm Construct or parse the standard Lock filename Fnm_ Construct or parse the standard Lock filename ( hash input.. ) Get Get info from locks GetStatus Return proc, status from $TWD/@status ( last lock file ) Init Initialise TrLock for a run... needs $Transp::TWD defined IsExecuting .t if locking step is executing IsLocked Wrapper LL_lock Create a lock for a LL job Llock returns process name of last locking process Lock Check not locked, create a new lock Locks Returns array of ( active ) lock names New Create a new lock object, of the appropriate type PrLocks Print locking processes Print summary of locks PrintStatus Run Status ProcNm returns host, process name of locking process RecdExe Record step status as executing RecdStatus Record status, df process
Args
$proc Process name
$stat Status ( to record )
$ID Varies
my $Lock = $TrLock::ThisLock ;Rlock returns process name of locking process - now wraps Llock RunLockName What should the run lock be called ?? Status Returns filename of current $TWD/@status Test_LLsub Submit $TWD/_LL_, & set a lock UnlinkStatus Remove link to .status file Unlock DUMMY
Remove a lock ( Df The last one set )UpdStat Update <runid>_status file when lock status changes Update Wrapper for JbLock->Update V Print version number Wait for file _Test Testbed for TrLock
File: modules/TrLock.pm Version: 1
Lock .. Template for lock management object, also used as Run ( Master ) Lock
Lock name $TWD/.Run_<host>_<PID>.lockRoutine Comment Arguments Add Add a new lock for this run..
For MPI jobs, only ID=0 maintains the Job lockfile ( on disk )Check Right Lock ?? Clear Cancel lock Copy LISOTT Delete Delete the lock file ( but not the lock instance.. ) Dump .. the lock parameters Find return a lock object FindMID Find MPI ID Fnm Construct the File name ( if NULL )
else, set IDGet Return an attribute GetStatus Get process status ; overridden for mPrLock Init for Run Lock IsEq Equivalence test IsLocked Return # of active locks IsUpdated LISOTT Key Return Key for this lock ( in Locks hash ); Df if NULL Locks Returns list of active lock ( names ) MarkComplete Indicate process has finished.. Merge Merge ( Locks from ) Other to Self NewStat Create status hash entry Open Open the file.. Parent Return parent of child lock ( from directory name ) PrID print process ID PrLocks Print active Lock(s) .. the lock parameters PrintStatus Run Status Purge Remove inactive locks ( for Run only ) Read Read lock from disk ReadChild Read Locks RecdRunStatus Update Run status record RecdStatus Update status Remove a lock from the Locks list Rename Change name, & ref from RunLock Set Set Default lock SetLast update Last lock ptr SetStatusLink Update @status link , point to this lock SetV Set lock variables, overriding existing values.. Test Is locking agent active ? This Return T if lock corresponds to the current job Unlock Update status record, .lock -> .stat UpdStat Update <runid>_status file when lock status changes Vfy Verify lock data Wait Wait - Overriden in mPrLock Write Write lock to disk _test common recording operation - {PrLock, GLlock } new generic lock constructor.. noID No ID ?? ( Overridden - GLLock )
my self = shift ;set Fill Default lock data
2.10 Arg may be an array, or a hash refxRename Rename a child lock
my $self = shift ;
my( $lockname, $newlock ) = @_ ;
delete ${$$self{Locks}}{$lockname};
$self->Add( $newlock );
File: modules/TrLock.pm Version: 1
PrLock .. Process lock management
Lock name - TrLock::RunLock/.Proc_<host>_<PID>.lock ( Interactive )
TrLock::RunLock/<Job lock>/.Proc_<host>_<PID>.lock ( Batch )Routine Comment Arguments Lock Create a lock for a process Parent Return parent of child lock ( from directory name ) Purge Dummy ReadChild Not expecting ? Test Is process lock active ?
-- TTD :
RecdStatus, if object status changesThis Return T if lock corresponds to the current job
File: modules/TrLock.pm Version: 1
FGLock .. Process lock management ( Globus )
Lock name - 'TrLock::RunLock/.transpgrid_<ID>.lock'Routine Comment Arguments RecdStatus Record run status ; inquire, if unknown.. Test Is locking agent active ?
File: modules/TrLock.pm Version: 1
GLLock .. Process lock management ( Globus )
Lock name - 'TrLock::RunLock/.transpgrid_<ID>.lock'Routine Comment Arguments ParseID extract lock ID from Globus ref - CLASS METHOD
shift; XRecdStatus Update Run status record Test Is locking agent active ?
>>> TTD - if proc = FGsend, then lock -> rruntr, status unknownnoID Cant set filename before IDstr available, so, dont worry .. ( O/R Lock::noID )
File: modules/TrLock.pm Version: 1
mPrLock .. MPI Process lock management
Extensions to the process lock for MPI processes.
Lock name - TrLock::RunLock/<Job lock>/.mProc_<host>_<PID>.lock
A link @mpi-nnn ( where nnn is the process ID ) is generated,
with the lock file as its targetRoutine Comment Arguments GetStatus Return process status ; Wait for link mpinnn~ RecdStatus Fix the link Set Add MPI ID attribute SetLink Maintain @mpi-nnn as a link to lock file Update Wait on last MPI process Wait Wait for @mpi links Write Link lock as MPI_name
File: modules/TrLock.pm Version: 1
JbLock .. Job lock management ( LoadLeveller, Fusion Grid )
Lock for a local ( SGE , aka Load Leveller ) or remote batch job
Lock name of the form .Job_{LL|FG}_<$JOB_ID>.lock
The Job lock is stored in a subdirectory of the TrLock::RunLock directory,
which has the same name as the Lock itself. This directory contains the lock file(s)
for associated process(es)
In the case of a a local MPI job, the Job lockfile is maintained by MPI ID 0 .Routine Comment Arguments Delete Delete the lock directory ( but not the lock instance.. ) Dirnm Job Lock directory name FindMID Find MPI ID # Lock ( returns mProc lock ) Fnm File name for 'Job' Lock Init for LL run Lock Create a lock for a LL job
Expect $_[0] otf
Your job 749929 ("tr_50621Z53_mpi") has been submittedParent Return parent of Job Lock PrintStatus Run Status Purge Dummy RecdRunStatus Update Run status record RecdStatus -- Find last entry .. Set Initialise variables.. SetStatusLink link to directory, as well Test Is locking agent active ? This Return T if lock corresponds to the current job Unlock Update status record, .lock -> .stat Update Update Job lock once each MPI processes has initialised
Action by ID = 0 only ; others wait on last MPI processVfy Verify lock data