| ! NSCHED_MAP.BAS
! Include file that describes the the format of the DECScheduler database
! Version: X1.2 Date: 22-DEC-1991
!
! Copyright (c) 1988,1992 by Digital Equipment Corporation
! All rights reserved.
! FT4.0-00 Ken Tsai
! 15-Nov-1988 Each job record is now 2 blocks, added several new fields,
! lengthened job, group names.
! 31-Jan-1989 LF Added new map for SYNC.DAT
! 28-July-1990 LF T1.0-1 - New DEPENDENCY.DAT file replaces SYNCH.DAT
! Added maps for V1.1 DEPENDENCY.DAT
! Map for SYNCH.DAT is left for compatibility with older
! versions. (sync_create reads it to create new file)
! 7-Jun-1991 RC/LF Add a few new fields.
! X1.2 Lou Falek
! 21-DEC-1991
!18-JUN-1992 RFC ADD NEW F_NORESCHEDULE FLAG
! V2.0-s Kit
!25-sep-1992 RFC/BE add new m$rec field DB_LBAL_TIME
!
!
! Definition of system time quadword for next scheduled time key
RECORD QUADWORD
long low_part
long hi_part
END RECORD QUADWORD
! Definition of records in NSCHED$:VSS.DAT
MAP (M$REC) LONG DB_TAG, ! unique job number &
LONG DB_RECORD_FLAGS, ! bit flags - see below &
LONG DB_LAST_STATUS, ! last completion status &
LONG DB_SUCCESS_COUNT, &
LONG DB_FAILURE_COUNT, &
LONG DB_PID, ! id of executing job &
LONG DB_UIC, ! UIC of requestor &
LONG DB_LOCK_ID, ! X1.2 lockid of job lock &
LONG DB_SYNC(15%), ! Tags to Sync on... &
LONG FILL%, ! not used now &
LONG DB_PRE_STATUS, ! pre function status &
LONG DB_POST_STATUS, ! post function status &
WORD DB_JPRIORITY, ! priority job should run under &
WORD DB_QPRIORITY, ! priority of job in job slot wait &
QUADWORD DB_LAST_START, ! time last started (sys)&
QUADWORD DB_LAST_END, ! time last ended (sys) &
QUADWORD DB_TIMEOUT, ! timeout &
QUADWORD DB_NEXT_Q, ! system time quadword &
QUADWORD DB_SYNCH_TIME, &
STRING DB_SYNC_NODES=96%, ! sync job nodes &
STRING DB_STATUS_FLAG=1%, ! see note (1) &
STRING DB_REQUEST_FLAG=1%, &
STRING DB_RESTART_PARM=40%, ! restart parameter &
STRING DB_PREFUNC=40%, ! prefunction &
STRING DB_POSTFUNC=40%, ! postfunction &
STRING DB_SCHED_INTERVAL=14%, ! dddd hh:mm:ss.hh &
QUADWORD DB_NOSTART_TIME, ! delta time job must start by &
STRING FILL$=6%, ! not used &
STRING DB_DOW=7%, ! day_of week mask &
STRING DB_USER_JOB=42%, ! Username & 10 chars of Jobname &
STRING DB_RESTOF_JOBNAME=30%, ! Rest of Job name &
STRING DB_COMMENT=80%, ! comment field &
STRING DB_LOGFILE=50%, ! place to log output &
STRING DB_VMS_CMD=132%, ! command to execute &
STRING DB_MAIL_TO=50%, ! mail_to field &
STRING DB_CLUSTER_NODE=6%, ! cluster node restriction &
STRING DB_GROUP=40%, ! Job Group &
STRING DB_TYPE=40%, ! Job Type &
STRING DB_FISCAL=16%, ! Fiscal Start Time &
STRING DB_CURRENT_NODE=6%, ! node currently running on &
LONG DB_NO_DEPON, ! no dependency mask for next run &
WORD DB_RERUN_FREQUENCY,! number of minutes to keep trying &
WORD DB_RERUN_ATTEMPTS, ! number of times to rerun job after failure &
WORD DB_RERUN_COUNT, ! number of times already tried &
LONG DB_READ_ID, ! read identifier &
LONG DB_WRITE_ID, ! write identifier &
LONG DB_EX_ID, ! execute identifier &
LONG DB_STALL_JOB, ! job to run on job stalled &
LONG DB_TIMEOUT_JOB, ! job to run on job maxtime &
STRING DB_JOBTYPE=1%, ! lcl,batch,remote, etc. X1.2 &
STRING DB_TYPESPECIFIC=72%, ! type-dependent X1.2 &
QUADWORD DB_LBAL_TIME, ! default's time for lbaling &
STRING FILL$=16% ! fill out record to 2 blocks
! note: in the following map, "bs" indicates "batch-specific"
! field within DB_TYPESPECIFIC
MAP (M$REC) LONG DB_TAG, ! job number &
STRING FILL$=116%, &
STRING DB_LAST_TIME_AS_STRING=8%, &
STRING FILL$=24%, &
STRING DB_SNODE(15%)=6%, ! array of sync nodename &
STRING FILL$=157%, &
STRING DB_USERNAME=32%, ! Username &
STRING DB_JOBNAME=40%, ! Complete Job name &
STRING FILL$=430%, ! FILL &
LONG DB_READ_ID, ! read identifier &
LONG DB_WRITE_ID, ! write identifier &
LONG DB_EX_ID, ! execute identifier &
LONG DB_STALL_JOB, ! job to run on job stalled &
LONG DB_TIMEOUT_JOB, ! job to run on job maxtime &
BYTE DB_JOBTYPE_N, ! job type as byte integer &
QUADWORD DB_QTIME, ! BS : time queued &
STRING DB_BQUE=31%, ! BS : batch queue to submit to &
LONG DB_QENTRY, ! BS : current queue entry # &
LONG DB_CPULIM, ! BS : 10 msec units &
LONG DB_CHARACTERISTICS(3%), ! BS : Characteristics &
STRING FILL$=7%, ! remaining type-specific &
STRING FILL$=26% ! fill out record to 2 blocks
MAP (M$REC) LONG DB_TAG, &
STRING DB_RECORD_DATA=1020% ! all the other fields
! The map of the special record for Scheduler internals
MAP (M$REC) LONG DB_TAG, ! unique tag number &
LONG DB_DELETES, ! number of job deletes &
STRING DB_FALEK=104%, ! just filling space &
QUADWORD DB_LAST_CREATED, ! time db last created &
QUADWORD DB_LAST_COMPRESSED, ! time db last compressed &
QUADWORD DB_RETRY_EXPIR, ! timeout &
QUADWORD DB_DUMMY_NEXT_Q, ! next time (this is a key) &
QUADWORD DB_RETRY_INT, ! retry interval &
STRING DB_RETRY_ALIAS=6%, ! not used in T1.0-1 &
STRING DB_TSAI=749%, ! filling out more space &
LONG DB_READ_ID, ! read identifier &
LONG DB_WRITE_ID, ! write identifier &
LONG DB_EX_ID, ! execute identifier &
LONG DB_STALL_JOB, ! job to run on job stalled &
LONG DB_TIMEOUT_JOB, ! job to run on job maxtime &
STRING FILL$=97% ! fill out record to 2 blocks
! Definition of records in NSCHED$:TEMP_PARMS.DAT
MAP (M$TEMP) LONG TP_TAG, &
LONG TP_UIC, &
STRING TP_COMMENT=80%, &
STRING TP_LOGFILE=50%, &
STRING TP_CLUSTER_NODE=6%, &
STRING TP_MAIL_TO=50%, &
STRING TP_USERNAME=32%, &
STRING TP_VMS_CMD=132%, &
STRING TP_PARAMETER=132%
MAP (M$TEMP) long tp_tag, &
string tp_rest=486%
! Definition of records in V1.0 (and VSS) NSCHED$:SYNCH.DAT
! These are here for compatibility with older versions.
MAP (SYNC) string sd_type=1%, ! record-type (1, 2 or 3) &
string sd_rnode=6%, ! remote node (blank=local) &
long sd_jobnum, ! job number &
quadword sd_time ! time last completed w success
MAP (SYNC) string sd_nodeandnum=11%, ! used as lookup key &
quadword dummy_sd_time
MAP (SYNC) string sd_nodeandnum=11%, ! used as lookup key &
sd_timestr=8% ! time as string datatype
MAP(SYNC) string sd_type=1%, ! record type=3 &
string sd_rnode=6%, ! remote node &
long sd_jobnum, ! job# (0% for type3) &
string sd_alias=6%, ! alias &
string fill$=2% ! not used
MAP(SYNC) string sd_nodeandalias=13%, &
string fill$=6%
! Definition of records in V1.1 NSCHED$:DEPENDENCY.DAT
! There are two record types.
!
! Each "type 1" record contains a local job which depends on a job.
! The record contains the node and number of the job that is depended
! upon, and the number of a local job that depends on it.
! Node is blank for local dependencies. For remote jobs, the FIRST
! record for that job also contains the "cache-time", which is the
! last known time the remote job completed successfully.
! Local_jobnum and depon_jobnum are both used as keys. These records
! are created and deleted by SYNC_INSERT and SYNC_DELETE routines.
! VSS$FIND_DEPS accesses these records and returns an array containing
! the local jobs that depend on a job. The cache-time for remote jobs
! is updated by RECV_TERMIN, and returned by VSS$GET_SYNC_TIME.
!
! Each "type 2" record holds a remote node that must be notified when
! a local job completes with success status. Records contain a local
! job number and a node to notify. Local_jobnum is used as a key.
! These records are created/deleted by SYNC2_REMOTE. The list of nodes
! that depend on a local job is returned by VSS$GET_DEPNODES
!
! Definition for "type 1" records
MAP (M$DEP) string depdat_type=1%, ! record type (=1) &
string depdat_depon_node=6%,! blank= depon job is local &
long depdat_depon_jobnum, ! job that is depended on &
long depdat_local_jobnum, ! local job that depends on it &
quadword depdat_time, ! for the FIRST entry for a remote job, cache time of last completion &
quadword rvss_dat_time ! time that is in remote vss.dat
! Definition for "type 2" records
MAP (M$DEP) string depdat_type=1%, ! record type (=2) &
string depdat_node_to_tell=6%, ! remote node to notify &
long fill%, ! field not used &
long depdat_local_jobnum, ! local job &
string depdat_timstr=8%, ! used for type 1 only &
string rvss_dat_timestr=8% ! only used in type 1
! Records in TEMP_PARAMS.DAT (for run-time overides)
MAP (TEMP_PARAMS) string parm_buff=486% ! buffer for SHOW_PARMS sub.
MAP (TEMP_PARAMS) string temp_vms_cmd=132%,temp_logfile=50%, &
temp_username=32%,temp_comment=80%,temp_mail_to=50%,&
temp_cluster_node=6%, temp_parameter=132%, &
long temp_UIC
COMMON (L$COM) long sched_lun,parm_lun, &
string sched_stat=5%,parm_stat=5%
! Symbolic names for the bits in DB_RECORD_FLAGS
DECLARE LONG CONSTANT &
F_RETAIN_ERROR=1%, ! RETAIN on ERROR &
F_RETAIN_SUCCESS=2%, ! RETAIN on SUCCESS &
F_MAIL_ERROR=4%, ! MAIL on error &
F_MAIL_SUCCESS=8%, ! MAIL on Success &
F_RESTART=16%, ! Restart on crash &
F_BROADCAST=32%, ! Enable broadcast notification &
F_ALTERNATE=64%, ! Alternate record exists for this job &
F_OPCOM=128%, ! enable OPCOM notifications &
F_UNKNOWN_SPECIAL_DAYS_FLAG=256%, ! UNKNOWN days &
F_NOLOAD=512%, ! Don't load balance on this job &
F_NOSTART_SENT=1024%, ! job nostart message already sent &
F_RETRY=2048%, ! retry job if fails &
F_NEXT_SWITCH=4096%, ! if on, use next time to calculate next_start &
F_NOW_LBAL=8192%, ! job is currently being run on another node via ... &
! ...load-balancing, default node don't touch &
F_TRYING_TO_RUN=16384%, ! job is currently in doo_command trying to run &
F_SHUTDOWN=32768%, &
F_SD_RESTRICTIONS=65536%, ! Job has Special Day Restrictions &
F_MAIL_SD_RESCHEDULE=131072%, ! MAIL on Special Day reschedule &
F_SD_HOLD_PENDING=262144%, ! Special Day Hold is Pending... &
F_SD_RESTRICT_TO=524288%, ! Job has Restrict_To restriction &
F_SD_RESTRICT_FROM=1048576%, ! Job has Restrict_From restriction &
F_DEFAULT_SD_ACTION=2097152%, ! Default Special Day Action &
F_LAST_RUN_SUCCESSFUL=4194304%,! 0/1 fail/success of last run &
!unused in this version &
F_NORESCHEDULE=8388608%, ! Special Day Action for Monday &
F_MON_SD_ACTION=16777216%, ! Special Day Action for Tuesday &
! &
F_TUE_SD_ACTION=33554432%, ! Special Day Action for Wednesday &
F_WED_SD_ACTION=67108864%, ! Special Day Action for Thursday &
!after this point stufF breaks due to extra digit &
F_THU_SD_ACTION=134217728%, ! Special Day Action for Friday &
F_FRI_SD_ACTION=268435456%, ! Special Day Action for Saturday &
F_SAT_SD_ACTION=536870912% ! Special Day Action for Sunday
! F_SUN_SD_ACTION
! Notes:
! Values for DB_STATUS_FLAG (indicates actual current job state)
! H Job is on HOLD - Don't run until furthur notice
! R Job is currently running (node and PID in database)
! S Job is scheduled to run
! D Job is waiting for other jobs to complete successfully
! J No job slots available - maximum jobs are already running
! I Record is for Internal Database Use
! Q Job currently queued to VMS Batch
!
! DB_REQUEST_FLAG ,if non-blank, indicates an unprocessed request
! These flags are set by the user-interface (and sometimes by NSCHED)
! (blank) No special actions pending
! A Abort Requested
! D Delete Requested
! N Run NOW Requested (ignore scheduled time and dependencies)
! H Hold Requested
! U Release requested - change state to SCHEDULED and then process
|
| ! Include file for NSCHED and some NSCHED library routines
! Version: X1.2
!+++++ Change Log History
!
! SAD,RC 14-Apr-1993 (QAR 345)
! Wiped out definition of term_mbx_chan. this info is now
! held in MSG_COMMON area...
!
! CMS 8/26/93 QAR 43
! Added a definition for jpi$_sts. I did this, even though the
! "right" thing would have been to use the appropriate include
! file to get all the "jpi$_" constants included. I judged it be
! too dangerous to make that many changes for a single ECO kit.
! It would be nice to do this for a next point release.
!
! CMS 9/30/94 QAR 151
! Added the ability to get queue information for the rewrite of
! batch start and batch end.
!
!------- End change Log
! Copyright (c) 1988,1993 by Digital Equipment Corporation
! X1.2
external long function sys$crembx,sys$trnlog,sys$qiow,sys$numtim, &
sys$gettim,sys$bintim,sys$waitfr,sys$getmsg,sys$cantim,sys$getjpiw, &
sys$setimr,sys$crelnm,sys$setef,sys$asctim,sys$creprc,sys$lckpag, &
sys$qio,sys$wflor,sys$assign,sys$dassgn,sys$clref,sys$delprc, &
sys$forcex,sys$dellnm,sys$exit,sys$enqw,sys$enq,sys$deq,sys$getsyiw,&
sys$setprv,sys$getuai,sys$brkthru,sys$waitfr, lib$set_symbol,&
lib$find_file,lib$spawn, sys$change_acl, sys$add_ident, &
sys$asctoid, sys$grantid, &
lib$get_symbol,lib$date_time,lib$day,lib$signal,lib$getjpi, &
lib$get_ef,lib$free_ef,lib$extzv,lib$addx,lib$day_of_week, &
lib$do_command,lib$stop,lib$scopy_dxdx,lib$get_lun,lib$free_lun, &
lib$getsyi,lib$getqui ! CMS 3/30/94 QAR 151
external long constant ss$_normal,ss$_wasclr,ss$_wasset,ss$_duplnam, &
ss$_endoffile,ss$_nonexpr,io$m_now,io$_writevblk,io$_readvblk, &
ss$_notran,ss$_valnotvalid,ss$_notqueued,ss$_nosyslck,ss$_nopriv,&
ss$_nomoreproc,ss$_dupident,ss$_ivident, ss$_nosuchid
external sub sort_array(long dim() by ref,string)
external sub sync_insert, sync_delete, sync_create
external long function ots$cvt_l_to(long,string, &
long by value,long by value)
external long function ots$cvt_l_tz(long,string, &
long by value,long by value)
external long function ots$cvt_tb_l(string,long,long by value, &
long by value)
external long function ots$cvt_tz_l
external long function write_scheduler_mbx,vss$sched_running, &
vss$validate_time,nsched_log,vss$bind,vss$show_params
External long constant ! Error codes defined in NSCHED_MSG.MSG &
nsched$_ambdayspec,nsched$_invdayspec,nsched$_condayspec, nsched$_abortreq, &
nsched$_cmdtoolong,nsched$_invschint,nsched$_invstrtime,nsched$_cmttrunc, &
nsched$_symseterr,nsched$_getdeferr,nsched$_invnextime, nsched$_nopriv, &
nsched$_cntnotdef,nsched$_invqualval,nsched$_nomods,nsched$_notallmods, &
nsched$_nosuchjob,nsched$_nonotpriv,nsched$_nosched,nsched$_jobrunerr, &
nsched$_nodatabase,nsched$_miscerr,nsched$_nosuchuser,nsched$_jobabort, &
nsched$_duplname,nsched$_more,nsched$_nomore,nsched$_notdone,nsched$_nomatch, &
nsched$_dupsync,nsched$_norpc,nsched$_stoprqst,nsched$_wldname, &
nsched$_notvmsv5, nsched$_cantopndb, nsched$_invarg, nsched$_nosynclst,&
nsched$_nohistrec, nsched$_nospechist, nsched$_nohistory, nsched$_nosamejob,&
nsched$_inqueue,nsched$_nosuchqueue
!
! Constants
!
declare long constant &
NAME_LENGTH=40%, ! length for job, group, type names &
MAX_SYNCHS=15%, ! maximum number of job synchs (from 0 to max_syncs) &
USER_LENGTH=32%, ! length for username &
all_spaces=538976288% ! 4 blanks interpreted as a longword
declare word constant &
QPRIO_DEFAULT=100% ! default queue priority
! bits in word sched_flags (in NSCHED__node lock value block)
declare word constant &
v_load_balance=1%, ! load balance enabled if set &
v_debug=2% ! NSCHED prints debug messages if set
declare integer constant &
TRUE = -1%, &
FALSE = 0%
!Masks for current status
declare integer constant &
HELD = 1 ! Job is on hold &
, SCHEDULED = 2 ! Job is scheduled to be run &
, WAITING = 4 ! Job is waiting for dependency &
, RUNNING = 8 ! Job is currently running &
, SYNCH_WAIT = 16 ! job is waiting on synchronization &
, QUEUED = 32 ! Job is in a queue
! Error numbers
declare integer constant &
ILLEGAL_FILE_NAME = 2 ! Funny chars in filespec &
, FILE_NOT_FOUND = 5 ! Can't find file or device &
, CHANNEL_ALREADY_OPEN = 7 ! File open already &
, CHANNEL_NOT_OPEN = 9 ! File not open &
, CANT_ACCESS_FILE = 10 ! Privilege violation &
, END_FILE = 11 ! End of file error value &
, DATA_FORMAT_ERROR = 50 ! Bad digits in numeric string &
, ILLEGAL_NUMBER = 52 ! Bad digits in numberic string &
, SUBSCRIPT_OUT_OF_RANGE = 55 ! in array reference &
, NO_CURRENT_RECORD = 131 &
, DUPLICATE_KEY = 134 &
, FILE_LOCKED = 138 ! file locked by another user &
, ILLEGAL_OPERATION = 141 ! Bad file operation &
, BAD_RECORD_ID = 143 ! null key, record number<=0 &
, ILLOGICAL_OPERATION = 152 ! Bad operation for org &
, RECORD_LOCKED = 154 ! record locked by another user &
, RECORD_NOT_FOUND = 155 ! Record not found by FIND
%INCLUDE "$SYIDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
! next two: CMS 3/30/94 QAR 151
%INCLUDE "$QUIDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
%INCLUDE "$JBCMSGDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB"
declare long constant ! function codes, etc. &
prc$m_detach=X"00000200"L, ! CREPRC should make detached proc.&
prv$m_cmkrnl=X"00000001"L, ! to set change mode to kernel priv&
prv$m_detach=X"00000020"L, ! to set detach priv &
prv$m_world=X"00010000"L, ! to set world priv &
prv$m_sysnam=X"00000004"L, ! to set sysnam priv &
prv$m_syslck=X"40000000"L, ! to set syslck priv &
prv$m_sysprv=X"10000000"L, ! to set sysprv priv &
prv$m_setprv=X"00004000"L, ! setprv &
prv$m_altpri=X"00002000"L, ! altpri, to change priority &
lck$m_system=X'00000010'L, &
lck$m_valblk=X'00000001'L, &
lck$m_convert=X'00000002'L, &
lck$k_nlmode=X'00000000'L, &
lck$k_crmode=X'00000001'L, &
lck$k_exmode=X'00000005'L, &
lck$m_nodlckwt=X'00000200'L, &
lck$m_noqueue=X'00000004'L, &
brk$m_cluster=X'00000800'L, &
brk$c_username=X'00000002'L, &
special_record=X'EFFFFFFF'L ! internals record in database
declare word constant &
jpi$_authpriv=X'0412'W, &
jpi$_curpriv=X'0400'W, &
jpi$_master_pid=X'0325'W,&
jpi$_pid=X'0319'W, &
jpi$_prcnam=X'031C'W, &
jpi$_procpriv=X'0204'W, &
jpi$_imagpriv=X'0413'W, ! MISKINIS 2/19/91 &
jpi$_uic=X'0304'W, &
jpi$_username=X"0202"W, &
jpi$_mode=X'0322'W, &
jpi$_sts=X'0305'W, ! cms 8/26/93 &
jpi$_nodename=X'0329'W, ! cms 3/30/94 QAR 151 &
lki$_blocking=X'0207'W, &
uai$_uic=X'0006'W, &
uai$_pri=X'2F'W, &
uai$_priv=X'1F'W
!
! Constants for ACL system service calls. We shouldn't have to
! do this.
!
declare long constant acl$c_device = 2, &
mb_max_len = 25% ! max length for ev mailbox messages
declare word constant &
acl$c_addaclent = 1, &
ace$m_write = 2, &
ace$m_control = 16, &
ace$m_read = 1, &
ace$m_execute = 4, &
ace$m_delete = 8
declare byte constant ace$c_keyid = 1
! non-constants
! (it is actually poor practice to put these in an include file)
declare string mb_buffer, ! mailbox buffer &
mb_dev, ! mailbox device &
never, ! scheduled time that means never &
first_time ! earliest time possible
declare long foo_status, ! directive status &
foo_status2, ! secondary status (MISKINIS 2/19/91) &
our_uic, ! longword returned by lib$getjpi &
mb_buffer_len, ! message length &
function_code ! qio function code
! NSCHED-WIDE DEFAULTS
never="31-DEC-5999 00:00:00.00" ! time that means "never"
first_time='17-NOV-1858 00:00:00.00' ! the first time in vax history
|