浏览代码

openpbs-19.1.3 定制版本

Believe 5 年之前
当前提交
c99d90c31e
共有 100 个文件被更改,包括 29328 次插入0 次删除
  1. 173 0
      .appveyor.yml
  2. 84 0
      .appveyor/Retry-Command.ps1
  3. 164 0
      .appveyor/_build_python_32bit.bat
  4. 188 0
      .appveyor/_build_python_64bit.bat
  5. 94 0
      .appveyor/_build_python_debug.bat
  6. 114 0
      .appveyor/appveyor_helper.bat
  7. 124 0
      .appveyor/build_libedit.bat
  8. 105 0
      .appveyor/build_libical.bat
  9. 105 0
      .appveyor/build_pgsql.bat
  10. 58 0
      .appveyor/build_python.bat
  11. 107 0
      .appveyor/build_ssl.bat
  12. 140 0
      .appveyor/build_swig.bat
  13. 158 0
      .appveyor/build_tcltk.bat
  14. 70 0
      .appveyor/generate_installer.bat
  15. 121 0
      .appveyor/set_paths.bat
  16. 74 0
      .appveyor/simple_hook.py
  17. 3 0
      .github/CODE_OF_CONDUCT.md
  18. 6 0
      .github/CONTRIBUTING.md
  19. 39 0
      .github/PULL_REQUEST_TEMPLATE.md
  20. 98 0
      .github/checkpep8
  21. 67 0
      .github/runchecks
  22. 256 0
      .gitignore
  23. 32 0
      .travis.yml
  24. 15 0
      .travis/centos_7.sh
  25. 15 0
      .travis/centos_7_sanitize.sh
  26. 18 0
      .travis/debian_9.sh
  27. 20 0
      .travis/opensuse_leap_15.sh
  28. 18 0
      .travis/ubuntu_18_04.sh
  29. 36 0
      COPYRIGHT
  30. 237 0
      INSTALL
  31. 1026 0
      LICENSE
  32. 50 0
      Makefile.am
  33. 34 0
      PBS_License.txt
  34. 17 0
      README
  35. 42 0
      README.md
  36. 44 0
      autogen.sh
  37. 46 0
      buildutils/Makefile.am
  38. 270 0
      buildutils/ar-lib
  39. 948 0
      buildutils/attr_parser.py
  40. 347 0
      buildutils/compile
  41. 791 0
      buildutils/depcomp
  42. 4 0
      buildutils/exclude_script
  43. 527 0
      buildutils/install-sh
  44. 742 0
      buildutils/makedepend-sh
  45. 215 0
      buildutils/missing
  46. 86 0
      buildutils/pbs_mach_type
  47. 398 0
      buildutils/pbs_mkdirs.in
  48. 170 0
      buildutils/py-compile
  49. 198 0
      buildutils/python-autoconf.py
  50. 249 0
      buildutils/ylwrap
  51. 404 0
      configure.ac
  52. 164 0
      doc/Makefile.am
  53. 104 0
      doc/man1/nqs2pbs.1B
  54. 249 0
      doc/man1/pbs_hook_attributes.7B
  55. 1937 0
      doc/man1/pbs_job_attributes.7B
  56. 914 0
      doc/man1/pbs_module.7B
  57. 777 0
      doc/man1/pbs_node_attributes.7B
  58. 88 0
      doc/man1/pbs_professional.7B
  59. 303 0
      doc/man1/pbs_python.1B
  60. 1499 0
      doc/man1/pbs_queue_attributes.7B
  61. 223 0
      doc/man1/pbs_ralter.1B
  62. 96 0
      doc/man1/pbs_rdel.1B
  63. 140 0
      doc/man1/pbs_release_nodes.1B
  64. 1613 0
      doc/man1/pbs_resources.7B
  65. 695 0
      doc/man1/pbs_resv_attributes.7B
  66. 120 0
      doc/man1/pbs_rstat.1B
  67. 694 0
      doc/man1/pbs_rsub.1B
  68. 311 0
      doc/man1/pbs_sched_attributes.7B
  69. 2185 0
      doc/man1/pbs_server_attributes.7B
  70. 158 0
      doc/man1/pbsdsh.1B
  71. 1280 0
      doc/man1/qalter.1B
  72. 236 0
      doc/man1/qdel.1B
  73. 207 0
      doc/man1/qhold.1B
  74. 179 0
      doc/man1/qmove.1B
  75. 117 0
      doc/man1/qmsg.1B
  76. 119 0
      doc/man1/qorder.1B
  77. 136 0
      doc/man1/qrerun.1B
  78. 166 0
      doc/man1/qrls.1B
  79. 534 0
      doc/man1/qselect.1B
  80. 249 0
      doc/man1/qsig.1B
  81. 1085 0
      doc/man1/qstat.1B
  82. 1632 0
      doc/man1/qsub.1B
  83. 127 0
      doc/man3/pbs_alterjob.3B
  84. 124 0
      doc/man3/pbs_connect.3B
  85. 67 0
      doc/man3/pbs_default.3B
  86. 87 0
      doc/man3/pbs_deljob.3B
  87. 77 0
      doc/man3/pbs_delresv.3B
  88. 58 0
      doc/man3/pbs_disconnect.3B
  89. 61 0
      doc/man3/pbs_geterrmsg.3B
  90. 85 0
      doc/man3/pbs_holdjob.3B
  91. 85 0
      doc/man3/pbs_locjob.3B
  92. 198 0
      doc/man3/pbs_manager.3B
  93. 136 0
      doc/man3/pbs_modify_resv.3B
  94. 102 0
      doc/man3/pbs_movejob.3B
  95. 84 0
      doc/man3/pbs_msgjob.3B
  96. 75 0
      doc/man3/pbs_orderjob.3B
  97. 85 0
      doc/man3/pbs_relnodesjob.3B
  98. 76 0
      doc/man3/pbs_rerunjob.3B
  99. 244 0
      doc/man3/pbs_rescquery.3B
  100. 0 0
      doc/man3/pbs_rescreserve.3B

+ 173 - 0
.appveyor.yml

@@ -0,0 +1,173 @@
+version: "#{build}"
+pull_requests:
+  do_not_increment_build_number: true
+clone_depth: 5
+cache:
+  - C:\projects\binaries -> .appveyor.yml, .appveyor
+configuration:
+  - Release
+  - Debug
+before_build:
+  - cmd: call .appveyor\appveyor_helper.bat %CONFIGURATION%
+build_script:
+  - cmd: call "%VS90COMNTOOLS%vsvars32.bat"
+  - cmd: vcbuild win_configure\pbs_windows_VS2008.sln "%CONFIGURATION%|Win32"
+after_build:
+  - cmd: call .appveyor\generate_installer.bat %CONFIGURATION%
+before_test:
+  - cmd: net user %USERNAME% pbS@123
+  - ps: copy c:\projects\win_build\msi\PBSPro_*.msi PBSPro.msi
+  - cmd: msiexec /quiet /qn /norestart /i c:\projects\pbspro\PBSPro.msi
+  - cmd: refreshenv
+  - cmd: C:\PROGRA~2\PBS\exec\python\python.exe C:\PROGRA~2\PBS\exec\etc\win_postinstall.py -u %USERNAME% -p pbS@123
+test_script:
+  - ps: . C:\projects\pbspro\.appveyor\Retry-Command.ps1
+  - ps: pbs_password ${Env:USERNAME} pbS@123
+  - ps: qstat -Bf
+  - ps: qstat -Qf
+  - ps: pbsnodes -av
+  - ps: qmgr -c "s s acl_roots = ${Env:USERNAME}"
+  - ps: qmgr -c "c h simple_hook event = 'resvsub,resv_end,queuejob,movejob,modifyjob,runjob,periodic,execjob_begin,execjob_prologue,execjob_launch,execjob_attach,execjob_preterm,execjob_epilogue,execjob_end,exechost_startup,exechost_periodic', freq = 35"
+  - ps: qmgr -c "i h simple_hook application/x-python default C:\projects\pbspro\.appveyor\simple_hook.py"
+  - ps: qmgr -c "l h"
+  - ps: $TODAY=Get-Date -UFormat "%Y%m%d"
+  - ps: Retry-Command { grep -Hn 'successfully sent hook file' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'copy hook-related file request received' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: qmgr -c "c r myncpus type=long,flag=nh"
+  - ps: qmgr -c "s n ${Env:COMPUTERNAME} resources_available.myncpus = 2"
+  - ps: (Get-Content C:\PROGRA~2\PBS\home\sched_priv\sched_config).Replace(', eoe"', ', eoe, myncpus"') | Set-Content C:\PROGRA~2\PBS\home\sched_priv\sched_config
+  - ps: net stop pbs_sched
+  - ps: net start pbs_sched
+  - ps: qmgr -c "s q workq started = False"
+  - ps: $current_time = (Get-Date)
+  - ps: $next_min = $current_time.AddSeconds(10)
+  - ps: $current_time.ToString();$next_min.ToString()
+  - ps: pbs_rsub -lselect=myncpus=2 -R $next_min.ToString("ddHHmm.ss") -D 00:00:15
+  - ps: pbs_rstat -f
+  - ps: pbs_rstat -f | grep -E '^Resource_List.ncpus = 1$'
+  - ps: pbs_rstat -f | grep -E '^Resource_List.myncpus = 2$'
+  - ps: qsub -f -l myncpus=1 -- pbs_attach -c pbsdsh hostname
+  - ps: qstat -f
+  - ps: qstat -f | grep -E '^    job_state = Q$'
+  - ps: qstat -f | grep -E '^    queue = workq$'
+  - ps: qstat -f | grep -E '^    Resource_List.ncpus = 1$'
+  - ps: qstat -f | grep -E '^    Resource_List.myncpus = 1$'
+  - ps: qstat -f | grep -E '^    Submit_arguments = -f -l myncpus=1 -- pbs_attach -c pbsdsh hostname$'
+  - ps: qalter -lmyncpus=2 1
+  - ps: qstat -f | grep -E '^    Resource_List.ncpus = 1$'
+  - ps: qstat -f | grep -E '^    Resource_List.myncpus = 2$'
+  - ps: qmove R0 1
+  - ps: qstat -f | grep -E '^    queue = R0$'
+  - ps: qmgr -c "s s scheduling = True"
+  - ps: qstat -f
+  - ps: Retry-Command {
+          if ((qstat -f | Measure-Object -Character).Characters -gt 0) {
+            throw
+          }
+        } -Timeout 5000
+  - ps: Retry-Command {
+          if ((pbs_rstat -f | Measure-Object -Character).Characters -gt 0) {
+            throw
+          }
+        } -Timeout 5000
+  - ps: tracejob 1
+  - cmd: dir STDIN*
+  - cmd: hostname > my
+  - cmd: diff my STDIN.o1
+  - ps: Retry-Command { grep -Hn 'hook event type is resvsub' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is resv_end' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is queuejob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is movejob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is modifyjob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_begin' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_prologue' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_launch' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_attach' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_epilogue' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_end' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: qmgr -c "s q workq started = True"
+  - ps: qmgr -c "c q equeue queue_type = Execution"
+  - ps: qmgr -c "s q equeue priority = 151"
+  - ps: qmgr -c "s q equeue enabled = True"
+  - ps: qmgr -c "s q equeue started = True"
+  - ps: qmgr -c "c q rqueue queue_type = Route"
+  - ps: qmgr -c "s q rqueue route_destinations = equeue@${Env:COMPUTERNAME}"
+  - ps: qmgr -c "s q rqueue enabled = True"
+  - ps: qmgr -c "s q rqueue started = False"
+  - ps: qsub -f -l myncpus=2 -- pbs_sleep 1000
+  - ps: qstat -f 2 | grep -E '^    queue = workq$'
+  - ps: qstat -f 2 | grep -E '^    Resource_List.myncpus = 2$'
+  - ps: Retry-Command {
+          qstat -f 2 | grep -E '^    job_state = R$';
+          $err1 = $LastExitCode;
+          qstat -f 2 | grep -E '^    substate = 42$';
+          $err2 = $LastExitCode;
+          if ($err1 -ne 0 -or $err2 -ne 0) {
+            qmgr -c "s s scheduling = True";
+            throw
+          }
+        }
+  - ps: qsub -f -q rqueue -l myncpus=2 -- pbs_sleep 1000
+  - ps: qstat -f 3 | grep -E '^    queue = rqueue$'
+  - ps: qstat -f 3 | grep -E '^    Resource_List.myncpus = 2$'
+  - ps: qmgr -c "s q rqueue started = True"
+  - ps: Retry-Command {
+          qstat -f 3 | grep -E '^    queue = equeue$';
+          if ($LastExitCode -ne 0) {
+            qmgr -c "s s scheduling = True";
+            throw
+          }
+        } -Timeout 2000
+  - ps: Retry-Command {
+          qstat -f 3 | grep -E '^    job_state = R$';
+          $err1 = $LastExitCode;
+          qstat -f 3 | grep -E '^    substate = 42$';
+          $err2 = $LastExitCode;
+          qstat -f 2 | grep -E '^    job_state = S$';
+          $err3 = $LastExitCode;
+          if ($err1 -ne 0 -or $err2 -ne 0 -or $err3 -ne 0) {
+            qmgr -c "s s scheduling = True";
+            throw
+          }
+        } -Timeout 2000
+  - ps: qstat -f 2
+  - ps: qdel 3
+  - ps: Retry-Command {
+          qstat -f 2 | grep -E '^    job_state = R$';
+          $err1 = $LastExitCode;
+          qstat -f 2 | grep -E '^    substate = 42$';
+          $err2 = $LastExitCode;
+          if ($err1 -ne 0 -or $err2 -ne 0) {
+            qmgr -c "s s scheduling = True";
+            throw
+          }
+        } -Timeout 5000
+  - ps: qsub -J1-2 -f -- pbs_sleep 1000
+  - ps: Retry-Command {
+          if ((Get-Process pbs_sleep).Length -ne 2) {
+            qmgr -c "s s scheduling = True";
+            throw
+          }
+        } -Timeout 2000
+  - ps: qdel 2 4[]
+  - ps: Retry-Command { grep -Hn 'hook event type is execjob_preterm' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Retry-Command {
+          if ((qstat -f | Measure-Object -Character).Characters -gt 0) {
+            throw
+          }
+        } -Timeout 5000
+# Uncomment below 3 line once https://pbspro.atlassian.net/browse/PP-1298 and https://pbspro.atlassian.net/browse/PP-1299 gets fixed
+#  - ps: net stop pbs_mom
+#  - ps: net start pbs_mom
+#  - ps: Retry-Command { grep -Hn 'hook event type is exechost_startup' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+  - ps: Start-Sleep -Seconds 40
+  - ps: Retry-Command { grep -Hn 'hook event type is exechost_periodic' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
+# Uncomment below line once https://pbspro.atlassian.net/browse/PP-1302 get fixed
+#  - ps: Retry-Command { grep -Hn 'hook event type is periodic' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
+  - ps: cmd /c "grep -Hn 'hook event type is unknown' C:\PROGRA~2\PBS\home\mom_logs\$TODAY && exit /b 1 || exit /b 0"
+after_test:
+  - ps: rm PBSPro.msi
+  - ps: copy c:\projects\win_build\msi\PBSPro_*.msi .
+artifacts:
+  - path: '*.msi'
+deploy: off

+ 84 - 0
.appveyor/Retry-Command.ps1

@@ -0,0 +1,84 @@
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+Function Retry-Command {
+    [CmdletBinding()]
+    Param
+    (
+        [Parameter(Mandatory = $true, Position = 1, ValueFromPipeline = $true)]
+        [ScriptBlock]$Command,
+
+        [Parameter(Mandatory = $false, Position = 2)]
+        [ValidateRange(0, [UInt32]::MaxValue)]
+        [UInt32]$Retry = 120,
+
+        [Parameter(Mandatory = $false, Position = 3)]
+        [ValidateRange(0, [UInt32]::MaxValue)]
+        [UInt32]$Timeout = 1000
+
+    )
+
+    Begin {
+        $StrCommand = $Command.ToString().Trim()
+    }
+
+    Process {
+        $lasterr = $false
+        for ($i = 1; $i -le $Retry; $i++) {
+            Write-Host -ForegroundColor DarkCyan -NoNewLine ("{0} ... attempt = {1}" -f $StrCommand, $i)
+            try {
+                $cmdOutput = & $Command
+                if ($LastExitCode -ne 0) {
+                    if ($cmdOutput) {
+                        throw $cmdOutput
+                    } else {
+                        throw "{0} exited with {1}" -f $StrCommand,$LastExitCode
+                    }
+                }
+                Write-Host -ForegroundColor Green ' ... Ok'
+                $cmdOutput
+                $lasterr = $false
+                Break
+            } catch {
+                Write-Host -ForegroundColor Red ' ... Failed'
+                $lasterr = $_.Exception
+                Start-Sleep -Milliseconds $Timeout
+            }
+        }
+        if ($lasterr) {
+            throw $lasterr
+        }
+    }
+}

+ 164 - 0
.appveyor/_build_python_32bit.bat

@@ -0,0 +1,164 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined PYTHON_VERSION (
+    echo "Please set PYTHON_VERSION to Python version!"
+    exit /b 1
+)
+
+if exist "%BINARIESDIR%\python" (
+    echo "%BINARIESDIR%\python exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" https://github.com/python/cpython/archive/v%PYTHON_VERSION%.zip
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+        echo "Failed to download python"
+        exit /b 1
+    )
+)
+2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip"
+cd "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+
+REM Restore externals directory if python_externals.tar.gz exists
+if exist "%BINARIESDIR%\python_externals.tar.gz" (
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%\externals" (
+        "%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/cpython-$PYTHON_VERSION\" && tar -xf \"$BINARIESDIR_M/python_externals.tar.gz\""
+    )
+)
+
+call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PCbuild\env.bat" x86
+
+call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PC\VS9.0\build.bat" -e
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python 32bit"
+    exit /b 1
+)
+
+REM Workaround for cabarc.exe, required by msi.py
+if not exist "%BINARIESDIR%\cabarc.exe" (
+    if not exist "%BINARIESDIR%\supporttools.exe" (
+        "%CURL_BIN%" -qkL -o "%BINARIESDIR%\supporttools.exe" http://download.microsoft.com/download/d/3/8/d38066aa-4e37-4ae8-bce3-a4ce662b2024/WindowsXP-KB838079-SupportTools-ENU.exe
+        if not exist "%BINARIESDIR%\supporttools.exe" (
+            echo "Failed to download supporttools.exe"
+            exit /b 1
+        )
+    )
+    2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    mkdir "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    "%BINARIESDIR%\supporttools.exe" /C /T:"%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    expand "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp\support.cab" -F:cabarc.exe "%BINARIESDIR%"
+)
+set PATH=%BINARIESDIR%;%PATH%
+
+REM Workaround for python2713.chm
+mkdir "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Doc\build\htmlhelp"
+echo "dummy chm file to make msi.py happy" > "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Doc\build\htmlhelp\python%PYTHON_VERSION:.=%.chm"
+
+cd PC
+nmake /f "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PC\icons.mak"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to build icons for Python 32bit"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi"
+set PCBUILD=PC\VS9.0
+set SNAPSHOT=0
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" -m ensurepip -U --default-pip
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to run ensurepip for Python 32bit"
+    exit /b 1
+)
+set PIP_EXTRA_ARGS=
+if exist "%BINARIESDIR%\pypiwin32-219-cp27-none-win32.whl" (
+    set PIP_EXTRA_ARGS=--no-index --find-links="%BINARIESDIR%" --no-cache-dir
+)
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" -m pip install %PIP_EXTRA_ARGS% pypiwin32==219
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install pypiwin32 for Python 32bit"
+    exit /b 1
+)
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" msi.py
+if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi\python-%PYTHON_VERSION%150.msi" (
+    echo "Failed to generate msi Python 32bit"
+    exit /b 1
+)
+
+start /wait msiexec /qn /a "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi\python-%PYTHON_VERSION%150.msi" TARGETDIR="%BINARIESDIR%\python"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract msi Python 32bit to %BINARIESDIR%\python"
+    exit /b 1
+)
+"%BINARIESDIR%\python\python.exe" -Wi "%BINARIESDIR%\python\Lib\compileall.py" -q -f -x "bad_coding|badsyntax|site-packages|py3_" "%BINARIESDIR%\python\Lib"
+"%BINARIESDIR%\python\python.exe" -O -Wi "%BINARIESDIR%\python\Lib\compileall.py" -q -f -x "bad_coding|badsyntax|site-packages|py3_" "%BINARIESDIR%\python\Lib"
+"%BINARIESDIR%\python\python.exe" -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+"%BINARIESDIR%\python\python.exe" -m ensurepip -U --default-pip
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to run ensurepip in %BINARIESDIR%\python for Python 32bit"
+    exit /b 1
+)
+"%BINARIESDIR%\python\python.exe" -m pip install %PIP_EXTRA_ARGS% pypiwin32==219
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install pypiwin32 in %BINARIESDIR%\python for Python 32bit"
+    exit /b 1
+)
+copy /B /Y "%VS90COMNTOOLS%..\..\VC\redist\amd64\Microsoft.VC90.CRT\msvcr90.dll" "%BINARIESDIR%\python\"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy msvcr90.dll in %BINARIESDIR%\python for Python 32bit"
+    exit /b 1
+)
+copy /B /Y "%VS90COMNTOOLS%..\..\VC\redist\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" "%BINARIESDIR%\python\"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy Microsoft.VC90.CRT.manifest in %BINARIESDIR%\python for Python 32bit"
+    exit /b 1
+)
+
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+2>nul del /Q /F "%BINARIESDIR%\cabarc.exe"
+
+exit /b 0
+

+ 188 - 0
.appveyor/_build_python_64bit.bat

@@ -0,0 +1,188 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined PYTHON_VERSION (
+    echo "Please set PYTHON_VERSION to Python version!"
+    exit /b 1
+)
+
+if exist "%BINARIESDIR%\python_x64" (
+    echo "%BINARIESDIR%\python_x64 exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" https://github.com/python/cpython/archive/v%PYTHON_VERSION%.zip
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+        echo "Failed to download python"
+        exit /b 1
+    )
+)
+2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip"
+cd "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+
+REM Restore externals directory if python_externals.tar.gz exists
+if exist "%BINARIESDIR%\python_externals.tar.gz" (
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%\externals" (
+        "%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/cpython-$PYTHON_VERSION\" && tar -xf \"$BINARIESDIR_M/python_externals.tar.gz\""
+    )
+) else (
+    call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PCbuild\get_externals.bat"
+)
+
+REM workaround to openssl build fail
+2>nul del /Q /F "%BINARIESDIR%\cpython-%PYTHON_VERSION%\externals\openssl-1.0.2j\ms\nt64.mak"
+
+if exist "%VS90COMNTOOLS%..\..\VC\bin\amd64\vcvarsamd64.bat" (
+    call "%VS90COMNTOOLS%..\..\VC\bin\amd64\vcvarsamd64.bat"
+) else if exist "%VS90COMNTOOLS%..\..\VC\bin\vcvarsx86_amd64.bat" (
+    call "%VS90COMNTOOLS%..\..\VC\bin\vcvarsx86_amd64.bat"
+) else (
+    echo "Could not find x64 build tools for Visual Studio"
+    exit /b 1
+)
+
+call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PC\VS9.0\build.bat" -e -p x64
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python 64bit"
+    exit /b 1
+)
+
+REM Workaround for cabarc.exe, required by msi.py
+if not exist "%BINARIESDIR%\cabarc.exe" (
+    if not exist "%BINARIESDIR%\supporttools.exe" (
+        "%CURL_BIN%" -qkL -o "%BINARIESDIR%\supporttools.exe" http://download.microsoft.com/download/d/3/8/d38066aa-4e37-4ae8-bce3-a4ce662b2024/WindowsXP-KB838079-SupportTools-ENU.exe
+        if not exist "%BINARIESDIR%\supporttools.exe" (
+            echo "Failed to download supporttools.exe"
+            exit /b 1
+        )
+    )
+    2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    mkdir "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    "%BINARIESDIR%\supporttools.exe" /C /T:"%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp"
+    expand "%BINARIESDIR%\cpython-%PYTHON_VERSION%\cabarc_temp\support.cab" -F:cabarc.exe "%BINARIESDIR%"
+)
+set PATH=%BINARIESDIR%;%PATH%
+
+REM Workaround for python2713.chm
+mkdir "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Doc\build\htmlhelp"
+echo "dummy chm file to make msi.py happy" > "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Doc\build\htmlhelp\python%PYTHON_VERSION:.=%.chm"
+
+cd PC
+REM we need 32bit compiler as python icons does not compile in 64bit
+call "%VS90COMNTOOLS%vsvars32.bat"
+nmake /f "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PC\icons.mak"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to build icons for Python 64bit"
+    exit /b 1
+)
+
+REM Restore back 64 bit compiler
+if exist "%VS90COMNTOOLS%..\..\VC\bin\amd64\vcvarsamd64.bat" (
+    call "%VS90COMNTOOLS%..\..\VC\bin\amd64\vcvarsamd64.bat"
+) else if exist "%VS90COMNTOOLS%..\..\VC\bin\vcvarsx86_amd64.bat" (
+    call "%VS90COMNTOOLS%..\..\VC\bin\vcvarsx86_amd64.bat"
+) else (
+    echo "Could not find x64 build tools for Visual Studio"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi"
+set PCBUILD=PC\VS9.0\amd64
+set SNAPSHOT=0
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" -m ensurepip -U --default-pip
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to run ensurepip for Python 64bit"
+    exit /b 1
+)
+set PIP_EXTRA_ARGS=
+if exist "%BINARIESDIR%\pypiwin32-219-cp27-none-win_amd64.whl" (
+    set PIP_EXTRA_ARGS=--no-index --find-links="%BINARIESDIR%" --no-cache-dir
+)
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" -m pip install %PIP_EXTRA_ARGS% pypiwin32==219
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install pypiwin32 for Python 64bit"
+    exit /b 1
+)
+"%BINARIESDIR%\cpython-%PYTHON_VERSION%\%PCBUILD%\python.exe" msi.py
+if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi\python-%PYTHON_VERSION%150.amd64.msi" (
+    echo "Failed to generate msi Python 64bit"
+    exit /b 1
+)
+
+start /wait msiexec /qn /a "%BINARIESDIR%\cpython-%PYTHON_VERSION%\Tools\msi\python-%PYTHON_VERSION%150.amd64.msi" TARGETDIR="%BINARIESDIR%\python_x64"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract msi Python 64bit to %BINARIESDIR%\python_x64"
+    exit /b 1
+)
+"%BINARIESDIR%\python_x64\python.exe" -Wi "%BINARIESDIR%\python_x64\Lib\compileall.py" -q -f -x "bad_coding|badsyntax|site-packages|py3_" "%BINARIESDIR%\python_x64\Lib"
+"%BINARIESDIR%\python_x64\python.exe" -O -Wi "%BINARIESDIR%\python_x64\Lib\compileall.py" -q -f -x "bad_coding|badsyntax|site-packages|py3_" "%BINARIESDIR%\python_x64\Lib"
+"%BINARIESDIR%\python_x64\python.exe" -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+"%BINARIESDIR%\python_x64\python.exe" -m ensurepip -U --default-pip
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to run ensurepip in %BINARIESDIR%\python_x64 for Python 64bit"
+    exit /b 1
+)
+"%BINARIESDIR%\python_x64\python.exe" -m pip install %PIP_EXTRA_ARGS% pypiwin32==219
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install pypiwin32 in %BINARIESDIR%\python_x64 for Python 64bit"
+    exit /b 1
+)
+copy /B /Y "%VS90COMNTOOLS%..\..\VC\redist\amd64\Microsoft.VC90.CRT\msvcr90.dll" "%BINARIESDIR%\python_x64\"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy msvcr90.dll in %BINARIESDIR%\python_x64 for Python 64bit"
+    exit /b 1
+)
+copy /B /Y "%VS90COMNTOOLS%..\..\VC\redist\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" "%BINARIESDIR%\python_x64\"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy Microsoft.VC90.CRT.manifest in %BINARIESDIR%\python_x64 for Python 64bit"
+    exit /b 1
+)
+
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+2>nul del /Q /F "%BINARIESDIR%\cabarc.exe"
+
+exit /b 0
+

+ 94 - 0
.appveyor/_build_python_debug.bat

@@ -0,0 +1,94 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined PYTHON_VERSION (
+    echo "Please set PYTHON_VERSION to Python version!"
+    exit /b 1
+)
+
+if %DO_DEBUG_BUILD% EQU 0 (
+    echo "You are in Release mode so no need of Python debug build, skipping Python debug build"
+    exit /b 0
+)
+
+if exist "%BINARIESDIR%\python_debug" (
+    echo "%BINARIESDIR%\python_debug exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" https://github.com/python/cpython/archive/v%PYTHON_VERSION%.zip
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip" (
+        echo "Failed to download python"
+        exit /b 1
+    )
+)
+2>nul rd /S /Q "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\cpython-%PYTHON_VERSION%.zip"
+cd "%BINARIESDIR%\cpython-%PYTHON_VERSION%"
+
+REM Restore externals directory if python_externals.tar.gz exists
+if exist "%BINARIESDIR%\python_externals.tar.gz" (
+    if not exist "%BINARIESDIR%\cpython-%PYTHON_VERSION%\externals" (
+        "%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/cpython-$PYTHON_VERSION\" && tar -xf \"$BINARIESDIR_M/python_externals.tar.gz\""
+    )
+)
+
+REM Patch python source to make it purify compatible
+REM this patch is same as compiling python with '--without-pymalloc' in Linux
+REM but unfortunately in windows we don't have command line option like Linux
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/cpython-$PYTHON_VERSION\" && sed -i 's/#define WITH_PYMALLOC 1//g' PC/pyconfig.h"
+
+call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PCbuild\env.bat" x86
+
+call "%BINARIESDIR%\cpython-%PYTHON_VERSION%\PC\VS9.0\build.bat" -e -d
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python debug version"
+    exit /b 1
+)
+
+REM Since Python debug mode doesn't have msi generation part so we need to copy whole source directory
+cd "%BINARIESDIR%"
+ren "%BINARIESDIR%\cpython-%PYTHON_VERSION%" python_debug
+
+exit /b 0
+

+ 114 - 0
.appveyor/appveyor_helper.bat

@@ -0,0 +1,114 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altairs dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altairs trademarks, including but not limited to "PBS",
+REM "PBS Professional", and "PBS Pro" and Altairs logos is subject to Altair's
+REM trademark licensing policies.
+
+
+
+REM this script is just helper script to build PBS deps in parallel to reduce
+REM time of building all PBS deps.
+REM
+REM 1. it will list all build_*.bat file in .appveyor directory
+REM 2. one by one it will execute each batch file in background while
+REM    capturing output and error or batchfile in <batch file name>.bat.out
+REM    file in current directory
+REM 3. while executing batch file it will limit number of started background
+REM    process to number of processors available in system.
+REM 4. once it started background process reached limit it goes to wait loop
+REM    where it will wait for atleast one background process to complete by
+REM    looking at exclusive lock on <batch file name>.bat.out created by start
+REM    of process and that lock will be released as soon as process ends
+REM 5. as soon as one processor ends it checks for <batch file name>.bat.passed
+REM    file if it exists that means background process completed successfully
+REM    else some error occurred. Now in case of error this script will show
+REM    contents of <batch file name>.bat.out to console and exit with error
+REM    (which will stop all other background scrips also) else it will just put
+REM    one line saying \<batch file name>.bat finished.
+REM 6. Now since one process if finished we have one room to start new process
+REM    so it will go back to main loop to start new background process for building
+REM    next PBS deps and main loop again goes to wait loop and this goes on till
+REM    end of all batch file in .appveyor directory
+
+setlocal enableDelayedExpansion
+cd "%~dp0\.."
+set /a "started=0, ended=0"
+set hasmore=1
+set BUILD_TYPE=Release
+if "%~1"=="debug" (
+    set BUILD_TYPE=Debug
+)
+if "%~1"=="Debug" (
+    set BUILD_TYPE=Debug
+)
+for /f "usebackq" %%A in (`dir /b C:\__withoutspace_*dir_* 2^>nul`) do rd /Q C:\%%A
+
+call "%~dp0set_paths.bat"
+1>nul 2>nul del /Q /F %BINARIESDIR%\*.bat.out %BINARIESDIR%\*.passed
+
+for /f "usebackq" %%A in (`dir /on /b .appveyor ^| findstr /B /R "^build_.*\.bat$"`) do (
+    if !started! lss %NUMBER_OF_PROCESSORS% (
+        set /a "started+=1, next=started"
+    ) else (
+        call :Wait
+    )
+    set out!next!=%%A.out
+    echo !time! - %%A - %BUILD_TYPE% version: started
+    start /b "" "cmd /c 1>%BINARIESDIR%\%%A.out 2>&1 .appveyor\%%A %BUILD_TYPE% && echo > %BINARIESDIR%\%%A.passed"
+    REM Introduce 2 sec delay to get different RANDOM value
+    1>nul 2>nul ping /n 2 ::1
+)
+set hasmore=
+
+:Wait
+for /l %%N in (1 1 %started%) do 2>nul (
+    if not defined ended%%N if exist "%BINARIESDIR%\!out%%N!" 9>>"%BINARIESDIR%\!out%%N!" (
+        if not exist "%BINARIESDIR%\!out%%N:out=passed!" (
+            type "%BINARIESDIR%\!out%%N!"
+            exit 1
+        ) else (
+            echo !time! - !out%%N:.out=! - %BUILD_TYPE% version: finished
+        )
+        if defined hasmore (
+            set /a "next=%%N"
+            exit /b
+        )
+        set /a "ended+=1, ended%%N=1"
+    )
+)
+if %ended% lss %started% (
+    1>nul 2>nul ping /n 5 ::1
+    goto :Wait
+)
+
+1>nul 2>nul del /Q /F %BINARIESDIR%\*.bat.out %BINARIESDIR%\*.passed
+

+ 124 - 0
.appveyor/build_libedit.bat

@@ -0,0 +1,124 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined LIBEDIT_VERSION (
+    echo "Please set LIBEDIT_VERSION to editline version!"
+    exit /b 1
+)
+
+set LIBEDIT_DIR_NAME=libedit
+set BUILD_TYPE=Release
+if %DO_DEBUG_BUILD% EQU 1 (
+    set LIBEDIT_DIR_NAME=libedit_debug
+    set BUILD_TYPE=Debug
+)
+
+if exist "%BINARIESDIR%\%LIBEDIT_DIR_NAME%" (
+    echo "%BINARIESDIR%\%LIBEDIT_DIR_NAME% exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" https://sourceforge.net/projects/mingweditline/files/wineditline-%LIBEDIT_VERSION%.zip/download
+    if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" (
+        echo "Failed to download libedit"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%" (
+    echo "Could not find %BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
+    exit /b 1
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build"
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\bin32"
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\lib32"
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\include"
+mkdir "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build"
+
+cd "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build" && %CMAKE_BIN% -DLIB_SUFFIX=32 -DMSVC_USE_STATIC_RUNTIME=OFF -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -G "NMake Makefiles" ..
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to generate makefiles for libedit"
+    exit /b 1
+)
+
+nmake
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile libedit"
+    exit /b 1
+)
+
+nmake install
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install libedit"
+    exit /b 1
+)
+
+2>nul mkdir "%BINARIESDIR%\%LIBEDIT_DIR_NAME%" && cd "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
+if %ERRORLEVEL% == 0 (
+    for %%f in (bin32 include lib32) do (
+        robocopy /S %%f "%BINARIESDIR%\%LIBEDIT_DIR_NAME%\%%f"
+        if %ERRORLEVEL% GTR 1 (
+            goto exitloop
+        ) else (
+           set ERRORLEVEL=0
+        )
+    )
+)
+:exitloop
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy bin32, include and lib32 from %BINARIESDIR%\wineditline-%LIBEDIT_VERSION% to %BINARIESDIR%\%LIBEDIT_DIR_NAME%"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
+
+exit /b 0
+

+ 105 - 0
.appveyor/build_libical.bat

@@ -0,0 +1,105 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined LIBICAL_VERSION (
+    echo "Please set LIBICAL_VERSION to libical version!"
+    exit /b 1
+)
+
+set LIBICAL_DIR_NAME=libical
+set BUILD_TYPE=Release
+if %DO_DEBUG_BUILD% EQU 1 (
+    set LIBICAL_DIR_NAME=libical_debug
+    set BUILD_TYPE=Debug
+)
+
+if exist "%BINARIESDIR%\%LIBICAL_DIR_NAME%" (
+    echo "%BINARIESDIR%\%LIBICAL_DIR_NAME% exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\libical-%LIBICAL_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\libical-%LIBICAL_VERSION%.zip" https://github.com/libical/libical/archive/v%LIBICAL_VERSION%.zip
+    if not exist "%BINARIESDIR%\libical-%LIBICAL_VERSION%.zip" (
+        echo "Failed to download libical"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\libical-%LIBICAL_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\libical-%LIBICAL_VERSION%.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\libical-%LIBICAL_VERSION%.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\libical-%LIBICAL_VERSION%" (
+    echo "Could not find %BINARIESDIR%\libical-%LIBICAL_VERSION%"
+    exit /b 1
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\libical-%LIBICAL_VERSION%\build"
+mkdir "%BINARIESDIR%\libical-%LIBICAL_VERSION%\build"
+cd "%BINARIESDIR%\libical-%LIBICAL_VERSION%\build"
+
+call "%VS90COMNTOOLS%vsvars32.bat"
+
+"%CMAKE_BIN%" -DCMAKE_INSTALL_PREFIX="%BINARIESDIR%\%LIBICAL_DIR_NAME%" -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DUSE_32BIT_TIME_T=True ..
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to generate makefiles for libical"
+    exit /b 1
+)
+nmake
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile libical"
+    exit /b 1
+)
+nmake install
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install libical"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\libical-%LIBICAL_VERSION%"
+
+exit /b 0
+

+ 105 - 0
.appveyor/build_pgsql.bat

@@ -0,0 +1,105 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined PGSQL_VERSION (
+    echo "Please set PGSQL_VERSION to PostgreSQL version!"
+    exit /b 1
+)
+
+set PGSQL_DIR_NAME=pgsql
+set BUILD_TYPE=
+if %DO_DEBUG_BUILD% EQU 1 (
+    set PGSQL_DIR_NAME=pgsql_debug
+    set BUILD_TYPE=DEBUG
+)
+
+if exist "%BINARIESDIR%\%PGSQL_DIR_NAME%" (
+    echo "%BINARIESDIR%\%PGSQL_DIR_NAME% exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\postgresql-%PGSQL_VERSION%.tar.bz2" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\postgresql-%PGSQL_VERSION%.tar.bz2" https://ftp.postgresql.org/pub/source/v%PGSQL_VERSION%/postgresql-%PGSQL_VERSION%.tar.bz2
+    if not exist "%BINARIESDIR%\postgresql-%PGSQL_VERSION%.tar.bz2" (
+        echo "Failed to download postgresql"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\postgresql-%PGSQL_VERSION%"
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/\" && tar -xf postgresql-%PGSQL_VERSION%.tar.bz2"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\postgresql-%PGSQL_VERSION%.tar.bz2"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\postgresql-%PGSQL_VERSION%" (
+    echo "Could not find %BINARIESDIR%\postgresql-%PGSQL_VERSION%"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\postgresql-%PGSQL_VERSION%\src\tools\msvc" (
+    echo "Could not find %BINARIESDIR%\postgresql-%PGSQL_VERSION%\src\tools\msvc"
+    exit /b 1
+)
+
+call "%VS90COMNTOOLS%vsvars32.bat"
+
+cd "%BINARIESDIR%\postgresql-%PGSQL_VERSION%\src\tools\msvc"
+
+call "%BINARIESDIR%\postgresql-%PGSQL_VERSION%\src\tools\msvc\build.bat" %BUILD_TYPE%
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile pgsql"
+    exit /b 1
+)
+
+REM This is for Perl to find ./inc/Module/Install.pm, see header of http://cpansearch.perl.org/src/AUDREYT/Module-Install-0.64/lib/Module/Install.pm
+set PERL5LIB=.
+call "%BINARIESDIR%\postgresql-%PGSQL_VERSION%\src\tools\msvc\install.bat" "%BINARIESDIR%\%PGSQL_DIR_NAME%"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install pgsql"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\postgresql-%PGSQL_VERSION%"
+
+exit /b 0
+

+ 58 - 0
.appveyor/build_python.bat

@@ -0,0 +1,58 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0_build_python_32bit.bat" %~1
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python 32bit"
+    exit /b 1
+)
+
+call "%~dp0_build_python_64bit.bat" %~1
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python 64bit"
+    exit /b 1
+)
+
+call "%~dp0_build_python_debug.bat" %~1
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile Python debug version"
+    exit /b 1
+)
+
+exit /b 0
+

+ 107 - 0
.appveyor/build_ssl.bat

@@ -0,0 +1,107 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined OPENSSL_VERSION (
+    echo "Please set OPENSSL_VERSION to OpenSSL version!"
+    exit /b 1
+)
+
+set OPENSSL_DIR_NAME=openssl
+if %DO_DEBUG_BUILD% EQU 1 (
+    set OPENSSL_DIR_NAME=openssl_debug
+)
+
+if exist "%BINARIESDIR%\%OPENSSL_DIR_NAME%" (
+    echo "%BINARIESDIR%\%OPENSSL_DIR_NAME% exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\OpenSSL_%OPENSSL_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\OpenSSL_%OPENSSL_VERSION%.zip" https://github.com/openssl/openssl/archive/OpenSSL_%OPENSSL_VERSION%.zip
+    if not exist "%BINARIESDIR%\OpenSSL_%OPENSSL_VERSION%.zip" (
+        echo "Failed to download openssl"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\OpenSSL_%OPENSSL_VERSION%.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%" (
+    echo "Could not find %BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%"
+
+call "%VS90COMNTOOLS%vsvars32.bat
+
+if %DO_DEBUG_BUILD% EQU 1 (
+    "%PERL_BIN%" "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%\Configure" --prefix="%BINARIESDIR%\%OPENSSL_DIR_NAME%" --debug VC-WIN32 no-asm no-shared
+) else (
+    "%PERL_BIN%" "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%\Configure" --prefix="%BINARIESDIR%\%OPENSSL_DIR_NAME%" VC-WIN32 no-asm no-shared
+)
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to generate makefiles for openssl"
+    exit /b 1
+)
+
+nmake
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile openssl"
+    exit /b 1
+)
+
+nmake install
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install openssl"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\openssl-OpenSSL_%OPENSSL_VERSION%"
+
+exit /b 0
+

+ 140 - 0
.appveyor/build_swig.bat

@@ -0,0 +1,140 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined SWIG_VERSION (
+    echo "Please set SWIG_VERSION to Swig version!"
+    exit /b 1
+)
+
+if exist "%BINARIESDIR%\swig" (
+    echo "%BINARIESDIR%\swig exist already!"
+    exit /b 0
+)
+
+if exist "%BINARIESDIR%\python\python.exe" (
+    echo "Found Python installation at %BINARIESDIR%\python, using it to add Python support in swig"
+    set PYTHON_INSTALL_DIR="%BINARIESDIR_M%/python/python.exe"
+) else if exist "C:\Python27\python.exe" (
+    echo "Found Python installation at C:\Python27, using it to add Python support in swig"
+    set PYTHON_INSTALL_DIR=/c/Python27/python.exe
+) else (
+    echo "Could not find Python installation, required to add Python support in swig"
+    exit /b 1
+)
+
+if not exist "%BINARIESDIR%\swig-rel-%SWIG_VERSION%.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\swig-rel-%SWIG_VERSION%.zip" https://github.com/swig/swig/archive/rel-%SWIG_VERSION%.zip
+    if not exist "%BINARIESDIR%\swig-rel-%SWIG_VERSION%.zip" (
+        echo "Failed to download swig"
+        exit /b 1
+    )
+)
+REM CCCL is Unix cc compiler to Microsoft's cl compiler wrapper
+REM and it is require to generate native swig windows binary which doesn't depend on any of MinGW DLLs
+if not exist "%BINARIESDIR%\cccl-1.0.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\cccl-1.0.zip" https://github.com/swig/cccl/archive/cccl-1.0.zip
+    if not exist "%BINARIESDIR%\cccl-1.0.zip" (
+        echo "Failed to download cccl"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\cccl-cccl-1.0"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\cccl-1.0.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\cccl-1.0.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\cccl-cccl-1.0" (
+    echo "Could not find %BINARIESDIR%\cccl-cccl-1.0"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\cccl-cccl-1.0\cccl" (
+    echo "Could not find %BINARIESDIR%\cccl-cccl-1.0\cccl"
+    exit /b 1
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\swig-rel-%SWIG_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\swig-rel-%SWIG_VERSION%.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\swig-rel-%SWIG_VERSION%.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\swig-rel-%SWIG_VERSION%" (
+    echo "Could not find %BINARIESDIR%\swig-rel-%SWIG_VERSION%"
+    exit /b 1
+)
+
+call "%VS90COMNTOOLS%\vsvars32.bat
+
+"%MSYSDIR%\bin\bash" --login -i -c "cp -f \"$BINARIESDIR_M/cccl-cccl-1.0/cccl\" /usr/bin/cccl && chmod +x /usr/bin/cccl"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to copy cccl from %BINARIESDIR%\cccl-cccl-1.0\cccl to /usr/bin/cccl in MSYS bash"
+    exit /b 1
+)
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/swig-rel-$SWIG_VERSION\" && ./autogen.sh"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to generate configure for swig"
+    exit /b 1
+)
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/swig-rel-$SWIG_VERSION\" && ./configure CC=cccl CXX=cccl CFLAGS='-O2' CXXFLAGS='-O2' LDFLAGS='--cccl-link /LTCG' --prefix=\"$BINARIESDIR_M/swig\" --without-alllang --with-python=\"$PYTHON_INSTALL_DIR\" --disable-dependency-tracking --disable-ccache --without-pcre"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to generate makefiles for swig"
+    exit /b 1
+)
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/swig-rel-$SWIG_VERSION\" && make"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile swig"
+    exit /b 1
+)
+"%MSYSDIR%\bin\bash" --login -i -c "cd \"$BINARIESDIR_M/swig-rel-$SWIG_VERSION\" && make install"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install swig"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\cccl-cccl-1.0"
+2>nul rd /S /Q "%BINARIESDIR%\swig-rel-%SWIG_VERSION%"
+
+exit /b 0
+

+ 158 - 0
.appveyor/build_tcltk.bat

@@ -0,0 +1,158 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+call "%~dp0set_paths.bat" %~1
+
+cd "%BINARIESDIR%"
+
+if not defined TCL_VERSION (
+    echo "Please set TCL_VERSION to Tcl version!"
+    exit /b 1
+)
+if not defined TK_VERSION (
+    echo "Please set TK_VERSION to Tk version!"
+    exit /b 1
+)
+
+set TCLTK_DIR_NAME=tcltk
+if %DO_DEBUG_BUILD% EQU 1 (
+    set TCLTK_DIR_NAME=tcltk_debug
+)
+set PGSQL_DIR_NAME=pgsql
+if %DO_DEBUG_BUILD% EQU 1 (
+    set PGSQL_DIR_NAME=pgsql_debug
+)
+
+if exist "%BINARIESDIR%\%TCLTK_DIR_NAME%" (
+    echo "%BINARIESDIR%\%TCLTK_DIR_NAME% exist already!"
+    exit /b 0
+)
+
+if not exist "%BINARIESDIR%\tcl%TCL_VERSION:.=%-src.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\tcl%TCL_VERSION:.=%-src.zip" https://sourceforge.net/projects/tcl/files/Tcl/%TCL_VERSION%/tcl%TCL_VERSION:.=%-src.zip/download
+    if not exist "%BINARIESDIR%\tcl%TCL_VERSION:.=%-src.zip" (
+        echo "Failed to download tcl"
+        exit /b 1
+    )
+)
+if not exist "%BINARIESDIR%\tk%TK_VERSION:.=%-src.zip" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\tk%TK_VERSION:.=%-src.zip" https://sourceforge.net/projects/tcl/files/Tcl/%TK_VERSION%/tk%TK_VERSION:.=%-src.zip/download
+    if not exist "%BINARIESDIR%\tk%TK_VERSION:.=%-src.zip" (
+        echo "Failed to download tk"
+        exit /b 1
+    )
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\tcl%TCL_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\tcl%TCL_VERSION:.=%-src.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\tcl%TCL_VERSION:.=%-src.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\tcl%TCL_VERSION%" (
+    echo "Could not find %BINARIESDIR%\tcl%TCL_VERSION%"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\tcl%TCL_VERSION%\win" (
+    echo "Could not find %BINARIESDIR%\tcl%TCL_VERSION%\win"
+    exit /b 1
+)
+
+2>nul rd /S /Q "%BINARIESDIR%\tk%TK_VERSION%"
+"%UNZIP_BIN%" -q "%BINARIESDIR%\tk%TK_VERSION:.=%-src.zip"
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to extract %BINARIESDIR%\tk%TK_VERSION:.=%-src.zip"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\tk%TK_VERSION%" (
+    echo "Could not find %BINARIESDIR%\tk%TK_VERSION%"
+    exit /b 1
+)
+if not exist "%BINARIESDIR%\tk%TK_VERSION%\win" (
+    echo "Could not find %BINARIESDIR%\tk%TK_VERSION%\win"
+    exit /b 1
+)
+
+call "%VS90COMNTOOLS%vsvars32.bat"
+
+cd  "%BINARIESDIR%\tcl%TCL_VERSION%\win"
+if %DO_DEBUG_BUILD% EQU 1 (
+    nmake /f "%BINARIESDIR%\tcl%TCL_VERSION%\win\makefile.vc" OPTS=symbols
+) else (
+    nmake /f "%BINARIESDIR%\tcl%TCL_VERSION%\win\makefile.vc"
+)
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile tcl"
+    exit /b 1
+)
+if %DO_DEBUG_BUILD% EQU 1 (
+    nmake /f "%BINARIESDIR%\tcl%TCL_VERSION%\win\makefile.vc" install OPTS=symbols INSTALLDIR="%BINARIESDIR%\%TCLTK_DIR_NAME%"
+) else (
+    nmake /f "%BINARIESDIR%\tcl%TCL_VERSION%\win\makefile.vc" install INSTALLDIR="%BINARIESDIR%\%TCLTK_DIR_NAME%"
+)
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install tcl"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%\tk%TK_VERSION%\win"
+set TCLDIR=%BINARIESDIR%\tcl%TCL_VERSION%
+if %DO_DEBUG_BUILD% EQU 1 (
+    nmake /f "%BINARIESDIR%\tk%TK_VERSION%\win\makefile.vc" OPTS=symbols
+) else (
+    nmake /f "%BINARIESDIR%\tk%TK_VERSION%\win\makefile.vc"
+)
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to compile tk"
+    exit /b 1
+)
+if %DO_DEBUG_BUILD% EQU 1 (
+    nmake /f "%BINARIESDIR%\tk%TK_VERSION%\win\makefile.vc" install OPTS=symbols INSTALLDIR="%BINARIESDIR%\%TCLTK_DIR_NAME%"
+) else (
+    nmake /f "%BINARIESDIR%\tk%TK_VERSION%\win\makefile.vc" install INSTALLDIR="%BINARIESDIR%\%TCLTK_DIR_NAME%"
+)
+if not %ERRORLEVEL% == 0 (
+    echo "Failed to install tk"
+    exit /b 1
+)
+
+cd "%BINARIESDIR%"
+2>nul rd /S /Q "%BINARIESDIR%\tcl%TCL_VERSION%"
+2>nul rd /S /Q "%BINARIESDIR%\tk%TK_VERSION%"
+
+exit /b 0

+ 70 - 0
.appveyor/generate_installer.bat

@@ -0,0 +1,70 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo on
+setlocal
+
+1>nul 2>nul call "%~dp0set_paths.bat" %~1
+
+if defined WIX (
+	set "PATH=%WIX%bin;%PATH%"
+)
+
+call "%~dp0..\..\pbspro\win_configure\msi\wix\prep.bat" "%BINARIESDIR%" %~1
+if not %ERRORLEVEL% == 0 (
+    echo Failed to prepare PBS_EXEC!
+    exit /b 1
+)
+
+if not exist "%BINARIESDIR%\vcredist_x86.exe" (
+    "%CURL_BIN%" -qkL -o "%BINARIESDIR%\vcredist_x86.exe" https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe
+    if not exist "%BINARIESDIR%\vcredist_x86.exe" (
+        echo "Failed to download Microsoft Visual C++ 2010 Redistributable Package (x86)"
+        exit /b 1
+    )
+)
+
+1>nul copy /B /Y "%BINARIESDIR%\vcredist_x86.exe" "%~dp0..\..\PBS\exec\etc\vcredist_x86.exe"
+
+call "%~dp0..\..\pbspro\win_configure\msi\wix\create_msi.bat" %~1
+if not %ERRORLEVEL% == 0 (
+    echo Failed to generate PBS Pro MSI!
+    exit /b 1
+)
+
+dir "%~dp0..\..\win_build\msi"
+
+exit /b 0
+

+ 121 - 0
.appveyor/set_paths.bat

@@ -0,0 +1,121 @@
+@echo off
+REM Copyright (C) 1994-2017 Altair Engineering, Inc.
+REM For more information, contact Altair at www.altair.com.
+REM
+REM This file is part of the PBS Professional ("PBS Pro") software.
+REM
+REM Open Source License Information:
+REM
+REM PBS Pro is free software. You can redistribute it and/or modify it under the
+REM terms of the GNU Affero General Public License as published by the Free
+REM Software Foundation, either version 3 of the License, or (at your option) any
+REM later version.
+REM
+REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+REM PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+REM
+REM You should have received a copy of the GNU Affero General Public License along
+REM with this program.  If not, see <http://www.gnu.org/licenses/>.
+REM
+REM Commercial License Information:
+REM
+REM The PBS Pro software is licensed under the terms of the GNU Affero General
+REM Public License agreement ("AGPL"), except where a separate commercial license
+REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+REM
+REM Altair’s dual-license business model allows companies, individuals, and
+REM organizations to create proprietary derivative works of PBS Pro and distribute
+REM them - whether embedded or bundled with other software - under a commercial
+REM license agreement.
+REM
+REM Use of Altair’s trademarks, including but not limited to "PBS™",
+REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+REM trademark licensing policies.
+
+@echo off
+set __OLD_DIR="%CD%"
+cd "%~dp0..\.."
+
+REM SVN is used by Python internally, to download it's dependencies
+if not defined SVN_BIN (
+    set SVN_BIN=svn
+)
+if not defined CURL_BIN (
+    set CURL_BIN=curl
+)
+if not defined UNZIP_BIN (
+    set UNZIP_BIN=unzip
+)
+if not defined MSYSDIR (
+    set MSYSDIR=C:\MinGW\msys\1.0
+)
+if not defined PERL_BIN (
+    set PERL_BIN=perl
+)
+if not defined CMAKE_BIN (
+    set CMAKE_BIN=cmake
+)
+if not defined __BINARIESDIR (
+    set __BINARIESDIR=%CD%\binaries
+)
+if exist "%VS90COMNTOOLS%vsvars32.bat" (
+    call "%VS90COMNTOOLS%vsvars32.bat"
+) else (
+    echo "Could not find %VS90COMNTOOLS%vsvars32.bat"
+    exit 1
+)
+
+set __RANDOM_VAL=%RANDOM::=_%
+set __RANDOM_VAL-%RANDOM_VAL:.=%
+set __BINARIESJUNCTION=%__BINARIESDIR:~0,2%\__withoutspace_binariesdir_%__RANDOM_VAL%
+if not exist "%__BINARIESDIR%" (
+    mkdir "%__BINARIESDIR%"
+)
+if not "%__BINARIESDIR: =%"=="%__BINARIESDIR%" (
+    mklink /J %__BINARIESJUNCTION% "%__BINARIESDIR%"
+    if not %ERRORLEVEL% == 0 (
+        echo "Could not create junction to %__BINARIESJUNCTION% to %__BINARIESDIR% which contains space"
+        exit 1
+    )
+    cd %__BINARIESJUNCTION%
+) else (
+    cd %__BINARIESDIR%
+)
+set BINARIESDIR=%CD%
+for /F "usebackq tokens=*" %%i in (`""%MSYSDIR%\bin\bash.exe" -c "pwd""`) do set BINARIESDIR_M=%%i
+
+if not defined LIBEDIT_VERSION (
+    set LIBEDIT_VERSION=2.204
+)
+if not defined LIBICAL_VERSION (
+    set LIBICAL_VERSION=1.0.1
+)
+if not defined PGSQL_VERSION (
+    set PGSQL_VERSION=9.6.3
+)
+if not defined PYTHON_VERSION (
+    set PYTHON_VERSION=2.7.13
+)
+if not defined OPENSSL_VERSION (
+    set OPENSSL_VERSION=1_1_0f
+)
+if not defined SWIG_VERSION (
+    set SWIG_VERSION=3.0.12
+)
+if not defined TCL_VERSION (
+    set TCL_VERSION=8.6.6
+)
+if not defined TK_VERSION (
+    set TK_VERSION=8.6.6
+)
+
+set DO_DEBUG_BUILD=0
+if "%~1"=="debug" (
+    set DO_DEBUG_BUILD=1
+)
+if "%~1"=="Debug" (
+    set DO_DEBUG_BUILD=1
+)
+
+cd %__OLD_DIR%

+ 74 - 0
.appveyor/simple_hook.py

@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+import pbs
+
+e = pbs.event()
+if e.type == pbs.RESVSUB:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is resvsub")
+elif e.type == pbs.RESV_END:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is resv_end")
+elif e.type == pbs.QUEUEJOB:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is queuejob")
+elif e.type == pbs.MODIFYJOB:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is modifyjob")
+elif e.type == pbs.MOVEJOB:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is movejob")
+elif e.type == pbs.RUNJOB:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is runjob")
+elif e.type == pbs.PERIODIC:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is periodic")
+elif e.type == pbs.EXECJOB_BEGIN:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_begin")
+elif e.type == pbs.EXECJOB_PROLOGUE:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_prologue")
+elif e.type == pbs.EXECJOB_LAUNCH:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_launch")
+elif e.type == pbs.EXECJOB_ATTACH:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_attach")
+elif e.type == pbs.EXECJOB_PRETERM:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_preterm")
+elif e.type == pbs.EXECJOB_EPILOGUE:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_epilogue")
+elif e.type == pbs.EXECJOB_END:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is execjob_end")
+elif e.type == pbs.EXECHOST_STARTUP:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is exechost_startup")
+elif e.type == pbs.EXECHOST_PERIODIC:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is exechost_periodic")
+else:
+    pbs.logmsg(pbs.LOG_DEBUG, "hook event type is unknown")
+e.accept()

+ 3 - 0
.github/CODE_OF_CONDUCT.md

@@ -0,0 +1,3 @@
+### PBS Professional Open Source Project Code of Conduct
+
+Please see the Contributor's Portal for our **[Code of Conduct](https://pbspro.atlassian.net/wiki/spaces/PBSPro/pages/5537835/Code+of+Conduct)**.

+ 6 - 0
.github/CONTRIBUTING.md

@@ -0,0 +1,6 @@
+### Contributing to the PBS Professional Open Source Project
+
+We're so happy that you want to contribute to PBS Pro!
+
+Please see the Contributor's Portal for details, guidelines, and how-to tutorials.  Start at **[Becoming a Contributor to PBS Pro](https://pbspro.atlassian.net/wiki/spaces/DG/pages/20414474/Becoming+a+Contributor+to+PBS+Pro)**.
+

+ 39 - 0
.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,39 @@
+<!--- Please review your changes in preview mode -->
+<!--- Provide a general summary of your changes in the Title above -->
+
+#### Bug/feature Description
+* *Clearly and concisely describe the problem/feature as it affects the customer (this cannot be empty)*
+* *Bugs: clearly describe the steps to easily reproduce the problem; you can include short illustrative excerpts from log files or terminal sessions*
+* *Bugs: if the issue is intermittent and not easily reproducible, describe the situation/scenarios/configurations where it was likely triggered*
+* *If there is an issue ID, link to it: [PP-XXXX](https://pbspro.atlassian.net/browse/PP-XXXX)*
+
+#### Affected Platform(s)
+* *Platform (for example CentOS 7.2)*
+
+#### Cause / Analysis / Design
+* *If there is an external design, link to it **[project documentation area](https://pbspro.atlassian.net/wiki/display/PD)***
+* *If there is a discussion on the Forum, link to it **[pbspro community forum](http://community.pbspro.org/)***
+* *Bugs: briefly describe root cause/analysis of the problem*
+
+#### Solution Description
+* *Please describe your code changes in detail for reviewers*
+
+#### Testing logs/output
+* *Please attach your test log output from running the test you added (or from existing tests that cover your changes)*
+
+#### Checklist:
+<!--- Use the preview button to see the checkboxes/links properly. -->
+<!--- Go over the following points, and put an `x` (without spaces around it) in the boxes that apply. -->
+<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
+- [ ] I have joined the **[pbspro community forum](http://community.pbspro.org/)**.
+- [ ] My pull request contains a **single, signed** commit. See **[setting up gpg signature](https://pbspro.atlassian.net/wiki/display/DG/Signing+Your+Git+Commits)**.
+- [ ] My code follows the **[coding style](https://pbspro.atlassian.net/wiki/display/DG/Coding+Standards)** of this project.
+- [ ] My change requires project documentation. See **[required documentation checklist](https://pbspro.atlassian.net/wiki/display/DG/Checklist+for+Developing+Features+and+Bug+Fixes)** for details.
+   - [ ] I have added documentation in the **[project documentation area](https://pbspro.atlassian.net/wiki/display/PD)**.
+- [ ] I have added new **PTL test(s) to my commit**. (See **[using PTL for testing](https://pbspro.atlassian.net/wiki/display/DG/Using+PTL+for+Testing)**) *(or)*
+   - [ ] I have added  **manual test(s) to this pull request and explained why PTL is not appropriate** for this case.
+- [ ] All new and existing automated tests have passed. (See **[running automated PTL tests](https://pbspro.atlassian.net/wiki/display/DG/PTL+Quick+Start+Guide)**).
+- [ ] I have attached **test logs to this pull request** as evidence of testing/verification.
+
+
+__***For further information please visit the [Developer Guide Home](https://pbspro.atlassian.net/wiki/display/DG/Developer+Guide+Home).***__

+ 98 - 0
.github/checkpep8

@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# Copyright (C) 1994-2017 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# The PBS Pro software is licensed under the terms of the GNU Affero General
+# Public License agreement ("AGPL"), except where a separate commercial license
+# agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and distribute
+# them - whether embedded or bundled with other software - under a commercial
+# license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+checkdir="$(readlink -f $(dirname $0))"
+errors=0
+
+which pep8 1>/dev/null 2>/dev/null
+if [ $? -ne 0 ]; then
+    echo "Could not find pep8 command" 1>&2
+    exit 1
+fi
+
+cd ${checkdir}/..
+
+is_python_file() {
+    name=$(basename ${1})
+
+    # special case
+    # if .rst file then it will be considered
+    # as a  plain text file
+    if [ "x${name##*.}" == "xrst" ]; then
+        return 1
+    fi
+
+    # special case
+    # if __init__.py does not contain any code then file
+    # command will consider it as plain text file
+    if [ "x${name}" == "x__init__.py" ]; then
+        return 0
+    fi
+
+    if [ "x$(file --mime-type -b ${1})" == "xtext/x-python" ]; then
+        return 0
+    fi
+    return 1
+
+}
+
+check_pep8() {
+    pep8 --show-source ${1} >out_check_pep8 2>&1
+    return $?
+}
+
+for f in $(find test -type f)
+do
+    if is_python_file ${f}
+    then
+        if ! check_pep8 ${f}
+        then
+            cat out_check_pep8 1>&2
+            rm -f out_check_pep8
+            errors=$((errors + 1))
+        fi
+        if [ -x "${f}" ]; then
+            echo "${f}: executable bit set" 1>&2
+            errors=$((errors + 1))
+        fi
+    fi
+done
+
+if [ ${errors} -ne 0 ]; then
+    exit 1
+else
+    exit 0
+fi

+ 67 - 0
.github/runchecks

@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# The PBS Pro software is licensed under the terms of the GNU Affero General
+# Public License agreement ("AGPL"), except where a separate commercial license
+# agreement for PBS Pro version 14 or later has been executed in writing with Altair.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and distribute
+# them - whether embedded or bundled with other software - under a commercial
+# license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+
+declare -a listofchecks
+listofchecks[0]="checkpep8"
+
+checkdir=$(readlink -f $(dirname $0))
+errors_fails=0
+
+for check in ${listofchecks[@]}
+do
+    echo -n "Running check: '${check}' ... "
+    if [ ! -x "${checkdir}/${check}" ]; then
+        echo "NOTFOUND"
+        errors_fails=$((errors_fails + 1))
+        continue
+    fi
+    ${checkdir}/${check} >out 2>err
+    if [ $? -ne 0 ]; then
+        echo "FAILED"
+        cat err
+        errors_fails=$((errors_fails + 1))
+    else
+        echo "OK"
+        cat out
+    fi
+done
+
+if [ ${errors_fails} -ne 0 ]; then
+    exit 1
+else
+    exit 0
+fi

+ 256 - 0
.gitignore

@@ -0,0 +1,256 @@
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+*.slo
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+*.lai
+
+# module files
+*.mod
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+
+# Eclipse project files
+.project
+.cproject
+.pydevproject
+.settings/
+.autotools
+.csettings/
+
+# Files used by ctags
+tags
+
+# Files used by cscope
+cscope.files
+cscope.out
+
+#Visual Studio files
+*.user
+*.ncb
+*.suo
+.vscode/
+
+# Files used by gtags
+GPATH
+GRTAGS
+GTAGS
+
+# Files/Directory generated by PBSTestLab
+ptl_test_results.html
+test/fw/build/
+test/fw/ptl/__init__.py
+test/fw/setup.py
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# Python Distribution / packaging
+.Python
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+sdist/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# pip Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+*.log
+
+# Build directory
+target/
+
+#PyCharm project directory
+.idea/
+
+# From automake/autoconf
+autom4te.cache/
+autoscan.log
+autoscan-*.log
+configure.scan
+config.status
+aclocal.m4
+buildutils/config.guess
+buildutils/config.sub
+
+# Libtool
+libtool
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
+buildutils/ltmain.sh
+
+# Build related files
+configure
+Makefile.in
+Makefile
+*.deps
+buildutils/pbs_mkdirs
+
+# Generated binaries
+
+src/cmds/mpiexec
+src/cmds/nqs2pbs
+src/cmds/pbs_attach
+src/cmds/pbs_demux
+src/cmds/pbs_ds_password.bin
+src/cmds/pbs_lamboot
+src/cmds/pbs_migrate_users
+src/cmds/pbs_mpihp
+src/cmds/pbs_mpilam
+src/cmds/pbs_mpirun
+src/cmds/pbs_password
+src/cmds/pbs_rdel
+src/cmds/pbs_remsh
+src/cmds/pbs_rstat
+src/cmds/pbs_rsub
+src/cmds/pbs_ralter
+src/cmds/pbs_tmrsh
+src/cmds/pbsdsh
+src/cmds/pbsnodes
+src/cmds/pbs_release_nodes
+src/cmds/pbsrun
+src/cmds/pbsrun_unwrap
+src/cmds/pbsrun_wrap
+src/cmds/qalter
+src/cmds/qdel
+src/cmds/qdisable
+src/cmds/qenable
+src/cmds/qhold
+src/cmds/qmgr
+src/cmds/qmove
+src/cmds/qmsg
+src/cmds/qorder
+src/cmds/qrerun
+src/cmds/qrls
+src/cmds/qrun
+src/cmds/qselect
+src/cmds/qsig
+src/cmds/qstart
+src/cmds/qstat
+src/cmds/qstop
+src/cmds/qsub
+src/cmds/qterm
+src/cmds/scripts/au-nodeupdate
+src/cmds/scripts/limits.pbs_mom
+src/cmds/scripts/limits.post_services
+src/cmds/scripts/pbs_habitat
+src/cmds/scripts/pbs_init.d
+src/cmds/scripts/pbs_poerun
+src/cmds/scripts/pbs_postinstall
+src/cmds/scripts/pbsrun.poe
+src/iff/pbs_iff
+src/mom_rcp/pbs_rcp
+src/resmom/pbs_mom
+src/scheduler/pbs_sched
+src/scheduler/pbsfs
+src/server/pbs_comm
+src/server/pbs_server.bin
+src/tools/pbs_ds_monitor
+src/tools/pbs_hostn
+src/tools/pbs_idled
+src/tools/pbs_probe
+src/tools/pbs_python
+src/tools/pbs_tclsh
+src/tools/pbs_upgrade_job
+src/tools/pbs_wish
+src/tools/printjob.bin
+src/tools/printjob_svr.bin
+src/tools/tracejob
+src/tools/wrap_tcl.sh
+src/tools/pbs_sleep
+src/unsupported/pbs_diag
+src/unsupported/pbs_dtj
+src/unsupported/pbs_rmget
+
+# Generated source files
+src/include/pbs_version.h
+src/include/pbs_config.h
+src/include/pbs_config.h.in
+src/include/pbs_config.h.in~
+src/lib/Libattr/queue_attr_def.c
+src/lib/Libattr/resc_def_all.c
+src/lib/Libattr/resv_attr_def.c
+src/lib/Libattr/sched_attr_def.c
+src/lib/Libattr/svr_attr_def.c
+src/lib/Libattr/job_attr_def.c
+src/lib/Libattr/node_attr_def.c
+src/lib/Libpbs/ecl_job_attr_def.c
+src/lib/Libpbs/ecl_node_attr_def.c
+src/lib/Libpbs/ecl_queue_attr_def.c
+src/lib/Libpbs/ecl_resc_def_all.c
+src/lib/Libpbs/ecl_resv_attr_def.c
+src/lib/Libpbs/ecl_sched_attr_def.c
+src/lib/Libpbs/ecl_svr_attr_def.c
+src/include/stamp-h1
+src/lib/Libpython/pbs_ifl.i
+src/lib/Libpython/pbs_ifl.py
+src/lib/Libpython/pbs_ifl_wrap.c
+
+#Generated source files - Windows
+src/lib/Libecl/ecl_node_attr_def.c
+src/lib/Libecl/ecl_job_attr_def.c
+src/lib/Libecl/ecl_queue_attr_def.c
+src/lib/Libecl/ecl_resc_def_all.c
+src/lib/Libecl/ecl_resv_attr_def.c
+src/lib/Libecl/ecl_sched_attr_def.c
+src/lib/Libecl/ecl_svr_attr_def.c
+win_configure/projects.VS2008/pbs_ifl.i
+win_configure/projects.VS2008/pbs_ifl.py
+win_configure/projects.VS2008/pbs_ifl_wrap.c
+
+# Generated scripts
+src/cmds/scripts/modulefile
+src/cmds/scripts/pbs.service
+
+# Generated by make dist
+*.tar.gz
+src/lib/Libpbs/pbs.pc
+
+# rpm spec file
+pbspro.spec
+
+# Other archive file types
+*.tar
+*.tar.bz
+*.tgz
+*.zip
+*.cpio
+*.rpm
+*.deb
+

+ 32 - 0
.travis.yml

@@ -0,0 +1,32 @@
+language: c
+sudo: required
+dist: trusty
+addons:
+    apt:
+      packages:
+        - docker-ce
+        - pep8
+services:
+    - docker
+env:
+    - OS_TYPE=centos:7
+    - OS_TYPE=opensuse/leap:15
+    - OS_TYPE=ubuntu:18.04
+    - OS_TYPE=debian:9
+    - OS_TYPE=centos:7 BUILD_MODE=_sanitize
+before_install:
+    - .github/runchecks
+    - export OS_TYPE_FILE=${OS_TYPE////_}
+    - export OS_TYPE_FILE=${OS_TYPE_FILE//./_}
+    - export OS_TYPE_FILE=${OS_TYPE_FILE//:/_}${BUILD_MODE}
+    - docker pull ${OS_TYPE}
+    - '[ "${OS_TYPE}" == "ubuntu:18.04" -o "${OS_TYPE}" == "debian:9" ] && export DOCKER_EXTRA_ARG="-e DEBIAN_FRONTEND=noninteractive" || true'
+    - docker run -it -d -h testdev.pbspro.org --name testdev -v $(pwd):$(pwd) --privileged -w $(pwd) ${DOCKER_EXTRA_ARG} ${OS_TYPE} /bin/bash
+    - docker ps -a
+    - export DOCKER_EXEC="docker exec -it ${DOCKER_EXTRA_ARG} --privileged testdev"
+install:
+    - ./.travis/${OS_TYPE_FILE}.sh
+    - docker exec -it -w $(pwd)/test/fw testdev pip install -r requirements.txt .
+    - docker exec -it testdev pbs_config --make-ug
+    - docker exec -it -w $(pwd)/test/tests testdev pbs_benchpress --tags=smoke
+script: true

+ 15 - 0
.travis/centos_7.sh

@@ -0,0 +1,15 @@
+#!/bin/bash -xe
+${DOCKER_EXEC} yum clean all
+${DOCKER_EXEC} yum -y update
+${DOCKER_EXEC} yum -y install yum-utils epel-release rpmdevtools
+${DOCKER_EXEC} rpmdev-setuptree
+${DOCKER_EXEC} yum-builddep -y ./pbspro.spec
+${DOCKER_EXEC} ./autogen.sh
+${DOCKER_EXEC} ./configure
+${DOCKER_EXEC} make dist
+${DOCKER_EXEC} /bin/bash -c 'cp -fv pbspro-*.tar.gz /root/rpmbuild/SOURCES/'
+${DOCKER_EXEC} /bin/bash -c 'CFLAGS="-g -O2 -Wall -Werror" rpmbuild -bb pbspro.spec'
+${DOCKER_EXEC} /bin/bash -c 'yum -y install /root/rpmbuild/RPMS/x86_64/pbspro-server-??.*.x86_64.rpm'
+${DOCKER_EXEC} /bin/bash -c 'sed -i "s@PBS_START_MOM=0@PBS_START_MOM=1@" /etc/pbs.conf'
+${DOCKER_EXEC} /etc/init.d/pbs start
+${DOCKER_EXEC} yum -y install python-pip sudo which net-tools man-db time.x86_64

+ 15 - 0
.travis/centos_7_sanitize.sh

@@ -0,0 +1,15 @@
+#!/bin/bash -xe
+${DOCKER_EXEC} yum clean all
+${DOCKER_EXEC} yum -y update
+${DOCKER_EXEC} yum -y install yum-utils epel-release rpmdevtools libasan llvm
+${DOCKER_EXEC} rpmdev-setuptree
+${DOCKER_EXEC} yum-builddep -y ./pbspro.spec
+${DOCKER_EXEC} ./autogen.sh
+${DOCKER_EXEC} ./configure
+${DOCKER_EXEC} make dist
+${DOCKER_EXEC} /bin/bash -c 'cp -fv pbspro-*.tar.gz /root/rpmbuild/SOURCES/'
+${DOCKER_EXEC} /bin/bash -c 'CFLAGS="-g -O2 -Wall -Werror -fsanitize=address -fno-omit-frame-pointer" rpmbuild -bb pbspro.spec'
+${DOCKER_EXEC} /bin/bash -c 'yum -y install /root/rpmbuild/RPMS/x86_64/pbspro-server-??.*.x86_64.rpm'
+${DOCKER_EXEC} /bin/bash -c 'sed -i "s@PBS_START_MOM=0@PBS_START_MOM=1@" /etc/pbs.conf'
+${DOCKER_EXEC} /etc/init.d/pbs start
+${DOCKER_EXEC} yum -y install python-pip sudo which net-tools man-db time.x86_64

+ 18 - 0
.travis/debian_9.sh

@@ -0,0 +1,18 @@
+#!/bin/bash -xe
+BUILDPKGS='build-essential dpkg-dev autoconf libtool rpm alien libssl-dev libxt-dev libpq-dev libexpat1-dev libedit-dev libncurses5-dev libical-dev libhwloc-dev pkg-config tcl-dev tk-dev python-dev swig'
+DEPPKGS='expat postgresql postgresql-contrib'
+TESTPKGS='python-pip sudo man-db'
+if [ "x${DEBIAN_FRONTEND}x" == "xx" ]; then
+  export DEBIAN_FRONTEND=noninteractive
+fi
+${DOCKER_EXEC} apt-get -qq update
+${DOCKER_EXEC} apt-get install -y ${BUILDPKGS} ${DEPPKGS} ${TESTPKGS}
+${DOCKER_EXEC} ./autogen.sh
+${DOCKER_EXEC} ./configure
+${DOCKER_EXEC} make dist
+${DOCKER_EXEC} /bin/bash -c 'mkdir -p /root/rpmbuild/SOURCES/; cp -fv pbspro-*.tar.gz /root/rpmbuild/SOURCES/'
+${DOCKER_EXEC} /bin/bash -c 'CFLAGS="-g -O2 -Wall -Werror" rpmbuild -bb --nodeps pbspro.spec'
+${DOCKER_EXEC} /bin/bash -c 'alien --to-deb --scripts /root/rpmbuild/RPMS/x86_64/pbspro-server-??.*.x86_64.rpm'
+${DOCKER_EXEC} /bin/bash -c 'dpkg -i pbspro-server_*_amd64.deb'
+${DOCKER_EXEC} /bin/bash -c 'sed -i "s@PBS_START_MOM=0@PBS_START_MOM=1@" /etc/pbs.conf'
+${DOCKER_EXEC} /etc/init.d/pbs start

+ 20 - 0
.travis/opensuse_leap_15.sh

@@ -0,0 +1,20 @@
+#!/bin/bash -xe
+PRETTY_NAME=$(${DOCKER_EXEC} cat /etc/os-release | awk -F[=\"] '/^PRETTY_NAME=/ {print $3}')
+PRETTY_NAME=${PRETTY_NAME# }
+PRETTY_NAME=${PRETTY_NAME% }
+${DOCKER_EXEC} zypper -n ar -f -G http://download.opensuse.org/repositories/devel:/tools/${PRETTY_NAME// /_}/devel:tools.repo
+${DOCKER_EXEC} zypper -n ar -f -G http://download.opensuse.org/repositories/devel:/libraries:/c_c++/${PRETTY_NAME// /_}/devel:libraries:c_c++.repo
+${DOCKER_EXEC} zypper -n ref
+${DOCKER_EXEC} zypper -n update
+${DOCKER_EXEC} zypper -n install rpmdevtools
+${DOCKER_EXEC} rpmdev-setuptree
+${DOCKER_EXEC} /bin/bash -c "zypper -n install --force-resolution \$(rpmspec --buildrequires -q pbspro.spec)"
+${DOCKER_EXEC} ./autogen.sh
+${DOCKER_EXEC} ./configure
+${DOCKER_EXEC} make dist
+${DOCKER_EXEC} /bin/bash -c 'cp -fv pbspro-*.tar.gz /root/rpmbuild/SOURCES/'
+${DOCKER_EXEC} /bin/bash -c 'CFLAGS="-g -O2 -Wall -Werror" rpmbuild -bb pbspro.spec'
+${DOCKER_EXEC} /bin/bash -c 'zypper --no-gpg-checks -n install /root/rpmbuild/RPMS/x86_64/pbspro-server-??.*.x86_64.rpm'
+${DOCKER_EXEC} /bin/bash -c 'sed -i "s@PBS_START_MOM=0@PBS_START_MOM=1@" /etc/pbs.conf'
+${DOCKER_EXEC} /etc/init.d/pbs start
+${DOCKER_EXEC} zypper -n install python-pip sudo which net-tools man time.x86_64

+ 18 - 0
.travis/ubuntu_18_04.sh

@@ -0,0 +1,18 @@
+#!/bin/bash -xe
+BUILDPKGS='build-essential dpkg-dev autoconf libtool rpm alien libssl-dev libxt-dev libpq-dev libexpat1-dev libedit-dev libncurses5-dev libical-dev libhwloc-dev pkg-config tcl-dev tk-dev python-dev swig'
+DEPPKGS='expat postgresql'
+TESTPKGS='python-pip sudo man-db'
+if [ "x${DEBIAN_FRONTEND}x" == "xx" ]; then
+  export DEBIAN_FRONTEND=noninteractive
+fi
+${DOCKER_EXEC} apt-get -qq update
+${DOCKER_EXEC} apt-get install -y ${BUILDPKGS} ${DEPPKGS} ${TESTPKGS}
+${DOCKER_EXEC} ./autogen.sh
+${DOCKER_EXEC} ./configure
+${DOCKER_EXEC} make dist
+${DOCKER_EXEC} /bin/bash -c 'mkdir -p /root/rpmbuild/SOURCES/; cp -fv pbspro-*.tar.gz /root/rpmbuild/SOURCES/'
+${DOCKER_EXEC} /bin/bash -c 'CFLAGS="-g -O2 -Wall -Werror -Wno-unused-result" rpmbuild -bb --nodeps pbspro.spec'
+${DOCKER_EXEC} /bin/bash -c 'alien --to-deb --scripts /root/rpmbuild/RPMS/x86_64/pbspro-server-??.*.x86_64.rpm'
+${DOCKER_EXEC} /bin/bash -c 'dpkg -i pbspro-server_*_amd64.deb'
+${DOCKER_EXEC} /bin/bash -c 'sed -i "s@PBS_START_MOM=0@PBS_START_MOM=1@" /etc/pbs.conf'
+${DOCKER_EXEC} /etc/init.d/pbs start

+ 36 - 0
COPYRIGHT

@@ -0,0 +1,36 @@
+
+Copyright (C) 1994-2018 Altair Engineering, Inc.
+For more information, contact Altair at www.altair.com.
+
+This file is part of the PBS Professional ("PBS Pro") software.
+
+Open Source License Information:
+
+PBS Pro is free software. You can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.
+See the GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Commercial License Information:
+
+For a copy of the commercial license terms and conditions,
+go to: (http://www.pbspro.com/UserArea/agreement.html)
+or contact the Altair Legal Department.
+
+Altair’s dual-license business model allows companies, individuals, and
+organizations to create proprietary derivative works of PBS Pro and
+distribute them - whether embedded or bundled with other software -
+under a commercial license agreement.
+
+Use of Altair’s trademarks, including but not limited to "PBS™",
+"PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+trademark licensing policies.
+

+ 237 - 0
INSTALL

@@ -0,0 +1,237 @@
+
+--------------------------------------------------------------------
+
+How to install PBS Pro using the configure script.
+
+1. Install the prerequisite packages for building PBS Pro.
+
+  For CentOS systems you should run the following command as root:
+
+    yum install -y gcc make rpm-build libtool hwloc-devel \
+      libX11-devel libXt-devel libedit-devel libical-devel \
+      ncurses-devel perl postgresql-devel postgresql-contrib python-devel tcl-devel \
+      tk-devel swig expat-devel openssl-devel libXext libXft \
+      autoconf automake
+
+  For openSUSE systems you should run the following command as root:
+
+    zypper install gcc make rpm-build libtool hwloc-devel \
+      libX11-devel libXt-devel libedit-devel libical-devel \
+      ncurses-devel perl postgresql-devel postgresql-contrib python-devel tcl-devel \
+      tk-devel swig libexpat-devel libopenssl-devel libXext-devel \
+      libXft-devel fontconfig autoconf automake
+
+  For Debian systems you should run the following command as root:
+
+    sudo apt-get install gcc make libtool libhwloc-dev libx11-dev \
+      libxt-dev libedit-dev libical-dev ncurses-dev perl \
+      postgresql-server-dev-all postgresql-contrib python-dev tcl-dev tk-dev swig \
+      libexpat-dev libssl-dev libxext-dev libxft-dev autoconf \
+      automake
+
+2. Install the prerequisite packages for running PBS Pro. In addition
+  to the commands below, you should also install a text editor of
+  your choosing (vim, emacs, gedit, etc.).
+
+  For CentOS systems you should run the following command as root:
+
+    yum install -y expat libedit postgresql-server postgresql-contrib python \
+      sendmail sudo tcl tk libical
+
+  For openSUSE systems you should run the following command as root:
+
+    zypper install expat libedit postgresql-server postgresql-contrib python \
+      sendmail sudo tcl tk libical1
+
+  For Debian systems you should run the following command as root:
+
+    apt-get install expat libedit2 postgresql python postgresql-contrib sendmail-bin \
+      sudo tcl tk libical1a
+
+3. Open a terminal as a normal (non-root) user, unpack the PBS Pro
+  tarball, and cd to the package directory.
+
+    tar -xpvf pbspro-19.1.3.tar.gz
+    cd pbspro-19.1.3
+
+4. Generate the configure script and Makefiles. (See note 1 below)
+
+    ./autogen.sh
+
+5. Display the available build parameters.
+
+    ./configure --help
+
+6. Configure the build for your environment. You may utilize the
+  parameters displayed in the previous step. (See note 2 below)
+
+  For CentOS and Debian systems you should run the following
+  command:
+
+    ./configure --prefix=/opt/pbs
+
+  For openSUSE systems (see note 3 below) you should run the
+  following command:
+
+    ./configure --prefix=/opt/pbs --libexecdir=/opt/pbs/libexec
+
+  If PTL needs to be installed along with pbspro use the option 
+  "--enable-ptl" (see note 5 below)
+    eg ./configure --prefix=/opt/pbs --enable-ptl
+
+7. Build PBS Pro by running "make". (See note 4 below)
+
+    make
+
+8. Configure sudo to allow your user account to run commands as
+  root. Refer to the online manual pages for sudo, sudoers, and
+  visudo.
+
+9. Install PBS Pro. Use sudo to run the command as root.
+
+    sudo make install
+
+10. Configure PBS Pro by executing the post-install script.
+
+    sudo /opt/pbs/libexec/pbs_postinstall
+
+11. Edit /etc/pbs.conf to configure the PBS Pro services that
+  should be started. If you are installing PBS Pro on only
+  one system, you should change the value of PBS_START_MOM
+  from zero to one. If you use vi as your editor, you would
+  run:
+
+    sudo vi /etc/pbs.conf
+
+12. Some file permissions must be modified to add SUID privilege.
+
+    sudo chmod 4755 /opt/pbs/sbin/pbs_iff /opt/pbs/sbin/pbs_rcp
+
+13. Start the PBS Pro services.
+
+    sudo /etc/init.d/pbs start
+
+14. All configured PBS services should now be running. Update
+  your PATH and MANPATH variables by sourcing the appropriate
+  PBS Pro profile or logging out and back in.
+
+  For Bourne shell (or similar) run the following:
+    . /etc/profile.d/pbs.sh
+
+  For C shell (or similar) run the following:
+    source /etc/profile.d/pbs.csh
+
+15. You should now be able to run PBS Pro commands to submit
+  and query jobs. Some examples follow.
+
+bash$ qstat -B
+Server             Max   Tot   Que   Run   Hld   Wat   Trn   Ext Status
+---------------- ----- ----- ----- ----- ----- ----- ----- ----- -----------
+host1                0     0     0     0     0     0     0     0 Active
+bash$ pbsnodes -a
+host1
+     Mom = host1
+     ntype = PBS
+     state = free
+     pcpus = 2
+     resources_available.arch = linux
+     resources_available.host = host1
+     resources_available.mem = 2049248kb
+     resources_available.ncpus = 2
+     resources_available.vnode = host1
+     resources_assigned.accelerator_memory = 0kb
+     resources_assigned.mem = 0kb
+     resources_assigned.naccelerators = 0
+     resources_assigned.ncpus = 0     
+     resources_assigned.vmem = 0kb
+     resv_enable = True
+     sharing = default_shared
+     license = l
+
+bash$ echo "sleep 60" | qsub
+0.host1
+bash$ qstat -a
+
+host1:
+                                                            Req'd  Req'd   Elap
+Job ID          Username Queue    Jobname    SessID NDS TSK Memory Time  S Time
+--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
+0.host1         mike     workq    STDIN        2122   1   1    --    --  R 00:00
+
+bash$
+
+--------------------------------------------------------------------
+
+NOTES:
+
+Note 1: If you modify configure.ac or adjust timestamps on any files
+  that are automatically generated, you will need to regenerate them
+  by re-running autogen.sh.
+
+Note 2: It is advisable to create a simple shell script that calls
+  configure with the appropriate options for your environment. This
+  ensures configure will be called with the same arguments during
+  subsequent invocations. If you have already run configure you can
+  regenerate all of the Makefiles by running "./config.status".
+  The first few lines of config.status will reveal the options that
+  were specified when configure was run. If you set envirnment
+  variables such as CFLAGS it is best to do so as an argument to
+  configure (e.g. ./configure CFLAGS="-O0 -g" --prefix=/opt/pbs).
+  This will ensure consistency when config.status regenerates the
+  Makefiles.
+
+Note 3: The openSUSE rpm package expands %_libexecdir to /opt/pbs/lib
+  rather than /opt/pbs/libexec which causes problems for the post-
+  install scripts. Providing the --libexecdir value to configure
+  overrides this behavior.
+
+Note 4: You need to use a POSIX (or nearly POSIX) make. GNU make
+  works quite well in this regard; BSD make does not. If you are
+  having any sort of build problems, your make should be a prime
+  suspect. Tremendous effort has been expended to provide proper
+  dependency generation and makefiles without relying on any
+  non-POSIX features. The build should work fine with a simple call
+  to make, however, complicating things by using various make flags
+  is not guaranteed to work. Don't be surprised if the first thing
+  that make does is call configure again.
+
+Note 5: PTL gets installed in the parent directory of where PBS Professional
+  is installed. For example if you have given install prefix=/opt/pbs, then 
+  you can find PTL installation in the directory /opt/ptl . You may need to 
+  log out and log in from the terminal for PATH and PYTHONPATH to update.
+
+
+
+Using valgrind with PBS Professional.
+-------------------------------------
+Here is a set of steps to detect memory errors/leaks within PBS code.
+
+1. Install the valgrind development package.
+
+   yum install valgrind-devel (zypper for OpenSUSE).
+
+
+2. Compile Python in a way that valgrind can work with it, as follows:
+
+   ./configure --prefix=<installdir> --without-pymalloc --with-pydebug --with-valgrind
+   make; make install
+
+
+3. Compile PBS Professional with the special python and in debug mode as follows:
+
+   ./configure --prefix=<installdir> --with-python=<python-dir>  CFLAGS="-g -DPy_DEBUG -DDEBUG -Wall -Werror"
+
+   
+4. Run pbs daemons under valgrind.
+   
+   a) To detect memory errors (not leaks) run pbs daemons as follows: 
+	
+   export LD_LIBRARY_PATH=/opt/pbs/pgsql/lib:/opt/pbs/lib:$LD_LIBRARY_PATH
+   valgrind --tool=memcheck --log-file=/tmp/val.out /opt/pbs/sbin/pbs_server.bin
+
+
+   b) To detect memory leaks use the supplied leaks suppression file valgrind.supp, as follows: 
+   
+   export LD_LIBRARY_PATH=/opt/pbs/pgsql/lib:/opt/pbs/lib:$LD_LIBRARY_PATH
+   valgrind --tool=memcheck --log-file=/tmp/val.out --suppressions=./valgrind.supp --leak-check=full --track-origins=yes /opt/pbs/sbin/pbs_server.bin
+

文件差异内容过多而无法显示
+ 1026 - 0
LICENSE


+ 50 - 0
Makefile.am

@@ -0,0 +1,50 @@
+
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = buildutils src doc test
+EXTRA_DIST = \
+	COPYRIGHT \
+	INSTALL \
+	LICENSE \
+	README \
+	autogen.sh \
+	pbspro-rpmlintrc \
+	pbspro.spec
+

+ 34 - 0
PBS_License.txt

@@ -0,0 +1,34 @@
+Copyright (C) 1994-2018 Altair Engineering, Inc.
+For more information, contact Altair at www.altair.com.
+
+This file is part of the PBS Professional ("PBS Pro") software.
+
+Open Source License Information:
+
+PBS Pro is free software. You can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.
+See the GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Commercial License Information:
+
+For a copy of the commercial license terms and conditions,
+go to: (http://www.pbspro.com/UserArea/agreement.html)
+or contact the Altair Legal Department.
+
+Altair’s dual-license business model allows companies, individuals, and
+organizations to create proprietary derivative works of PBS Pro and
+distribute them - whether embedded or bundled with other software -
+under a commercial license agreement.
+
+Use of Altair’s trademarks, including but not limited to "PBS™",
+"PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+trademark licensing policies.

+ 17 - 0
README

@@ -0,0 +1,17 @@
+
+Welcome to PBS Professional (PBS Pro).
+
+The PBS Pro license agreement is contained in the file LICENSE
+in this directory.
+
+The PBS Pro copyright is contained in the file COPYRIGHT in this
+directory.
+
+Please refer to the latest release notes for warnings about
+known problems or incompatabilities with prior versions
+of PBS Pro.
+
+Complete information on the installation, customization,
+maintenance, and administration is found in the PBS Pro
+Administrator's Guide.
+

文件差异内容过多而无法显示
+ 42 - 0
README.md


+ 44 - 0
autogen.sh

@@ -0,0 +1,44 @@
+#!/bin/sh
+
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+if test -d ./src/resmom; then
+	echo "Generating configure script and Makefile templates."
+	exec autoreconf --force --install -I m4 $*
+else
+	echo "Execute `basename $0` from the top level distribution directory."
+fi

+ 46 - 0
buildutils/Makefile.am

@@ -0,0 +1,46 @@
+
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+EXTRA_DIST = \
+	attr_parser.py \
+	compile \
+	depcomp \
+	missing \
+	pbs_mach_type \
+	python-autoconf.py
+

+ 270 - 0
buildutils/ar-lib

@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2013 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    q*) quick=yes   ;;
+    r*) replace=yes ;;
+    s*) index=yes   ;;
+    S*)             ;; # the index is always updated implicitly
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+  yes,* | ,yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$quick$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi

+ 948 - 0
buildutils/attr_parser.py

@@ -0,0 +1,948 @@
+# coding: utf-8
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+
+"""
+    attr_parser.py will parse xml files also called master attribute files 
+containing all the members of both server and ecl files,and will generate 
+two corresponding files one for server and one for ecl 
+"""
+import sys
+import os
+import re
+import getopt
+import string
+import xml.parsers.expat
+import xml.dom.minidom
+import pdb
+
+list_ecl = []
+list_svr = []
+global e_flag
+global s_flag
+
+global ms
+global me
+
+e_flag = 0
+s_flag = 0
+
+
+class switch(object):
+
+    """
+    This class provides the functionality which is equivalent
+    to switch/case statements in C. It only needs to be defined
+    once.
+    """
+
+    def __init__(self, value):
+        self.value = value
+        self.fall = False
+
+    def __iter__(self):
+        """Return the match method once, then stop"""
+        yield self.match
+        raise StopIteration
+
+    def match(self, *args):
+        """Indicate whether or not to enter a case suite"""
+        if self.fall or not args:
+            return True
+        elif self.value in args:  # changed for v1.5, see below
+            self.fall = True
+            return True
+        else:
+            return False
+
+
+def fileappend(line):
+    """
+    fileappend function - (wrapper on top of append for being able to
+    select the file where to write
+    """
+    global s_flag
+    global e_flag
+
+    if s_flag == 1 and e_flag == 0:
+        list_svr.append(line)
+    if e_flag == 1 and s_flag == 0:
+        list_ecl.append(line)
+    if e_flag == 0 and s_flag == 0:
+        list_svr.append(line)
+        list_ecl.append(line)
+    return None
+
+
+def getText(efl, sfl):
+    """ 
+    getText function - (writes the data stored in lists to file)
+    """
+    buff1 = "".join(list_svr)
+    buff2 = "".join(list_ecl)
+    for line in buff1:
+        sfl.write(line)
+    for line in buff2:
+        efl.write(line)
+
+
+def add_comma(string):
+    """
+    add_comma function - (will take Tag values and will put if there is any comma in it)
+    """
+    buff2 = string.split('\n')
+    for line in buff2:
+        if re.search(r'#', line):
+            line = line.strip(' \t')
+            list_svr.append('\t' + '\t' + line + '\n')
+        elif re.search(r'\n', line):
+            pass
+        else:
+            line = line.strip(' \t')
+            list_svr.append('\t' + '\t' + '\t' + line + ',' + '\n')
+
+
+def attr(masterf, svrf, eclf):
+    """
+    attr function - (opens the files reads them and using minidom filters relevant 
+    data to individual lists) 
+    """
+    from xml.dom import minidom
+
+    global e_flag
+    global s_flag
+    doc = minidom.parse(masterf)
+    nodes = doc.getElementsByTagName('data')
+
+    for node in nodes:
+        alist = node.getElementsByTagName('head')
+        for a in alist:
+            list_svr.append (
+                "/*Disclaimer: This is a machine generated file.*/" + '\n')
+            list_svr.append(
+                "/*For modifying any attribute change corresponding XML file */" + '\n')
+            list_ecl.append(
+                "/*Disclaimer: This is a machine generated file.*/" + '\n')
+            list_ecl.append(
+                "/*For modifying any attribute change corresponding XML file */" + '\n') 
+            blist = a.getElementsByTagName('SVR')
+            blist_ecl = a.getElementsByTagName('ECL')
+            for s in blist:
+                text1 = s.childNodes[0].nodeValue
+                text1 = text1.strip(' \t')
+                list_svr.append(text1)
+            for e in blist_ecl:
+                text2 = e.childNodes[0].nodeValue
+                text2 = text2.strip(' \t')
+                list_ecl.append(text2)
+        at_list = node.getElementsByTagName('attributes')
+        for i in at_list:
+            e_flag = 0
+            s_flag = 0
+            attr_list = i.childNodes[0].nodeValue
+            inc_name =  i.getAttribute('include')
+            list_svr.append( '\n' + inc_name)
+            flag_name = i.getAttribute('flag')
+            if flag_name == 'SVR':
+                s_flag = 1
+            if flag_name == 'ECL':
+                e_flag = 1
+            if flag_name == None:
+                e_flag = 0
+                s_flag = 0
+            attr_list = attr_list.strip(' \t')
+            fileappend(attr_list)
+            h = None 
+            s_mem = None 
+            e_mem = None 
+            mem_list1 = i.getElementsByTagName('member_name')
+            if mem_list1:
+                bot = mem_list1[0].getElementsByTagName('both')
+                svr = mem_list1[0].getElementsByTagName('SVR')
+                ecl = mem_list1[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    h = h.strip(' \t')
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + h + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_mem = s_mem.strip(' \t')
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + s_mem + ',' + '\n')
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_mem = e_mem.strip(' \t')
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + e_mem + ',' + '\n')
+            else:
+                sys.exit(
+                    "member_name does not exist!" + i.childNodes[0].nodeValue)
+
+            mem_list2 = i.getElementsByTagName('member_at_decode')
+            if mem_list2:
+                mem = mem_list2[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue  
+                sys.exit(
+                    "member_at_decode <Tag> does not exist! for Attribute -> " + tmp)
+                 
+
+            mem_list3 = i.getElementsByTagName('member_at_encode')
+            if mem_list3:
+                mem = mem_list3[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                s_flag = 1
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue 
+                sys.exit(
+                    "member_at_encode <Tag> does not exist! for Attribute -> " + tmp)
+
+            mem_list4 = i.getElementsByTagName('member_at_set')
+            s_flag = 1
+            if mem_list4:
+                mem = mem_list4[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_set <Tag> does not exist! for Attribute -> " + tmp)
+            
+            mem_list5 = i.getElementsByTagName('member_at_comp')
+            s_flag = 1
+            if mem_list5:
+                mem = mem_list5[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_comp <Tag> does not exist! for Attribute -> " + tmp)
+           
+            mem_list6 = i.getElementsByTagName('member_at_free')
+            s_flag = 1
+            if mem_list6:
+                mem = mem_list6[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_free <Tag> does not exist! for Attribute -> " + tmp)
+
+            mem_list7 = i.getElementsByTagName('member_at_action')
+            s_flag = 1
+            if mem_list7:
+                mem = mem_list7[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_action <Tag> does not exist! for Attribute -> " + tmp)
+            e_flag = 0
+            s_flag = 0
+
+            mem_list8 = i.getElementsByTagName('member_at_flags')
+            if mem_list8:
+                mem = mem_list8[0].childNodes[0].nodeValue
+                bot = mem_list8[0].getElementsByTagName('both')
+                svr = mem_list8[0].getElementsByTagName('SVR')
+                ecl = mem_list8[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    h = h.strip(' \t')
+                    fileappend('\t' + '\t' + h + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_mem = s_mem.strip(' \t')
+                    s_flag = 1
+                    if re.search(r'^#', s_mem):
+                        add_comma(s_mem)
+                    else:
+                        fileappend('\t' + '\t' + s_mem + ',' + '\n')
+                s_flag = 0
+                e_flag = 0
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_mem = e_mem.strip(' \t')
+                    e_flag = 1
+                    fileappend('\t' + '\t' + e_mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_flags <Tag> does not exist! for Attribute -> " + tmp)
+            e_flag = 0
+            s_flag = 0
+
+            mem_list9 = i.getElementsByTagName('member_at_type')
+            if mem_list9:
+                mem = mem_list9[0].childNodes[0].nodeValue
+                bot = mem_list9[0].getElementsByTagName('both')
+                svr = mem_list9[0].getElementsByTagName('SVR')
+                ecl = mem_list9[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    h = h.strip(' \t')
+                    fileappend('\t' + '\t' + h + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_mem = s_mem.strip(' \t')
+                    s_flag = 1
+                    if re.search(r'^#', s_mem):
+                        add_comma(s_mem)
+                    else:
+                        fileappend('\t' + '\t' + s_mem + ',' + '\n')
+                s_flag = 0
+                e_flag = 0
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_mem = e_mem.strip(' \t')
+                    e_flag = 1
+                    fileappend('\t' + '\t' + e_mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_type <Tag> does not exist! for Attribute -> " + tmp)
+            e_flag = 0
+            s_flag = 0
+
+            mem_list10 = i.getElementsByTagName('member_at_parent')
+            if mem_list10:
+                mem = mem_list10[0].childNodes[0].nodeValue
+                mem = mem.strip(' \t')
+                s_flag = 1
+                fileappend('\t' + '\t' + mem + '\n' + '\t' + '},')
+                s_flag = 0
+            else:
+                pass
+            e_flag = 0
+            s_flag = 0
+            mem_list11 = i.getElementsByTagName('member_verify_function')
+            if mem_list11:
+                mem = mem_list11[0].childNodes[0].nodeValue
+                ecl = mem_list11[0].getElementsByTagName('ECL')
+                e_mem1 = []
+                # <Tag> member_verify_function, will always have only 2 ECL subtags.
+                e_flag = 1
+                for e in ecl:
+                    e_mem1.append(e.childNodes[0].nodeValue.strip(' \t'))
+                fileappend('\t' + '\t' + e_mem1[0] + ',' + '\n')
+                fileappend('\t' + '\t' + e_mem1[1] + '\t' + '\n' + '\t' + '},')
+                e_flag = 0
+                s_flag = 0
+            else:
+                pass
+
+        tail_list = node.getElementsByTagName('tail')
+        for t in tail_list:
+            tail_value = t.childNodes[0].nodeValue
+            if tail_value == None:
+                pass
+            fileappend('\n') 
+            tail_both = t.getElementsByTagName('both')
+            tail_svr = t.getElementsByTagName('SVR')
+            tail_ecl = t.getElementsByTagName('ECL')
+            for tb in tail_both:
+                b = tb.childNodes[0].nodeValue
+                b = b.strip(' \t')
+                list_ecl.append(b)
+                list_svr.append(b)
+            for ts in tail_svr:
+                s = ts.childNodes[0].nodeValue
+                s = s.strip(' \t')
+                list_svr.append(s)
+            for te in tail_ecl:
+                e = te.childNodes[0].nodeValue
+                e = e.strip(' \t')
+                list_ecl.append(e)
+
+        getText(eclf, svrf)
+
+
+def resc_attr(masterf, svrf, eclf):
+    """
+    resc_attr function - (opens the resc_def file reads them and using minidom 
+    filters relevant data to individual lists) 
+    """
+    from xml.dom import minidom
+
+    global e_flag
+    global s_flag
+
+    global ms
+    global me
+
+    doc = minidom.parse(masterf)
+    nodes = doc.getElementsByTagName('data')
+
+    for node in nodes:
+        alist = node.getElementsByTagName('head')
+        for a in alist:
+            list_svr.append (
+                "/*Disclaimer: This is a machine generated file.*/" + '\n')
+            list_svr.append(                                                                 
+                  "/*For modifying any attribute change corresponding XML file */" + '\n')            
+            list_ecl.append(                                                                 
+                  "/*Disclaimer: This is a machine generated file.*/" + '\n')                         
+            list_ecl.append(                                                                 
+                  "/*For modifying any attribute change corresponding XML file */" + '\n')
+            blist = a.getElementsByTagName('SVR')
+            blist_ecl = a.getElementsByTagName('ECL')
+            for s in blist:
+                text1 = s.childNodes[0].nodeValue
+                list_svr.append(text1)
+            for e in blist_ecl:
+                text2 = e.childNodes[0].nodeValue
+                list_ecl.append(text2)
+        at_list = node.getElementsByTagName('attributes')
+        for i in at_list:
+            attr_list = i.childNodes[0].nodeValue
+            flag_name = i.getAttribute('flag')
+            macro_name = i.getAttribute('macro')
+            s_flag = 0
+            e_flag = 0
+            ms = 0
+            me = 0
+            mflg = i.getAttribute('mflag')
+            if flag_name == 'SVR':
+                s_flag = 1
+            if flag_name == 'ECL':
+                e_flag = 1
+            if flag_name == None:
+                e_flag = 0
+                s_flag = 0
+            if macro_name:
+                ms = 1
+                me = 1
+                for case in switch(mflg):
+                    if case('SVR'):
+                        ms = 1
+                        me = 0
+                        break
+                    if case('ECL'):
+                        me = 1
+                        ms = 0
+                        break
+            if me == 1 and macro_name != None:
+                list_ecl.append('\n' + macro_name)
+            if ms == 1 and macro_name != None:
+                list_svr.append('\n' + macro_name)
+            fileappend(attr_list)
+            h = None
+            s_mem = None
+            e_mem = None
+            mem_list1 = i.getElementsByTagName('member_name')
+            if mem_list1:
+                mem = mem_list1[0].childNodes[0].nodeValue
+                bot = mem_list1[0].getElementsByTagName('both')
+                svr = mem_list1[0].getElementsByTagName('SVR')
+                ecl = mem_list1[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + h.strip(' \t') + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_mem = s_mem.strip(' \t')
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + s_mem + ',' + '\n')
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_mem = e_mem.strip(' \t')
+                    fileappend(
+                        '\n' + '\t' + '{' + '\n' + '\t' + '\t' + e_mem + ',' + '\n')
+            else:
+                sys.exit(
+                    "member_name does not exist!" + i.childNodes[0].nodeValue)
+            mem_list2 = i.getElementsByTagName('member_at_decode')
+            if mem_list2:
+                mem = mem_list2[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_decode <Tag> does not exist! for Attribute -> " + tmp)
+
+            mem_list3 = i.getElementsByTagName('member_at_encode')
+            if mem_list3:
+                mem = mem_list3[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_encode <Tag> does not exist! for Attribute -> " + tmp)  
+
+            mem_list4 = i.getElementsByTagName('member_at_set')
+            if mem_list4:
+                mem = mem_list4[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_set <Tag> does not exist! for Attribute -> " + tmp) 
+
+            mem_list5 = i.getElementsByTagName('member_at_comp')
+            if mem_list5:
+                mem = mem_list5[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_comp <Tag> does not exist! for Attribute -> " + tmp)
+
+            mem_list6 = i.getElementsByTagName('member_at_free')
+            if mem_list6:
+                mem = mem_list6[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_free <Tag> does not exist! for Attribute -> " + tmp)
+
+            mem_list7 = i.getElementsByTagName('member_at_action')
+            if mem_list7:
+                mem = mem_list7[0].childNodes[0].nodeValue
+                s_flag = 1  # This is not required in ECL files
+                if re.search(r'^#', mem):
+                    add_comma(mem)
+                else:
+                    fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_action <Tag> does not exist! for Attribute -> " + tmp) 
+            e_flag = 0
+            s_flag = 0
+
+            mem_list8 = i.getElementsByTagName('member_at_flags')
+            if mem_list8:
+                mem = mem_list8[0].childNodes[0].nodeValue
+                bot = mem_list8[0].getElementsByTagName('both')
+                svr = mem_list8[0].getElementsByTagName('SVR')
+                ecl = mem_list8[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    fileappend('\t' + '\t' + h + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_flag = 1
+                    if re.search(r'^#', s_mem):
+                        add_comma(s_mem)
+                    else:
+                        fileappend('\t' + '\t' + s_mem + ',' + '\n')
+                s_flag = 0
+                e_flag = 0
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_flag = 1
+                    fileappend('\t' + '\t' + e_mem + ',' + '\n')
+
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_flags <Tag> does not exist! for Attribute -> " + tmp)
+            e_flag = 0
+            s_flag = 0
+
+            mem_list9 = i.getElementsByTagName('member_at_type')
+            if mem_list9:
+                mem = mem_list9[0].childNodes[0].nodeValue
+                bot = mem_list9[0].getElementsByTagName('both')
+                svr = mem_list9[0].getElementsByTagName('SVR')
+                ecl = mem_list9[0].getElementsByTagName('ECL')
+                for b in bot:
+                    h = b.childNodes[0].nodeValue
+                    fileappend('\t' + '\t' + h + ',' + '\n')
+                for s in svr:
+                    s_mem = s.childNodes[0].nodeValue
+                    s_flag = 1
+                    if re.search(r'^#', s_mem):
+                        add_comma(s_mem)
+                    else:
+                        fileappend('\t' + '\t' + s_mem + ',' + '\n')
+                e_flag = 0
+                s_flag = 0
+
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    e_flag = 1
+                    fileappend('\t' + '\t' + e_mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_type <Tag> does not exist! for Attribute -> " + tmp) 
+            e_flag = 0
+            s_flag = 0
+
+            mem_list10 = i.getElementsByTagName('member_at_entlim')
+            if mem_list10:
+                mem = mem_list10[0].childNodes[0].nodeValue
+                s_flag = 1
+                fileappend('\t' + '\t' + mem + ',' + '\n')
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_entlim <Tag> does not exist! for Attribute -> " + tmp)  
+
+            mem_list11 = i.getElementsByTagName('member_at_struct')
+            if mem_list11:
+                mem = mem_list11[0].childNodes[0].nodeValue
+                s_flag = 1
+                fileappend('\t' + '\t' + mem + '\n' + '\t' + '},')
+                if ms == 1:
+                    fileappend('\n' + '#endif' + '\n')
+
+            else:
+                if h:
+                    tmp = h
+                elif s_mem:
+                    tmp = s_mem
+                elif e_mem:
+                    tmp = e_mem
+                else:
+                    tmp = i.childNodes[0].nodeValue
+                sys.exit(
+                    "member_at_struct <Tag> does not exist! for Attribute -> " + tmp)
+            e_flag = 0
+            s_flag = 0
+
+            mem_list12 = i.getElementsByTagName('member_verify_function')
+            if mem_list12:
+                mem = mem_list12[0].childNodes[0].nodeValue
+                ecl = mem_list12[0].getElementsByTagName('ECL')
+                for e in ecl:
+                    e_mem = e.childNodes[0].nodeValue
+                    ecl = mem_list12[0].getElementsByTagName('ECL')
+                e_mem1 = []
+                # <Tag> member_verify_function, will always have only 2 ECL subtags.
+                e_flag = 1
+                for e in ecl:
+                    e_mem1.append(e.childNodes[0].nodeValue.strip(' \t'))
+                fileappend('\t' + '\t' + e_mem1[0] + ',' + '\n')
+                fileappend('\t' + '\t' + e_mem1[1] + '\t' + '\n' + '\t' + '},')
+
+                if me == 1:
+                    fileappend('\n' + '#endif' + '\n')
+                e_flag = 0
+                s_flag = 0
+            else:
+                pass
+
+        tail_list = node.getElementsByTagName('tail')
+        for t in tail_list:
+            tail_value = t.childNodes[0].nodeValue
+            if tail_value == None:
+                pass
+            fileappend('\n') 
+            tail_both = t.getElementsByTagName('both')
+            tail_svr = t.getElementsByTagName('SVR')
+            tail_ecl = t.getElementsByTagName('ECL')
+            for tb in tail_both:
+                b = tb.childNodes[0].nodeValue
+                list_ecl.append(b)
+                list_svr.append(b)
+            for ts in tail_svr:
+                s = ts.childNodes[0].nodeValue
+                list_svr.append(s)
+            for te in tail_ecl:
+                e = te.childNodes[0].nodeValue
+                list_ecl.append(e)
+
+    getText(eclf, svrf)
+
+
+def main(argv):
+    """
+    The Main Module starts here-
+    Opens files,and calls appropriate functions based on Object values.
+    """
+    global SVR_FILE
+    global ECL_FILE
+    global MASTER_FILE
+    global ATTRIBUTE_SCRIPT_ARG
+
+    if len(sys.argv) == 2:
+        usage()
+        sys.exit(1)
+    try:
+        opts, args = getopt.getopt(
+            argv, "m:s:e:a:h", ["master=", "svr=", "ecl=", "attr=", "help"])
+    except getopt.error, err:
+        print str(err)
+        usage()
+        sys.exit(1)
+    for opt, arg in opts:
+        if opt in ('-h', "--help"):
+            usage()
+            sys.exit(1)
+        elif opt in ("-m", "--master"):
+            MASTER_FILE = arg
+        elif opt in ("-s", "--svr"):
+            SVR_FILE = arg
+        elif opt in ("-e", "--ecl"):
+            ECL_FILE = arg
+        elif opt in ("-a", "--attr"):
+            ATTRIBUTE_SCRIPT_ARG = arg
+        else:
+            print "Invalid Option!"
+            sys.exit(1)
+#    Error conditions are checked here.
+
+    if MASTER_FILE is None or not os.path.isfile(MASTER_FILE) or not os.path.getsize(MASTER_FILE) > 0:
+        print "Master file not found or data is not present in File"
+        sys.exit(1)
+
+    if SVR_FILE is None:
+        SVR_FILE = "attr_def.c"
+
+    if ECL_FILE is None:
+        ECL_FILE = "ecl_attr_def.c"
+
+    if ATTRIBUTE_SCRIPT_ARG is None or not str:
+        print "Attribute type is required"
+        sys.exit(1)
+
+    try:
+        m_file = open(MASTER_FILE)
+    except IOError, err:
+        print str(err)
+        print 'Cannot Open Master File!'
+        sys.exit(1)
+
+    try:
+        s_file = open(SVR_FILE, 'w')
+    except IOError, err:
+        print str(err)
+        print 'Cannot Open Server File!'
+        sys.exit(1)
+
+    try:
+        e_file = open(ECL_FILE, 'w')
+    except IOError, err:
+        print str(err)
+        print 'Cannot Open Ecl File!'
+        sys.exit(1)
+
+    n = str(ATTRIBUTE_SCRIPT_ARG)
+
+    for case in switch(n):
+        if case('job', 'server', 'node', 'queue', 'sched', 'resv'):
+            attr(m_file, s_file, e_file)
+            break
+        if case('resc'):
+            resc_attr(m_file, s_file, e_file)
+            break
+        if case():  # default, could also just omit condition or 'if True'
+            print "Invalid Object!"
+        # No need to break here, it'll stop anyway
+
+    m_file.close()
+    s_file.close()
+    e_file.close()
+
+
+def usage():
+    """
+    Usage (depicts the usage of the script)
+    """
+    print "usage: prog -m <MASTER_FILE> -s <svr_attr_file> -e <ecl_attr_file> -a <object>"
+
+
+if __name__ == "__main__":
+    main(sys.argv[1:])
+

+ 347 - 0
buildutils/compile

@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 791 - 0
buildutils/depcomp

@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'.  On the theory
+## that the space means something, we add a space to the output as
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using '\' :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for ':'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        shift
+        shift
+        ;;
+    *)
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 4 - 0
buildutils/exclude_script

@@ -0,0 +1,4 @@
+/ \/usr\/include\//d
+/ \/usr\/local\/lib\//d
+/ \/usr\/local\//D
+/ \/gcc-lib\//d

+ 527 - 0
buildutils/install-sh

@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test X"$d" = X && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 742 - 0
buildutils/makedepend-sh

@@ -0,0 +1,742 @@
+#!/bin/sh
+
+# 
+# Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Lonhyn T. Jasinskyj.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#        This product includes software developed by the NetBSD
+#        Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+#    contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+# 
+
+
+#
+# This is a shell script that behaves rather like the makedepend(1)
+# that comes with X11 except that it also understands VPATH
+#
+# makedepend-sh takes three sets of arguments. It parse the line of
+# arguments left to right and until it encounters a '--' it
+# applies command line switches to itself. After the first '--' all
+# args are accumulated and will be used as arguments to a C preprocessor
+# (such as cc -E). All arguments after the second '--' are filenames,
+# usually object files. More formally:
+#
+# makedepend [-a] [-s varname] [-v] [-f file] [-p preprocessor] [-V pathlist]
+#            [-e scriptfile] [-m mrulesfile [-x excludeobjs]] -- 
+#            [preprocessor args] -- file1 [file2 [...]]
+#
+# Flags:
+#
+#   -a
+#        append to the end of the output file (usually Makefile) instead
+#        of replacing anything following a marker that looks like:
+#           "# DO NOT DELETE THIS LINE -- makedepend-sh depends on it"
+#        Appending is generally not the desired behavior but may be
+#        useful if makedepend needs multiple, different invocations.
+#
+#   -s varname
+#        generate a 'varname = filenames...' line in the output that is 
+#        derived from the files given to makedepend. In this way a list
+#        of object files can be given and they will be searched for
+#        (possibly in a VPATH) and then their full pathnames will be
+#        given computed and accumulated in a 'varname=' line. Thus, in a
+#        Makefile the writer need only write 'OBJS=' (and possibly
+#        give a VPATH if the source and object trees are seperate) and
+#        makedepend will do the rest. It is often useful to choose
+#        varname as "SRCS" or "CSRCS". Only C files are candidates
+#        for inclusion in the source list.
+#
+#   -v
+#        be verbose, can be repeated for more verbosity.
+#
+#   -f file
+#        instead of using Makefile, write to this file
+#
+#   -m mrulesfile
+#        a file in the style of a Makefile containing suffix rules
+#        with transformations. Since stock make is incapable of
+#        applying a transformation rule if both files are not
+#        in the local directory, a specific rules has to be generated
+#        by makedepend in this case. If the -m flag is given the
+#        appropriate suffix rule will be extracted and an explicit
+#        command will be generated.
+#
+#   -x excludeobjs
+#        if the -m flag is given then this should contain a list
+#        of objects that should not have a rule generated for them.
+#
+#   -i ignorefiles
+#        these files will simply be ignored, this is useful if you
+#        give makedepend a list of files to process but not all of
+#        the files exist yet.
+#
+#   -p preprocessor
+#        the command to invoke the preprocessor if 'cc -E' is not
+#        appropriate. Normally one should quote this (e.g. -p "gcc -E")
+#
+#   -V pathlist
+#        the path is a colon-seperated list of paths that will be searched
+#        for the source file. Normally only '.' is searched.
+#
+#   -e scriptfile
+#        the regular expression is treated as the path of an arbitrary
+#        sed program that will be applied to the list of dependencies.
+#        This will happen after all of the dependencies are composed
+#        but before they are appended or any effects of the -s flag
+#        are added. This is useful for excluding files in "/usr/include"
+#        and "gcc-lib". 
+#
+#   -c cksumfile
+#        compute a checksum (using "cksum") of this file. If a
+#        file called .dep_cksum exists in the local directory then
+#        also compare the new cksum output with the contents of that
+#        file. If they are the same and a file called .depends also
+#        exists locally then one need not redo the makedepend
+#        dependency processing and can instead take .depends and
+#        either append it to the Makefile or replace the previous
+#        dependencies (as appropriate depending on the -a flag)
+#        Finally, if new dependencies are generated, place a copy in
+#        the file given as cksumfile.
+#
+#   --
+#        
+#   -preprocessor_args      
+#        whatever arguments appear in this section get passed on to the
+#        pre-processor.
+#
+#   --
+#
+#   file1 [file2 [...]]
+#        the filenames given to makedepend. These are often object files
+#        whose names will first be transformed to source files by
+#        replacing final '.o' with '.c'.  These will then be sought in
+#        either '.' or a list of paths given with the -V flag.
+#
+#
+# Output:
+#
+#   For each file listed makedepend will output:
+#
+#      1. if the file was an object file, then a line like
+#            file.o: dirname/file.c
+#
+#      2. multiple lines of the form:
+#            dirname/file.c: inc1.h inc2.h
+#            dirname/file.c: inc3.h inc4.h
+#            etc.
+#
+#      3. if the -s flag was given, then a set of lines like
+#         SRCS = \
+#            dirname/file1.c \
+#            dirname/file2.c \
+#            etc.
+#
+#      4. if the -m flag is give then for each source file that is
+#         not in the local directory, an explicit rule will be
+#         generated. The actions will be derived from a parsed
+#         makefile-style file.
+#
+
+P=`basename $0`; export P
+
+CPP="cc -E"
+MARKER="# DO NOT DELETE THIS LINE -- makedepend-sh depends on it"
+
+CKSUM=cksum
+CKSUM_STORE=.dep_cksum
+DEPEND_STORE=.depends
+
+init_mode() {
+    mode="md_args";
+}
+
+incr_mode() {
+    if [ "$mode" = "md_args" ] ; then
+        mode="cc_args";
+    else
+        if [ "$mode" = "cc_args" ] ; then
+            mode="fn_args";
+        fi
+    fi
+}
+
+
+
+append_arg() {
+    case "$mode" in
+	md_*)  arg_md="$arg_md $1" ;;
+	cc_*)  arg_cc="$arg_cc $1" ;;
+	fn_*)  arg_fn="$arg_fn $1" ;;
+    esac
+}
+
+
+append_srcs() {
+    append_to="$1"
+    srcs_file="$2"
+
+    #
+    # since there is no way to echo a backslash reliably
+    # with builtin echo or /bin/echo (not knowing their pedigree)
+    # echo must be avoided for output.  Use printf or, in this case, awk.
+    #
+    cat $srcs_file | \
+      awk 'BEGIN { printf("\n#\n# '$mksrcs' generated by makedepend\n#\n'$mksrcs' = ")} \
+           {} { for (i = 1; i <= NF; i++) { printf("\\\n   %s ", $i) }} \
+           END { printf("\n\n") }' >> $append_to
+}
+
+append_rules() {
+    append_to="$1"
+    rules_in="$2"
+    ( \
+       echo; echo '#'; \
+       echo '# generated rules for source files that are not local'; \
+       echo '# to this directory.'; \
+       echo '#'; \
+       cat $rules_in; \
+       echo; echo; echo) >> $append_to
+}
+
+
+generate_awk() {
+cat > $1 <<!
+#
+# this old-style awk script will read a makefile where suffix
+# rules are being defined and generate a shell script defining
+# each rule as a variable. Thus a rule such as ".c.o:" would 
+# be transformed such that after evaluating the resulting 
+# piece of Bourne shell code the variable "mkrule__c_o" will
+# be set to the action for that suffix. As is obvious, the
+# escaping mechanism is very primitive and will not do well
+# for many characters encountered in suffix rules. However, it
+# is sufficient for disambiguating all the common suffixes
+# and is good enough. 
+#
+# Note that what defines a field depends on the implementation. As
+# an example, under HP-UX 10.x a trailing field separator with
+# nothing after it gives an NF that is one less than all of
+# the other awks that I have seen.
+#
+BEGIN { FS=":" }
+
+\$1 ~ /^\.[a-zA-Z]+\.[a-zA-Z]+$/ {
+    # if we have not seen this suffix rule before record it and
+    # go into rule collecting mode
+    if (exists[\$1] == 0) {
+        exists[\$1] = 1
+        names[\$1] = \$1
+        cur_suf = \$1   # the current suffix to collect into
+        suff_list=suff_list " " cur_suf
+        collect = 1
+    } else {
+        collect = 0
+    }
+    next
+}
+
+/^[\t#].*/  {
+    if (collect) {
+        # remove the initial tab and put a \t there instead
+        action[cur_suf]=action[cur_suf] "\t" substr(\$0,2) "\\\n"
+    }
+    next
+}
+
+/.*/  {
+        # collection stops when we encounter the first
+        # line that does not begin with a TAB or '#' sign
+        collect = 0
+}
+
+END {
+    # when done print out the shell code
+    for (n in names) {
+        printf("mkrule_");
+        for (j = 1; j <= length(n); j++) {
+            c = substr(n,j,1)
+            if (c ~ /[a-zA-Z0-9]/) {
+                printf("%s", c)
+            } else {
+                # replace all wierd characters with underscores
+                printf("_")
+            }
+        } 
+        print "='" action[n] "'"
+    }
+
+    #
+    # turn a string that looks like ".c.o .c .l.o .y.o" into
+    # an array that contains the suffixes and then print
+    # that array into a single varibale where each suffix
+    # appears once
+    #
+    len = length(suff_list)
+    for (j = 1; j <= len; j++) {
+        #
+        # if the character is not a seperator, accumulate it into the
+        # current suffix, if it is, record the previously accumulated suffix
+        #
+        c = substr(suff_list,j,1)
+        if (c ~ /[ .]/) {
+            if (sfx !~ /^$/) {
+                sfxs[sfx] = sfx
+                sfx = ""
+            }
+        } else {
+            sfx = sfx c
+        }
+    }
+
+    # print out the line that will set the shell variable
+    printf("mksuffixes='")
+    first = 1
+    for (s in sfxs) {
+        if (first == 1) { printf("%s", s); first = 0 } else { printf(" %s", s) }
+    }
+    printf("'\n")
+}
+!
+} # end of generate_awk()
+
+
+
+#
+# if the mrules flag was given, go and generate and awk script,
+# run it on the file containing the make rules, and then set
+# shell variables containing make rules
+#
+eval_mrules()
+{
+    mrulefile=$1
+    eval `mktemp awkscr`
+    eval `mktemp mkrule_scr`
+
+    generate_awk $awkscr
+    awk -f $awkscr < $mrulefile > $mkrule_scr
+    . $mkrule_scr
+    if test "$verbose" -gt 1; then
+        (echo "make rules are:"; echo "==============="; \
+         cat $mkrule_scr; echo "===============") | sed -e "s/^/$P: /"
+    fi
+}
+
+#
+# exists_rule(): true if a rule exists for this src and product suffix
+#
+exists_rule()
+{
+    # src and product suffixes
+    s_sfx=$1
+    p_sfx=$1
+    
+    rulename=\$mkrule__${s_sfx}_${prod_sfx}
+    test -n "`eval echo $rulename`" && return 0
+    return 1
+}
+
+#
+# called with a var name as an arg this will produce a line of 
+# shell code to be evaluated. Thus to set the variable FOO to
+# the name of the next available temp file use
+#     eval `mktemp FOO`
+# This is necessary to get the auto-increment of tmp_id since 
+# things in single quotes are normally run in sub-shells
+#
+mktemp()
+{
+    export tmp_id
+    tmp_id=`expr ${tmp_id:-0} + 1`
+    name=/tmp/mkdep.$$.${tmp_id}
+    echo "$1=$name; tmp_id=$tmp_id"
+
+}
+
+#
+# explicit_rule():
+#    this will take arguments with information about the source
+# file and the product to be generated. It then decides whether
+# an explicit rule needs to be made and if so adds it to a file
+# which can then be tacked onto the make file later.
+#
+explicit_rule()
+{
+    src="$1"
+    obj="$2"
+    srcdir="$3"
+    rulefile="$4"
+    excludes="$5" 
+
+    test "$srcdir" = '.' && return
+
+    src_suffix=`echo $src | sed -n -e 's/.*\.\([^.][^.]*\)$/\1/p'`
+    obj_suffix=`echo $obj | sed -n -e 's/.*\.\([^.][^.]*\)$/\1/p'`
+
+    # figure out the name of the variable where the action is stored
+    rulename=\$mkrule__${src_suffix}_${obj_suffix}
+
+    #
+    # go and see if this object is one of the excluded objects, if
+    # so, bag this phase
+    #
+    for x in $excludes; do
+        test "$x" = "$obj" && {
+            test "$verbose" -gt 1 && \
+                echo $P: skipping explicit rule for: $obj; \
+            return; \
+        }
+    done
+
+    #
+    # generate the explicit rule and add it to the rulefile if we
+    # have a suffix transformation
+    #
+    if test -n "`eval echo $rulename`"; then
+	echo ${obj}: ${srcdir}/${src} >> $rulefile
+
+        #
+        # use POSIX printf to get the newlines right, must use double quotes.
+        # also replace all occurences of '$<' with the name of the
+        # source file since '$<' is only appropriate in inference
+        # rules and '$?' is not a correct substitute when the target
+        # depends on multiple files, including .h files.
+        #
+        eval printf \"$rulename\" | \
+            sed -e "s;\$<;$srcdir/$src;g" >> $rulefile
+    fi
+}
+
+in_list_p()
+{
+    f="$1"
+    ignores="$2"
+
+    for x in $ignores; do
+        test "$x" = "$f" && return 0
+    done
+    return 1
+}
+
+#
+# see if we already have a file of dependencies and see if it is
+# usable (i.e. the cksum on the cksumfile is still the same)
+#
+have_usable_depends()
+{
+    ckmatchfile="$1"
+    if test -n "$ckmatchfile" -a -s "$CKSUM_STORE" -a -f "$DEPEND_STORE"; then
+        $CKSUM $ckmatchfile > $CKS 2> /dev/null && \
+          diff "$CKSUM_STORE" "$CKS" > /dev/null 2>&1 || \
+          return 1  # no usable dependencies prestored
+        test "$verbose" -gt 0 && echo $P: using dependencies from previous run
+        return 0
+    fi
+
+    # return FALSE
+    return 1
+}
+
+#
+# maybe_store_depends:
+#    we should squirrel away the dependencies that have been generated
+#    if the user has specified a -c flag on the command line (i.e. a
+#    file to checksum against). If that is the case then store the
+#    dependencies in DEPEND_STORE and calculate a new checksum into
+#    CKSUM_STORE.
+#
+maybe_store_depends()
+{
+    ckmatchfile="$1"
+    depsfile="$2"
+
+    if test -n "$ckmatchfile" ; then
+
+        $CKSUM "$ckmatchfile" > $CKS 2> /dev/null && \
+          test -s "$CKS" || return 1
+
+        # only store if different
+        diff "$CKS" "$CKSUM_STORE" > /dev/null 2>&1 || cdiff=yes
+        diff "$depsfile" "$DEPEND_STORE" > /dev/null 2>&1 || ddiff=yes
+
+        if test "$cdiff" = yes -o "$ddiff" = yes; then
+            cp "$CKS" "$CKSUM_STORE" && cp "$depsfile" "$DEPEND_STORE" || \
+              return 1
+            test "$verbose" -gt 0 && echo $P: stored new dependencies for reuse
+        fi
+    fi
+
+    # success unless we botched things above and returned a 1
+    return 0
+}
+
+
+#
+# gen_depends():
+#   generate the depend information into the file named in TMP.
+#
+gen_depends()
+{
+    #
+    # go through the source files. Find each in VPATH
+    # do the compile there and accumulate the dependencies
+    #
+    true > $TMP   # truncate TMP
+    
+    for f in $arg_fn; do
+    
+      # let us assume that all products are '.o' files
+      prod_sfx='o'
+    
+      # figure out the stem: i.e. /a/b/c/foo.o --> foo
+      stem=`echo $f | sed -e 's/.o$//'`
+    
+      # did we actually find a source file
+      found_src=no
+    
+      # if this file is in the ignore list, skip it
+      in_list_p "$f" "$ignobjs" && { test "$verbose" -gt 0 && \
+          echo $P: ignoring file: $f; continue; }
+    
+      #
+      # go through each possible directory and try each possible
+      # source file
+      #
+      for d in $VPATH; do
+    
+        #
+        # as soon as we find the first src file, we can go onto the
+        # next argument (i.e. object file)
+        #
+        test "$found_src" = yes && break
+    
+        for src_sfx in $mksuffixes; do
+    
+          # cannot make a file from itself
+          test "$prod_sfx" = "$src_sfx" && continue
+    
+          #
+          # if we were given rules and there is no rule for this
+          # transformation then skip this suffix combination
+          #
+          test -n "$mrules" && exists_rule $src_sfx $prod_sfx || continue
+    
+          s=${stem}.${src_sfx}
+          test "$verbose" -gt 2 && echo "$P: checking for: $d/$s"
+    
+          if [ -f "$d/$s" ]; then
+    
+            found_src=yes
+      
+            test "$verbose" -gt 0 && echo $P: processing $d/$s
+      
+            case "$src_sfx" in
+              c*|C*)
+                #
+                # This is a file that is a candidate for cpp:
+                #
+                # process the output of cpp and massage it, then sort
+                # it uniquely and as a final step remove the trailing
+                # numbers or any other cruft that various compilers
+                # might generate. Then remove any lines that
+                # make the file depend on itself by removing any
+                # dependencies on files not ending in .h or .H
+                #
+                # also add it to the list of srcs
+                #
+                test -n "$mksrcs" && echo $d/$s >> $SRCS
+                test "$verbose" -lt 2 && errout='2> /dev/null'
+    
+                eval $CPP $arg_cc $d/$s $errout | \
+                  sed -n -e "s;^\# [0-9][0-9 ]*\"\(/.*\)\";$f: \1;p" | \
+		  grep -v "//$" | \
+                  grep -v "$s\$" | \
+                  sed -e 's;\([^ :]*: [^ ]*\).*;\1;' \
+                  >> $TMP
+                ;;
+    
+              *)
+                test "$verbose" -gt 1 && echo "$P: no preprocessing for $s" ;;
+            esac
+          
+            #
+            # explicit rules can be generated for all sorts of sources
+            #
+            explicit_rule "$s" "$f" "$d" "$RULES" "$xobjs" 
+      
+            break
+          fi
+        done
+      done
+      test "$found_src" = no && echo Did not find the source for: $f
+    done
+    
+    #
+    # optionally invoke a user-specified sed script on the output. In either
+    # case, sort the output uniquely first.
+    #
+    if test -n "$sedprog"; then
+        sort -u < "$TMP" | sed -f "$sedprog" > "$TMP"_a
+        mv "$TMP"_a "$TMP" 2>&1 > /dev/null
+    else
+        sort -u -o "$TMP" "$TMP"
+    fi
+    
+    
+    #
+    # now see if we want the SRCS= line and generation of
+    # explicit rules per file for source files not in our
+    # current directory
+    #
+    test -n "$mksrcs" && test -r "$SRCS" && append_srcs "$TMP" "$SRCS"
+    
+    #
+    # if we wanted explicit rules then these have been diverted to
+    # a seperate file, include them now
+    #
+    test -n "$mrules" && test -r "$RULES" && append_rules "$TMP" "$RULES"
+}
+
+
+
+#
+# this is the beginning of the main routine
+#
+init_mode
+
+eval `mktemp TMP`
+eval `mktemp RULES`
+eval `mktemp SRCS`
+eval `mktemp CKS`
+
+VP=.; export VP
+mksrcs=""; export mksrcs
+MF=Makefile; export MF
+append=no; export append
+verbose=0; export verbose
+sedprog=""; export sedprog
+mrules=""; export mrules
+xobjs=""; export xobjs
+ignobjs=""; export ignobjs
+cksumfile=""; export cksumfile
+
+trap '/bin/rm /tmp/mkdep.$$.* > /dev/null 2>&1' 0 1 2 3 15
+
+while [ $# -gt 0 ] ; do
+    if [ "$mode" = "md_args" ]; then
+        #
+        # these are arguments to the makedepend script itself
+        #
+        case "$1" in
+	  -V*) shift; VP=$1 ;;  # VPATH
+	  -s*) shift; mksrcs=$1 ;;    # generate a SRCS= line based on OBJS
+	  -f*) shift; MF=$1 ;;  # dependfile name
+	  -p*) shift; CPP="$1" ;;  # pre-processor to use
+	  -e*) shift; sedprog="$1" ;;
+	  -c*) shift; cksumfile="$1" ;;  # file to cksum (e.g. Makefile.in)
+	  -m*) shift; mrules="$1" ;; # the make rules file
+	  -x*) shift; xobjs="$1" ;; # no rules for this list of objs
+	  -i*) shift; ignobjs="$1" ;; # list of objs to be ignored
+	  -a*) append=yes ;;
+	  -v*) verbose=`expr $verbose + 1` ;;
+	  --)  incr_mode ;;
+	  *)   echo $P: Illegal argument \'"$1"\' >&2; exit 1 ;;
+	esac
+	shift
+    else
+	case "$1" in
+	  --)  incr_mode ;;
+	  *)   append_arg "$1" ;;
+	esac
+        shift;
+    fi
+done
+
+if test -n "$xobjs" -a -z "$mrules"; then
+    echo $P: cannot use -x without -m >&2
+    exit 1
+fi
+
+if test "$append" = yes -a -n "$mrules"; then
+    echo $P: cannot use append mode if -m is specified >$2
+    echo $P:    since multiple action definitions are prohibited >&2
+    exit 1
+fi
+
+test -n "$mrules" && eval_mrules $mrules
+
+VPATH="`echo .:$VP | sed -e 's/:/ /g'`"
+
+test "$verbose" -gt 1 && echo "$P: CFLAGS are: $arg_cc"
+test "$verbose" -gt 1 && echo "$P: VPATH dirs are: $VPATH"
+
+#
+# the list of suffixes is either found in the make rules
+# and set by calling eval_mrules() earlier, or
+# if we did not process any, then '.c' will do
+#
+mksuffixes=${mksuffixes:-'c'}
+
+#
+# if we find that we can avoid generation of new dependency
+# rules by looking in prestored rules then do that. This
+# way, even though Makefile was regenerated and rules
+# removed we can use the old ones if Makefile.in was
+# not changed. Ideally, make would have an include directive
+# but that is not universally the case.
+#
+have_usable_depends "$cksumfile" && cp "$DEPEND_STORE" "$TMP" || gen_depends
+
+
+if [ "$append" = "yes" ]; then
+    # if the marker is already in the file, do not put a second one in
+    grep "^$MARKER" $MF > /dev/null 2>&1 || echo "$MARKER" >> $MF
+    cat $TMP >> $MF
+else
+    if grep "^$MARKER" $MF > /dev/null 2>&1 ; then
+        #
+        # we delete and then add since there may be no line .+1 if
+        # the marker was the last line
+        #
+	tmp_mf="/tmp/mf.$$"
+        sed "/^$MARKER/d" $MF > $tmp_mf; mv $tmp_mf $MF
+    fi
+    echo $MARKER >> $MF
+    cat $TMP >> $MF
+fi
+
+#
+# decide whether we are using the checksum shortcut and storing depends
+# and if so store the new checksum and new depends
+#
+maybe_store_depends "$cksumfile" "$TMP" || \
+    echo $P: error storing dependencies for later use
+
+/bin/rm $TMP > /dev/null 2>&1
+

+ 215 - 0
buildutils/missing

@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2012-06-26.16; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try '$0 --help' for more information"
+  exit 1
+fi
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 86 - 0
buildutils/pbs_mach_type

@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+#
+# 
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+# This is a simple script that generates a machine type name
+# based on the output of uname.  The generated name is in the
+# style of old PBS machine names and thus a hand generated
+# mapping needs to take place. If you port PBS to new architectures
+# you should modify the lookup table. A better way would have been
+# to name the machines in a more "standard" way but it would require
+# a considerable amount of effort to find all the dependencies in
+# the code and documentation.    lonhyn@nas.nasa.gov
+#
+
+OS=`uname -s | tr '[A-Z]' '[a-z]'`
+REL=`uname -r`
+VER=`uname -v 2> /dev/null`
+
+test "$VER" = unicosmk && OS="$VER"
+
+bad_rel=n
+
+verbose=""; export verbose
+
+test "$1" = "-v" && verbose=yes
+
+case "$OS" in 
+
+  darwin*) mach=darwin ;;
+
+  linux*) mach=linux ;;
+
+  *)   test -n "$verbose" && \
+           echo $0: the operating system \"$OS\" is unknown >&2 ;
+       echo unknown ;
+       exit 1 ;;
+
+esac
+
+
+if test "$bad_rel" = y; then
+  test -n "$verbose" && \
+      echo $0: for operating system \"$OS\", release \"$REL\" is unknown >&2
+  echo unknown
+  exit 2
+fi
+
+echo $mach
+exit 0

+ 398 - 0
buildutils/pbs_mkdirs.in

@@ -0,0 +1,398 @@
+#!/bin/sh
+
+#
+# pbs_mkdirs:
+#
+# This will make the various directories that are needed for PBS
+# housekeeping.
+#
+# Usage:
+#  pbs_mkdirs [-v] [-c] what
+#    -v     be verbose
+#    -c     allow usage of chk_tree (do not use this within a make install)
+#    what   select from the following list
+#	       conf	-- /etc/pbs.conf.new file
+#              client   -- dirs needed by client programs
+#              server   -- dirs needed by pbs_server
+#              mom      -- dirs needed by pbs_mom
+#              comm	-- dirs needed by pbs_comm
+#              aux      -- the aux directory
+#              default  -- the default file
+#              check    -- run chk_tree (turns on -c automatically)
+#              all      -- do all of the above
+#
+#
+#
+# 
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+#
+# check tree should not be called until it is installed since
+# only relative paths are used by autoconf.
+#
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+CHK_TREE=@bindir@/chk_tree
+
+PBS_SERVER_HOME=@PBS_SERVER_HOME@
+PBS_DEFAULT_FILE=@PBS_DEFAULT_FILE@
+PBS_DEFAULT_SERVER=@PBS_DEFAULT_SERVER@
+PBS_DEFAULT_DATAPORT=@PBS_DEFAULT_DATAPORT@
+
+PBS_CONF_FILE=@PBS_CONF_FILE@
+PBS_ENVIRON=@PBS_ENVIRON@
+SCP_PATH=@SCP_PATH@
+database_dir=@database_dir@
+database_user=@database_user@
+database_port=@database_port@
+core_limit=@core_limit@
+
+PBS_UBIN=@bindir@
+PBS_SBIN=@sbindir@
+PBS_ETC=@etcdir@
+PBS_LIB=@libdir@
+PBS_UINC=@includedir@
+PBS_UNSUP=@unsupporteddir@
+
+verbose=""
+
+
+#
+# this will create a directory and any chain of parent directories
+# that might be needed
+# All of this is somewhat lame because install-sh is used
+# along with install_dir in various places. 
+#
+install_dir()
+{
+	# use the id_ for namespace disambiguation
+	id_dname="${IROOT}$1"
+	id_mode=`test -n "$2" && echo "$2" || echo 755`
+	id_owner=`test -n "$3" && echo "$3" || echo root`
+
+	# dlist will contain a list of directory names to make
+	id_dlist=""
+
+	while [ ! \( -z "$id_dname" -o "$id_dname" = / -o \
+		"$id_dname" = "." \) ]; do
+
+		test -f $id_dname && return 1
+		test -d $id_dname && break
+
+		id_dlist="`basename $id_dname` $id_dlist"
+		id_dname=`dirname "$id_dname"`
+	done
+
+	id_dir="$id_dname"
+	for id_d in $id_dlist ""; do
+		id_dir="$id_dir/$id_d"
+		test -z "$id_d" && return 0
+		mkdir $id_dir && chmod $id_mode $id_dir && \
+		    chown $id_owner $id_dir || return 1
+	done
+	return 0
+}
+
+#
+# This will take the name of the variable (not value) and
+# make a directory. This is just to stick with the original
+# way things were done in the top-level make file in PBS
+#
+install_dir_by_varname()
+{
+	idv_dvarname="$1"
+	idv_dname=${IROOT}`eval 'echo $'$idv_dvarname`
+
+	idv_mode=`test -n "$2" && echo "$2" || echo 755`
+	idv_owner=`test -n "$3" && echo "$3" || echo root`
+
+	if [ X$idv_dname = X ] ; then
+		echo $idv_dvarname is not defined 1>&2
+		return 1
+	elif [ -f $idv_dname ] ; then
+		echo $idv_dvarname exists and is not a directory 1>&2
+		return 1
+	elif [ -d $idv_dname ] ; then
+		chmod $idv_mode $idv_dname > /dev/null 2>&1
+		chown $idv_owner $idv_dname > /dev/null 2>&1
+		return 0
+	elif [ ! -d $idv_dname ] ; then
+		test -n "$verbose" && echo Creating $idv_dname
+		install_dir `dirname $idv_dname` 755 $idv_owner && \
+		    mkdir $idv_dname && chmod $idv_mode $idv_dname && \
+		    chown $idv_owner $idv_dname || return 1
+	fi
+
+	return 0
+}
+
+check_env()
+{
+	test -n "$verbose" && echo Making environment file
+	if [ ! -f ${IROOT}$PBS_ENVIRON ] ; then
+		install_dir `dirname $PBS_ENVIRON`
+		echo "PATH=/bin:/usr/bin" > ${IROOT}$PBS_ENVIRON
+		if [ X$TZ != X ] ; then
+			echo "TZ=$TZ" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LANG != X ] ; then
+			echo "LANG=$LANG" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_ALL != X ] ; then
+			echo "LC_ALL=$LC_ALL" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_COLLATE != X ] ; then
+			echo "LC_COLLATE=$LC_COLLATE" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_CTYPE != X ] ; then
+			echo "LC_CTYPE=$LC_CTYPE" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_MONETARY != X ] ; then
+			echo "LC_MONETARY=$LC_MONETARY" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_NUMERIC != X ] ; then
+			echo "LC_NUMERIC=$LC_NUMERIC" >> ${IROOT}$PBS_ENVIRON
+		fi
+		if [ X$LC_TIME != X ] ; then
+			echo "LC_TIME=$LC_TIME" >> ${IROOT}$PBS_ENVIRON
+		fi
+		chmod 644 ${IROOT}$PBS_ENVIRON
+	fi
+}
+
+make_momconfig()
+{
+	test -n "$verbose" && echo Creating Moms config file
+	if [ ! -f ${IROOT}$PBS_SERVER_HOME/mom_priv/config ] ; then
+		echo '$logevent 0x1ff' > ${IROOT}$PBS_SERVER_HOME/mom_priv/config
+		echo \$clienthost $PBS_DEFAULT_SERVER \
+			>> ${IROOT}$PBS_SERVER_HOME/mom_priv/config
+		chmod 644  ${IROOT}$PBS_SERVER_HOME/mom_priv/config
+	fi
+}
+
+chk_tree_wrap()
+{
+	test -n "$chktree" && $CHK_TREE $*
+}
+
+mk_cli_dirs()
+{
+	test -n "$verbose" && echo Creating Directories required for clients
+	install_dir_by_varname PBS_UBIN 755 $owner
+	install_dir_by_varname PBS_SBIN 755 $owner
+	install_dir_by_varname PBS_LIB  755 $owner
+	install_dir_by_varname PBS_LIB/pm  755 $owner
+	install_dir_by_varname PBS_UINC 755 $owner
+	install_dir_by_varname PBS_ETC 755 $owner
+	install_dir_by_varname PBS_UNSUP 755 $owner
+
+	chk_tree_wrap -d -n ${IROOT}$PBS_UBIN ${IROOT}$PBS_SBIN \
+			    ${IROOT}$PBS_LIB ${IROOT}$PBS_LIB/pm \
+			    ${IROOT}$PBS_UINC ${IROOT}$PBS_ETC \
+			    ${IROOT}$PBS_UNSUP		
+}
+
+mk_comm_dirs()
+{
+	test -n "$verbose" && echo Creating Directories required for Communication
+	install_dir $PBS_SERVER_HOME/comm_logs 755 $owner
+}
+
+
+mk_server_dirs()
+{
+	test -n "$verbose" && echo Creating Directories required for the Server
+	install_dir_by_varname PBS_SERVER_HOME 755 $owner
+
+	install_dir $PBS_SERVER_HOME/spool 1777 $owner
+	install_dir $PBS_SERVER_HOME/server_priv 750 $owner
+	install_dir $PBS_SERVER_HOME/server_priv/jobs 750 $owner
+	install_dir $PBS_SERVER_HOME/server_priv/users 750 $owner
+	install_dir $PBS_SERVER_HOME/server_priv/hooks 750 $owner
+	install_dir $PBS_SERVER_HOME/server_priv/hooks/tmp 750 $owner
+	install_dir $PBS_SERVER_HOME/server_priv/accounting 755 $owner
+	install_dir $PBS_SERVER_HOME/server_logs 755 $owner
+	install_dir $PBS_SERVER_HOME/sched_priv 750 $owner
+	install_dir $PBS_SERVER_HOME/sched_logs 755 $owner
+
+	test -f ${IROOT}$PBS_ENVIRON || check_env
+
+	chk_tree_wrap -d -n ${IROOT}$PBS_SERVER_HOME/server_priv/jobs \
+		${IROOT}$PBS_SERVER_HOME/server_priv/users \
+		${IROOT}$PBS_SERVER_HOME/server_priv/hooks \
+		${IROOT}$PBS_SERVER_HOME/server_priv/hooks/tmp \
+		${IROOT}$PBS_SERVER_HOME/server_priv/accounting \
+		${IROOT}$PBS_SERVER_HOME/server_logs
+	chk_tree_wrap -d -n -s ${IROOT}$PBS_SERVER_HOME/spool
+	chk_tree_wrap -n ${IROOT}$PBS_ENVIRON
+}
+
+
+mk_mom_dirs()
+{
+	test -n "$verbose" && echo Creating Directories required for MOM
+
+	install_dir_by_varname PBS_SERVER_HOME 755 $owner
+
+	test -d ${IROOT}$PBS_SERVER_HOME/spool || \
+	    install_dir ${IROOT}$PBS_SERVER_HOME/spool 1777 $owner
+
+	install_dir $PBS_SERVER_HOME/checkpoint 700 $owner
+	install_dir $PBS_SERVER_HOME/undelivered  1777 $owner
+	install_dir $PBS_SERVER_HOME/mom_priv 751 $owner
+	install_dir $PBS_SERVER_HOME/mom_priv/jobs 751 $owner
+	install_dir $PBS_SERVER_HOME/mom_priv/hooks 750 $owner
+	install_dir $PBS_SERVER_HOME/mom_priv/hooks/tmp 750 $owner
+	install_dir $PBS_SERVER_HOME/mom_logs 755 $owner
+
+	test -f ${IROOT}$PBS_ENVIRON || check_env
+
+	test -f ${IROOT}$PBS_SERVER_HOME/mom_priv/config || make_momconfig
+
+	chk_tree_wrap -d -n ${IROOT}$PBS_SERVER_HOME/checkpoint \
+		${IROOT}$PBS_SERVER_HOME/mom_priv/jobs \
+	        ${IROOT}$PBS_SERVER_HOME/mom_priv/hooks \
+		${IROOT}$PBS_SERVER_HOME/mom_priv/hooks/tmp \
+		${IROOT}$PBS_SERVER_HOME/mom_logs
+	chk_tree_wrap -d -n -s ${IROOT}$PBS_SERVER_HOME/spool \
+		${IROOT}$PBS_SERVER_HOME/undelivered
+	chk_tree_wrap -n ${IROOT}$PBS_ENVIRON
+}
+
+mk_default_file()
+{
+	test -n "$verbose" && echo Making default server file
+
+	install_dir `dirname ${IROOT}$PBS_DEFAULT_FILE`
+
+	rm -f ${IROOT}$PBS_DEFAULT_FILE > /dev/null 2>&1
+	echo $PBS_DEFAULT_SERVER > ${IROOT}$PBS_DEFAULT_FILE && \
+	    chmod 644 ${IROOT}$PBS_DEFAULT_FILE
+
+	chk_tree_wrap -n ${IROOT}$PBS_DEFAULT_FILE
+}
+
+mk_aux_dir()
+{
+	install_dir $PBS_SERVER_HOME/aux 755
+	chk_tree_wrap -d -n ${IROOT}$PBS_SERVER_HOME/aux
+}
+
+do_check_tree()
+{
+	chk_tree_wrap -d ${IROOT}$PBS_SERVER_HOME/server_priv/jobs \
+		${IROOT}$PBS_SERVER_HOME/server_priv/users \
+		${IROOT}$PBS_SERVER_HOME/server_priv/hooks \
+		${IROOT}$PBS_SERVER_HOME/server_priv/hooks/tmp \
+		${IROOT}$PBS_SERVER_HOME/server_priv/accounting \
+		${IROOT}$PBS_SERVER_HOME/server_logs
+	chk_tree_wrap -d ${IROOT}$PBS_SERVER_HOME/checkpoint \
+		${IROOT}$PBS_SERVER_HOME/mom_priv/jobs \
+		${IROOT}$PBS_SERVER_HOME/mom_priv/hooks \
+		${IROOT}$PBS_SERVER_HOME/mom_priv/hooks/tmp \
+		${IROOT}$PBS_SERVER_HOME/mom_logs
+	chk_tree_wrap -d -s ${IROOT}$PBS_SERVER_HOME/spool \
+		${IROOT}$PBS_SERVER_HOME/undelivered
+	chk_tree_wrap -d ${IROOT}$PBS_SERVER_HOME/aux
+	chk_tree_wrap ${IROOT}$PBS_DEFAULT_FILE
+}
+
+# mk_conf_file() will make /etc/pbs.conf.new with basic info
+# as server/remom files are added the start entries for those daemons are added
+
+mk_conf_file()
+{
+	test -n "$verbose" && echo Making global config file
+	install_dir `dirname ${IROOT}${PBS_CONF_FILE}`
+	if [ -f ${IROOT}${PBS_CONF_FILE} ] ; then
+		target="${IROOT}${PBS_CONF_FILE}.`date +%s`"
+		echo Moving existing ${IROOT}${PBS_CONF_FILE} to ${target}
+		mv ${IROOT}${PBS_CONF_FILE} ${target}
+	fi
+	echo PBS_EXEC=$exec_prefix > ${IROOT}${PBS_CONF_FILE}
+	echo PBS_HOME=$PBS_SERVER_HOME >>  ${IROOT}${PBS_CONF_FILE}
+	echo PBS_START_SERVER=0 >> ${IROOT}${PBS_CONF_FILE}
+	echo PBS_START_MOM=0 >> ${IROOT}${PBS_CONF_FILE}
+	echo PBS_START_SCHED=0 >> ${IROOT}${PBS_CONF_FILE}
+	echo PBS_START_COMM=0 >> ${IROOT}${PBS_CONF_FILE}
+	echo PBS_SERVER=$PBS_DEFAULT_SERVER >> ${IROOT}${PBS_CONF_FILE}
+	echo PBS_ENVIRONMENT=$PBS_ENVIRON >> ${IROOT}${PBS_CONF_FILE}
+        echo PBS_CORE_LIMIT=$core_limit >> ${IROOT}${PBS_CONF_FILE}
+	if [ -n "$SCP_PATH" ] ; then
+		echo PBS_SCP=$SCP_PATH >> ${IROOT}${PBS_CONF_FILE}
+	fi
+	if [ "$database_port" != "$PBS_DEFAULT_DATAPORT" ]; then
+		echo PBS_DATA_SERVICE_PORT=$database_port >> ${IROOT}${PBS_CONF_FILE}
+	fi
+	chmod 644 ${IROOT}${PBS_CONF_FILE}
+}
+
+
+# mk_dirs() will generate the set of directories needed 
+# for server and mom execution.
+
+mk_dirs()
+{
+	chktree=yes
+	mk_cli_dirs
+	mk_server_dirs
+	mk_mom_dirs
+	mk_comm_dirs
+	mk_default_file
+	mk_aux_dir
+}
+
+
+while true; do
+	case "$1" in
+	    -v)       verbose=yes ; shift; continue ;;
+	    -c)       chktree=yes ; shift; continue ;;
+	    -d)	      shift; PBS_SERVER_HOME=$1; shift; continue;;
+	    conf)     mk_conf_file ; break ;;
+	    cli*)     mk_cli_dirs ; break ;;
+	    serv*)    mk_server_dirs ; break ;;
+	    mom*)     mk_mom_dirs ; break ;;
+	    com*)     mk_comm_dirs ; break ;;
+	    aux*)     mk_aux_dir ; break ;;
+	    default*) mk_default_file ; break ;;
+	    check*)   chktree=yes; do_check_tree ; break ;;
+	    all*)     mk_dirs ; break ;;
+	esac
+done
+

+ 170 - 0
buildutils/py-compile

@@ -0,0 +1,170 @@
+#!/bin/sh
+# py-compile - Compile a Python program
+
+scriptversion=2011-06-08.12; # UTC
+
+# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+if [ -z "$PYTHON" ]; then
+  PYTHON=python
+fi
+
+me=py-compile
+
+usage_error ()
+{
+  echo "$me: $*" >&2
+  echo "Try '$me --help' for more information." >&2
+  exit 1
+}
+
+basedir=
+destdir=
+while test $# -ne 0; do
+  case "$1" in
+    --basedir)
+      if test $# -lt 2; then
+        usage_error "option '--basedir' requires an argument"
+      else
+        basedir=$2
+      fi
+      shift
+      ;;
+    --destdir)
+      if test $# -lt 2; then
+        usage_error "option '--destdir' requires an argument"
+      else
+        destdir=$2
+      fi
+      shift
+      ;;
+    -h|--help)
+      cat <<\EOF
+Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
+
+Byte compile some python scripts FILES.  Use --destdir to specify any
+leading directory path to the FILES that you don't want to include in the
+byte compiled file.  Specify --basedir for any additional path information you
+do want to be shown in the byte compiled file.
+
+Example:
+  py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+      exit $?
+      ;;
+    -v|--version)
+      echo "$me $scriptversion"
+      exit $?
+      ;;
+    --)
+      shift
+      break
+      ;;
+    -*)
+      usage_error "unrecognized option '$1'"
+      ;;
+    *)
+      break
+      ;;
+  esac
+  shift
+done
+
+files=$*
+if test -z "$files"; then
+    usage_error "no files given"
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+    pathtrans="path = file"
+else
+    pathtrans="path = os.path.join('$basedir', file)"
+fi
+
+# if destdir was given, then it needs to be prepended to the filename to
+# byte compile but not go into the compiled file.
+if [ -z "$destdir" ]; then
+    filetrans="filepath = path"
+else
+    filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
+fi
+
+$PYTHON -c "
+import sys, os, py_compile, imp
+
+files = '''$files'''
+
+sys.stdout.write('Byte-compiling python modules...\n')
+for file in files.split():
+    $pathtrans
+    $filetrans
+    if not os.path.exists(filepath) or not (len(filepath) >= 3
+                                            and filepath[-3:] == '.py'):
+	    continue
+    sys.stdout.write(file)
+    sys.stdout.flush()
+    if hasattr(imp, 'get_tag'):
+        py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+    else:
+        py_compile.compile(filepath, filepath + 'c', path)
+sys.stdout.write('\n')" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, py_compile, imp
+
+# pypy does not use .pyo optimization
+if hasattr(sys, 'pypy_translation_info'):
+    sys.exit(0)
+
+files = '''$files'''
+sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
+for file in files.split():
+    $pathtrans
+    $filetrans
+    if not os.path.exists(filepath) or not (len(filepath) >= 3
+                                            and filepath[-3:] == '.py'):
+	    continue
+    sys.stdout.write(file)
+    sys.stdout.flush()
+    if hasattr(imp, 'get_tag'):
+        py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+    else:
+        py_compile.compile(filepath, filepath + 'o', path)
+sys.stdout.write('\n')" 2>/dev/null || :
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 198 - 0
buildutils/python-autoconf.py

@@ -0,0 +1,198 @@
+# coding: utf-8
+#
+
+#
+# Python module to detect python settings to build and install python
+#  embedded interpreter and any external modules
+# 
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+# NOTE:
+#   - requires the distutils, os and sys packages to be installed.
+
+_REQUIRED_VERSION_MIN = '2.6.0'
+_REQUIRED_VERSION_MAX = '2.7.99'
+
+import sys
+import os
+
+if sys.version < _REQUIRED_VERSION_MIN or sys.version > _REQUIRED_VERSION_MAX:
+    print "requires python version >= %s" % (_REQUIRED_VERSION,)
+    raise SystemExit,2
+
+from optparse import OptionParser
+from distutils import sysconfig
+
+get_py_config_var = sysconfig.get_config_var
+py_version = get_py_config_var('VERSION')
+
+if py_version is None:
+    py_version = sys.version[:3]
+    
+py_stdlibdir = get_py_config_var('LIBDIR')
+# the actual LIBDIR in case install path got moved
+if py_stdlibdir:
+    py_stdlibdir_real  = "%s/%s" % (sysconfig.PREFIX, py_stdlibdir.split(os.sep)[-1])
+else:
+    py_stdlibdir_real  = "%s/lib" % (sysconfig.PREFIX,) 
+
+py_lib_configdir = get_py_config_var('LIBPL')
+if py_lib_configdir:
+    py_lib_configdir=py_lib_configdir.replace(py_stdlibdir,py_stdlibdir_real)
+
+def get_includes():
+    """get compiled pythons include directories"""
+
+    rv = ["-I%s" % (sysconfig.get_python_inc(plat_specific=1),), "-I%s" % (sysconfig.get_python_inc(),)]
+    return " ".join(rv)
+#:: get_includes()
+
+def get_cflags():
+    """get compiler flags"""
+    rv = ""
+    cflags = get_py_config_var('CFLAGS')
+    if cflags:
+        rv = " ".join(cflags.split())
+        #: TODO you could remove some options?
+    return rv   
+#:: get_cflags()
+
+def get_libs():
+    """get libraries to link with"""
+    rv = ""
+    tmp_list = []
+    if py_lib_configdir:
+        tmp_list.append('-L%s' % (py_lib_configdir,))
+    tmp_list.append("-lpython%s" % (py_version,))
+    libs = get_py_config_var('LIBS')
+    if libs:
+        tmp_list.extend(libs.split())
+    syslibs = get_py_config_var('SYSLIBS')
+    if syslibs:
+        tmp_list.extend(syslibs.split())
+    if tmp_list:
+        rv = " ".join(tmp_list)
+    return rv   
+#:: get_libs()
+
+def get_ldflags():
+    """get linker flags for the compiled python"""
+
+    rv = ""
+    tmp_list = []
+    
+    #: this is needed so that symbols are not removed from the static library
+    #: when shared modules need to be loaded
+    
+    py_link_for_shared = get_py_config_var('LINKFORSHARED')
+    if py_lib_configdir:
+        py_link_for_shared = py_link_for_shared.replace("Modules",
+							py_lib_configdir);
+    if py_link_for_shared:
+        tmp_list.append(py_link_for_shared)
+        
+    if tmp_list:
+        rv = " ".join(tmp_list)
+        
+    return rv   
+#:: get_ldflagss()
+
+def get_stdlibdir():
+    """The installed pythons library directory"""
+
+    rv = ""
+    tmp_list = []
+    
+    
+    if py_stdlibdir_real:
+        tmp_list.append(py_stdlibdir_real)
+        
+    if tmp_list:
+        rv = " ".join(tmp_list)
+        
+    return rv   
+#:: get_stdlibdir()
+
+
+def setupOptions():
+    usage = "usage: %prog [options]"
+    parser = OptionParser(usage=usage)
+    parser.add_option("--includes", action="store_true", dest="includes", 
+                      help="get header file includes for python installation")
+    parser.add_option("--cflags", action="store_true", dest="cflags", 
+                      help="get Compiler flags")
+    parser.add_option("--libs", action="store_true", dest="libs", 
+                      help="get additional libraries to be linked with")
+    parser.add_option("--ldflags",action="store_true", dest="ldflags",
+                      help="get library flags")
+    parser.add_option("--stdlibdir",action="store_true", dest="stdlibdir",
+                      help="get installed python's libdir")
+    parser.add_option("--py-version",action="store_true", dest="py_version",
+                      help="get version string to determine the installed python standard modules dir")
+    parser.add_option("--stdlibmoddir",action="store_true", dest="stdlibmoddir",
+                      help="get installed python's standard modules libdir")
+    parser.add_option("--stdlibmodshareddir",action="store_true", dest="stdlibmodshareddir",
+                      help="get installed python's standard modules *shared* libdir")
+    return parser.parse_args()
+#:: seetupOptions()
+
+
+def Main():
+    (options, args) = setupOptions()
+    if options.ldflags:
+        print get_ldflags()
+    elif options.libs:
+        print get_libs()
+    elif options.cflags:
+        print get_cflags()
+    elif options.includes:
+        print get_includes() 
+    elif options.stdlibdir:
+        print get_stdlibdir() 
+    elif options.py_version:
+        print py_version 
+    elif options.stdlibmoddir:
+        print \
+	 get_py_config_var('DESTLIB').replace(py_stdlibdir,py_stdlibdir_real)
+    elif options.stdlibmodshareddir:
+        print \
+	 get_py_config_var('DESTSHARED').replace(py_stdlibdir,py_stdlibdir_real)
+#:: Main()
+
+if __name__ == '__main__':
+    Main()
+

+ 249 - 0
buildutils/ylwrap

@@ -0,0 +1,249 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2012-12-21.17; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+get_dirname ()
+{
+  case $1 in
+    */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+    # Otherwise,  we want the empty string (not ".").
+  esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard()
+{
+  printf '%s\n' "$1"                                                    \
+    | sed                                                               \
+        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'   \
+        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'                        \
+        -e 's/__*/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+  case $# in
+    0) cat;;
+    1) printf '%s\n' "$1";;
+  esac \
+    | sed -e 's|[][\\.*]|\\&|g'
+}
+
+case "$1" in
+  '')
+    echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
+    exit 1
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+  INPUT is the input file
+  OUTPUT is one file PROG generates
+  DESIRED is the file we actually want instead of OUTPUT
+  PROGRAM is program to run
+  ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit $?
+    ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
+case "$input" in
+  [\\/]* | ?:[\\/]*)
+    # Absolute path; do nothing.
+    ;;
+  *)
+    # Relative path.  Make it absolute.
+    input="`pwd`/$input"
+    ;;
+esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# Since DOS filename conventions don't allow two dots,
+# the DOS version of Bison writes out y_tab.c instead of y.tab.c
+# and y_tab.h instead of y.tab.h. Test to see if this is the case.
+y_tab_nodot=false
+if test -f y_tab.c || test -f y_tab.h; then
+  y_tab_nodot=true
+fi
+
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
+while test "$#" -ne 0; do
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  from=$1
+  # Handle y_tab.c and y_tab.h output by DOS
+  if $y_tab_nodot; then
+    case $from in
+      "y.tab.c") from=y_tab.c;;
+      "y.tab.h") from=y_tab.h;;
+    esac
+  fi
+  shift
+  to=$1
+  shift
+  sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+  sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+  [\\/]* | ?:[\\/]*) ;;
+  *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines.  But that might take us over the 14-char limit.
+dirname=ylwrap$$
+do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
+trap "ret=129; $do_exit" 1
+trap "ret=130; $do_exit" 2
+trap "ret=141; $do_exit" 13
+trap "ret=143; $do_exit" 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+  0) "$prog" "$input" ;;
+  *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+  for from in *
+  do
+    to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
+    if test -f "$from"; then
+      # If $2 is an absolute path name, then just use that,
+      # otherwise prepend '../'.
+      case $to in
+        [\\/]* | ?:[\\/]*) target=$to;;
+        *) target="../$to";;
+      esac
+
+      # Do not overwrite unchanged header files to avoid useless
+      # recompilations.  Always update the parser itself: it is the
+      # destination of the .y.c rule in the Makefile.  Divert the
+      # output of all other files to a temporary file so we can
+      # compare them to existing versions.
+      if test $from != $parser; then
+        realtarget="$target"
+        target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
+      fi
+
+      # Munge "#line" or "#" directives.  Don't let the resulting
+      # debug information point at an absolute srcdir.  Use the real
+      # output file name, not yy.lex.c for instance.  Adjust the
+      # include guards too.
+      sed -e "/^#/!b"                           \
+          -e "s|$input_rx|$input_sub_rx|"       \
+          -e "$sed_fix_filenames"               \
+          -e "$sed_fix_header_guards"           \
+        "$from" >"$target" || ret=$?
+
+      # Check whether files must be updated.
+      if test "$from" != "$parser"; then
+        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+          echo "$to is unchanged"
+          rm -f "$target"
+        else
+          echo "updating $to"
+          mv -f "$target" "$realtarget"
+        fi
+      fi
+    else
+      # A missing file is only an error for the parser.  This is a
+      # blatant hack to let us support using "yacc -d".  If -d is not
+      # specified, don't fail when the header file is "missing".
+      if test "$from" = "$parser"; then
+        ret=1
+      fi
+    fi
+  done
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:

+ 404 - 0
configure.ac

@@ -0,0 +1,404 @@
+
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+AC_PREREQ([2.63])
+# Use PBS_VERSION to override the version statically defined here. For example:
+# ./configure PBS_VERSION=19.1.3 --prefix=/opt/pbs
+AC_INIT([PBS Professional],
+  [19.1.3],
+  [pbssupport@altair.com],
+  [pbspro],
+  [http://www.pbspro.org/])
+AC_CONFIG_HEADERS([src/include/pbs_config.h])
+AC_CONFIG_SRCDIR([src/cmds/qmgr.c])
+AC_CONFIG_AUX_DIR([buildutils])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_TARGET([])
+os_id=`grep ^ID= /etc/os-release | sed -n 's/.*"\(.*\)"/\1/p'`
+AS_CASE([$os_id],
+  [opensuse-tumbleweed], m4_define([am_init_string], [-Wall foreign subdir-objects]),
+  [*], m4_define([am_init_string], [-Wall foreign]))
+AM_INIT_AUTOMAKE(am_init_string)
+AC_USE_SYSTEM_EXTENSIONS
+
+
+# Checks for programs.
+AC_PROG_AWK
+AC_PROG_YACC
+AC_PROG_SED
+AC_PROG_CC
+AC_PROG_LEX
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+# Automake macros
+#AM_PROG_AR macro is defined with automake version >= 1.12
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+AM_PROG_CC_C_O
+
+# Initialize libtool
+LT_INIT([shared static])
+
+# Checks for libraries.
+AC_CHECK_LIB([c], [xdr_int],
+  [],
+  AC_CHECK_LIB(nsl, xdr_int)
+)
+AC_CHECK_LIB([c], [ruserok],
+  [],
+  AC_CHECK_LIB(socket, ruserok)
+)
+AC_CHECK_LIB([c], [crypt],
+  [],
+  AC_CHECK_LIB(crypt, crypt)
+)
+AC_CHECK_LIB([c], [posix_openpt],
+  AC_DEFINE([HAVE_POSIX_OPENPT], [], [Defined whe posix_openpt is available])
+)
+AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_LIB([kvm], [kvm_open])
+AC_CHECK_LIB([socket], [socket],
+  [socket_lib="-lsocket -lnsl"]
+  AC_SUBST(socket_lib),
+  [socket_lib=""]
+  AC_SUBST(socket_lib),
+  [-lnsl]
+)
+AC_CHECK_LIB([c], [malloc_info],
+  AC_DEFINE([HAVE_MALLOC_INFO], [], [Defined when malloc_info is available])
+)
+
+# Check for X Window System
+AC_PATH_XTRA
+
+# Checks for optional header files.
+AC_CHECK_HEADERS([ \
+	com_err.h \
+	gssapi.h \
+	krb5.h \
+	libpq-fe.h \
+	mach/mach.h \
+	nlist.h \
+	sys/eventfd.h \
+	sys/systeminfo.h \
+])
+
+# Checks for required header files.
+AC_CHECK_HEADERS([ \
+	stdio.h \
+	alloca.h \
+	arpa/inet.h \
+	asm/types.h \
+	assert.h \
+	crypt.h \
+	ctype.h \
+	dirent.h \
+	dlfcn.h \
+	execinfo.h \
+	fcntl.h \
+	features.h \
+	float.h \
+	fstab.h \
+	ftw.h \
+	grp.h \
+	libgen.h \
+	limits.h \
+	malloc.h \
+	math.h \
+	memory.h \
+	mntent.h \
+	netdb.h \
+	netinet/in.h \
+	netinet/in_systm.h \
+	netinet/ip.h \
+	netinet/tcp.h \
+	openssl/aes.h \
+	openssl/bio.h \
+	openssl/err.h \
+	openssl/evp.h \
+	openssl/ssl.h \
+	paths.h \
+	poll.h \
+	pthread.h \
+	pwd.h \
+	regex.h \
+	signal.h \
+	stddef.h \
+	stdint.h \
+	stdio.h \
+	stdlib.h \
+	string.h \
+	strings.h \
+	syscall.h \
+	syslog.h \
+	sys/epoll.h \
+	sys/fcntl.h \
+	sys/file.h \
+	sys/ioctl.h \
+	sys/mman.h \
+	sys/mount.h \
+	sys/param.h \
+	sys/poll.h \
+	sys/prctl.h \
+	sys/procfs.h \
+	sys/quota.h \
+	sys/resource.h \
+	sys/select.h \
+	sys/signal.h \
+	sys/socket.h \
+	sys/statfs.h \
+	sys/stat.h \
+	sys/statvfs.h \
+	sys/sysctl.h \
+	sys/sysinfo.h \
+	sys/sysmacros.h \
+	sys/time.h \
+	sys/timeb.h \
+	sys/times.h \
+	sys/types.h \
+	sys/uio.h \
+	sys/un.h \
+	sys/unistd.h \
+	sys/user.h \
+	sys/utsname.h \
+	sys/vfs.h \
+	sys/wait.h \
+	termios.h \
+	time.h \
+	unistd.h \
+	utime.h \
+	X11/Intrinsic.h \
+	X11/X.h \
+	X11/Xlib.h \
+	zlib.h \
+	],, AC_MSG_ERROR([Required header file is missing.]) \
+)
+
+# Checks for typedefs, structures, and compiler characteristics.
+#AC_CHECK_HEADER_STDBOOL macro is defined with autoconf version >= 2.67
+m4_ifdef([AC_CHECK_HEADER_STDBOOL], [AC_CHECK_HEADER_STDBOOL])
+AC_TYPE_UID_T
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+# Checks for library functions.
+AC_FUNC_ALLOCA
+AC_FUNC_CHOWN
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_GETGROUPS
+AC_FUNC_GETMNTENT
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_FUNC_MALLOC
+AC_FUNC_MKTIME
+AC_FUNC_MMAP
+AC_FUNC_REALLOC
+AC_FUNC_STRERROR_R
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([ \
+	alarm \
+	atexit \
+	bzero \
+	dup2 \
+	endpwent \
+	floor \
+	ftruncate \
+	getcwd \
+	gethostbyaddr \
+	gethostbyname \
+	gethostname \
+	getmntent \
+	getpagesize \
+	gettimeofday \
+	hasmntopt \
+	inet_ntoa \
+	localtime_r \
+	memchr \
+	memmove \
+	memset \
+	mkdir \
+	munmap \
+	pathconf \
+	poll \
+	pstat_getdynamic \
+	putenv \
+	realpath \
+	regcomp \
+	rmdir \
+	select \
+	setresuid \
+	setresgid \
+	seteuid \
+	setegid \
+	strerror_r \
+	socket \
+	strcasecmp \
+	strchr \
+	strcspn \
+	strdup \
+	strerror \
+	strncasecmp \
+	strpbrk \
+	strrchr \
+	strspn \
+	strstr \
+	strtol \
+	strtoul \
+	strtoull \
+	sysinfo \
+	uname \
+	utime \
+])
+
+PKG_PROG_PKG_CONFIG
+m4_ifdef([PKG_INSTALLDIR],
+  [PKG_INSTALLDIR],
+  [
+    pkgconfigdir=/usr/lib64/pkgconfig
+    AC_SUBST([pkgconfigdir])
+  ])
+
+
+# PBS macros (order matters for some of these)
+PBS_AC_PBS_VERSION
+PBS_AC_MACHINE_TYPE
+PBS_AC_DECL_H_ERRNO
+PBS_AC_DECL_SOCKLEN_T
+PBS_AC_DECL_EPOLL
+PBS_AC_DECL_EPOLL_PWAIT
+PBS_AC_DECL_PPOLL
+PBS_AC_WITH_SERVER_HOME
+PBS_AC_WITH_SERVER_NAME_FILE
+PBS_AC_WITH_DATABASE_DIR
+PBS_AC_WITH_DATABASE_USER
+PBS_AC_WITH_DATABASE_PORT
+PBS_AC_WITH_PBS_CONF_FILE
+PBS_AC_WITH_TMP_DIR
+PBS_AC_WITH_UNSUPPORTED_DIR
+PBS_AC_WITH_CORE_LIMIT
+PBS_AC_WITH_PYTHON
+PBS_AC_WITH_EXPAT
+PBS_AC_WITH_EDITLINE
+PBS_AC_WITH_HWLOC
+PBS_AC_WITH_LIBICAL
+PBS_AC_WITH_SENDMAIL
+PBS_AC_WITH_SWIG
+PBS_AC_WITH_TCL
+PBS_AC_WITH_TCLATRSEP
+PBS_AC_WITH_XAUTH
+PBS_AC_WITH_MIN_STACK_LIMIT
+PBS_AC_DISABLE_RPP
+PBS_AC_DISABLE_SHELL_PIPE
+PBS_AC_DISABLE_SYSLOG
+PBS_AC_ENABLE_ALPS
+PBS_AC_ENABLE_CPUSET
+PBS_AC_WITH_LIBZ
+PBS_AC_ENABLE_PTL
+PBS_AC_SYSTEMD_UNITDIR
+
+AC_CONFIG_FILES([
+	pbspro.spec
+	Makefile
+	buildutils/Makefile
+	buildutils/pbs_mkdirs
+	doc/Makefile
+	test/Makefile
+	test/fw/Makefile
+	test/tests/Makefile
+	test/fw/setup.py
+	test/fw/ptl/__init__.py
+	src/Makefile
+	src/cmds/Makefile
+	src/cmds/mpiexec
+	src/cmds/nqs2pbs
+	src/cmds/pbs_lamboot
+	src/cmds/pbs_mpihp
+	src/cmds/pbs_mpilam
+	src/cmds/pbs_mpirun
+	src/cmds/pbs_remsh
+	src/cmds/pbsrun_unwrap
+	src/cmds/pbsrun_wrap
+	src/cmds/pbsrun
+	src/cmds/scripts/Makefile
+	src/cmds/scripts/au-nodeupdate
+	src/cmds/scripts/modulefile
+	src/cmds/scripts/pbs_habitat
+	src/cmds/scripts/pbs_init.d
+	src/cmds/scripts/pbs_poerun
+	src/cmds/scripts/pbs_postinstall
+	src/cmds/scripts/pbs.service
+	src/cmds/scripts/pbsrun.poe
+	src/hooks/Makefile
+	src/iff/Makefile
+	src/include/Makefile
+	src/include/pbs_version.h
+	src/lib/Libattr/Makefile
+	src/lib/Libdb/Makefile
+	src/lib/Liblog/Makefile
+	src/lib/Libnet/Makefile
+	src/lib/Libpbs/Makefile
+	src/lib/Libpbs/pbs.pc
+	src/lib/Libpython/Makefile
+	src/lib/Libsec/Makefile
+	src/lib/Libsite/Makefile
+	src/lib/Libtpp/Makefile
+	src/lib/Libutil/Makefile
+	src/lib/Makefile
+	src/modules/Makefile
+	src/modules/python/Makefile
+	src/mom_rcp/Makefile
+	src/resmom/Makefile
+	src/scheduler/Makefile
+	src/server/Makefile
+	src/tools/Makefile
+	src/tools/wrap_tcl.sh
+	src/unsupported/Makefile
+	src/unsupported/pbs_diag
+	src/unsupported/pbs_dtj
+])
+AC_OUTPUT

+ 164 - 0
doc/Makefile.am

@@ -0,0 +1,164 @@
+
+#
+# Copyright (C) 1994-2018 Altair Engineering, Inc.
+# For more information, contact Altair at www.altair.com.
+#
+# This file is part of the PBS Professional ("PBS Pro") software.
+#
+# Open Source License Information:
+#
+# PBS Pro is free software. You can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commercial License Information:
+#
+# For a copy of the commercial license terms and conditions,
+# go to: (http://www.pbspro.com/UserArea/agreement.html)
+# or contact the Altair Legal Department.
+#
+# Altair’s dual-license business model allows companies, individuals, and
+# organizations to create proprietary derivative works of PBS Pro and
+# distribute them - whether embedded or bundled with other software -
+# under a commercial license agreement.
+#
+# Use of Altair’s trademarks, including but not limited to "PBS™",
+# "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+# trademark licensing policies.
+#
+
+notrans_dist_man1_MANS = \
+	man1/nqs2pbs.1B \
+	man1/pbsdsh.1B \
+	man1/pbs_python.1B \
+	man1/pbs_ralter.1B \
+	man1/pbs_rdel.1B \
+	man1/pbs_release_nodes.1B \
+	man1/pbs_rstat.1B \
+	man1/pbs_rsub.1B \
+	man1/qalter.1B \
+	man1/qdel.1B \
+	man1/qhold.1B \
+	man1/qmove.1B \
+	man1/qmsg.1B \
+	man1/qorder.1B \
+	man1/qrerun.1B \
+	man1/qrls.1B \
+	man1/qselect.1B \
+	man1/qsig.1B \
+	man1/qstat.1B \
+	man1/qsub.1B
+
+notrans_dist_man3_MANS = \
+	man3/pbs_alterjob.3B \
+	man3/pbs_connect.3B \
+	man3/pbs_default.3B \
+	man3/pbs_deljob.3B \
+	man3/pbs_delresv.3B \
+	man3/pbs_disconnect.3B \
+	man3/pbs_geterrmsg.3B \
+	man3/pbs_holdjob.3B \
+	man3/pbs_locjob.3B \
+	man3/pbs_manager.3B \
+	man3/pbs_modify_resv.3B \
+	man3/pbs_movejob.3B \
+	man3/pbs_msgjob.3B \
+	man3/pbs_orderjob.3B \
+	man3/pbs_rerunjob.3B \
+	man3/pbs_rescreserve.3B \
+	man3/pbs_relnodesjob.3B \
+	man3/pbs_rlsjob.3B \
+	man3/pbs_runjob.3B \
+	man3/pbs_selectjob.3B \
+	man3/pbs_selstat.3B \
+	man3/pbs_sigjob.3B \
+	man3/pbs_stagein.3B \
+	man3/pbs_statfree.3B \
+	man3/pbs_stathook.3B \
+	man3/pbs_statjob.3B \
+	man3/pbs_statnode.3B \
+	man3/pbs_statque.3B \
+	man3/pbs_statresv.3B \
+	man3/pbs_statrsc.3B \
+	man3/pbs_statsched.3B \
+	man3/pbs_statserver.3B \
+	man3/pbs_submit.3B \
+	man3/pbs_submit_resv.3B \
+	man3/pbs_tclapi.3B \
+	man3/pbs_terminate.3B \
+	man3/rm.3B \
+	man3/rpp.3 \
+	man3/tm.3
+
+noinst_man3_MANS = \
+	man3/pbs_rescquery.3B \
+	man3/pbs_submitresv.3B
+
+notrans_dist_man7_MANS = \
+	man1/pbs_hook_attributes.7B \
+	man1/pbs_job_attributes.7B \
+	man1/pbs_module.7B \
+	man1/pbs_node_attributes.7B \
+	man1/pbs_professional.7B \
+	man1/pbs_queue_attributes.7B \
+	man1/pbs_resources.7B \
+	man1/pbs_resv_attributes.7B \
+	man1/pbs_sched_attributes.7B \
+	man1/pbs_server_attributes.7B
+
+notrans_dist_man8_MANS = \
+	man8/mpiexec.8B \
+	man8/pbs.8B \
+	man8/pbs_account.8B \
+	man8/pbs_attach.8B \
+	man8/pbs_comm.8B \
+	man8/pbs.conf.8B \
+	man8/pbs_dataservice.8B \
+	man8/pbs_diag.8B \
+	man8/pbs_ds_password.8B \
+	man8/pbsfs.8B \
+	man8/pbs_hostn.8B \
+	man8/pbs_idled.8B \
+	man8/pbs_iff.8B \
+	man8/pbs_interactive.8B \
+	man8/pbs_lamboot.8B \
+	man8/pbs_migrate_users.8B \
+	man8/pbs_migration_assistant.bat.8B \
+	man8/pbs_mkdirs.8B \
+	man8/pbs_mom.8B \
+	man8/pbs_mpihp.8B \
+	man8/pbs_mpilam.8B \
+	man8/pbs_mpirun.8B \
+	man8/pbsnodes.8B \
+	man8/pbs_password.8B \
+	man8/pbs_probe.8B \
+	man8/pbsrun.8B \
+	man8/pbsrun_unwrap.8B \
+	man8/pbsrun_wrap.8B \
+	man8/pbs_sched.8B \
+	man8/pbs_server.8B \
+	man8/pbs_snapshot.8B \
+	man8/pbs_tclsh.8B \
+	man8/pbs_tmrsh.8B \
+	man8/pbs_topologyinfo.8B \
+	man8/pbs_wish.8B \
+	man8/printjob.8B \
+	man8/qdisable.8B \
+	man8/qenable.8B \
+	man8/qmgr.8B \
+	man8/qrun.8B \
+	man8/qstart.8B \
+	man8/qstop.8B \
+	man8/qterm.8B \
+	man8/tracejob.8B \
+	man8/win_postinstall.py.8B
+

+ 104 - 0
doc/man1/nqs2pbs.1B

@@ -0,0 +1,104 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH nqs2pbs 1B "1 Oct 2009" Local "PBS Professional"
+.SH NAME
+.B nqs2pbs 
+- convert NQS job scripts to PBS format
+
+.SH SYNOPSIS
+.B nqs2pbs 
+<NQS script> [<PBS script>]
+.br
+.B nqs2pbs
+--version
+.SH DESCRIPTION
+This utility converts an existing NQS job script to work with PBS and NQS.
+The existing script is copied and PBS directives, using
+.I #PBS,
+are inserted prior to each NQS directive (
+.I #QSUB 
+or
+.I #@$
+), in the original script.
+.LP
+Certain NQS date specifications and options are not supported by PBS.
+A warning message will be displayed indicating the problem and the line of
+the script on which it occurred.
+.LP
+If any unrecognizable NQS directives are encountered, an error message
+is displayed. The new PBS script will be deleted if any errors occur.
+
+.B Specifying Time or Date
+.br
+PBS will interpret a time specification without a date in the following way:
+.IP - 3
+If the time specified has not yet been reached, the job will become eligible
+to run at that time today.
+.IP -
+If the specified time has already passed when the job is submitted, the job
+will become eligible to run at that time tomorrow.
+.LP
+This command does not support time zone identifiers.  All times are taken as local
+time.
+
+Converting NQS date specifications to the PBS form may result in a warning
+message and an incompletely converted date.  PBS does not support date
+specifications of "today", "tomorrow", or the name of the days of the week
+such as "Monday".  If any of these are encountered in a script, the PBS
+specification will contain only the time portion of the NQS specification,
+i.e. #PBS -a hhmm[.ss].   It is suggested that you specify the execution
+time on the qsub command line rather than in the script.
+.LP
+
+.SH OPTIONS
+.IP "--version" 10
+The 
+.B nqs2pbs
+command returns its PBS version information and exits.
+This option must be used alone.
+
+.SH OPERANDS
+.IP  "NQS script"
+Specifies the file name of the NQS script to convert. This file is not
+changed.
+.IP "PBS script"
+If specified, this is the name of the new PBS script. If not specified,
+the new file name is
+.I nqs_script.new .
+.LP
+
+.SH SEE ALSO
+qsub(1B)

+ 249 - 0
doc/man1/pbs_hook_attributes.7B

@@ -0,0 +1,249 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_hook_attributes 7B "25 January 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_hook_attributes 
+\- attributes of PBS hooks
+
+.SH DESCRIPTION
+.LP
+Hook attributes can be set, unset, and viewed using the 
+.B qmgr 
+command.
+See the 
+.B qmgr(1B) 
+man page.
+
+An unset hook attribute takes the default value for that attribute.
+
+Under UNIX/Linux, root privilege is required in order to operate on
+hooks.  Under Windows, this must be done from the installation
+account.  For domained environments, the installation account must be
+a lo cal account that is a member of the local Administrators group on
+the local computer.  For standalone environments, the ins tallation
+account must be a local account that is a member of the local
+Administrators group on the local computer.
+
+.IP "alarm=<n>"
+Specifies the number of seconds to allow a hook to run before
+the hook times out.
+.br
+Set by administrator.
+.br
+Valid values: >0
+.br
+Format: Integer
+.br
+Default value: 30
+
+.IP "debug"
+Specifies whether or not the hook produces debugging files under
+PBS_HOME/server_priv/hooks/tmp or PBS_HOME/mom_priv/hooks/tmp.  Files
+are named hook_<hook event>_<hook name>_<unique ID>.in, .data, and .out.
+When this is set to 
+.I true, 
+the hook leaves debugging files.
+.br
+Set by administrator.
+.br
+Format: Boolean
+.br
+Default value: False
+
+.IP "enabled"
+Determines whether or not a hook is run when its triggering event occurs.
+If a hook's 
+.I enabled
+attribute is 
+.I True, 
+the hook is run.
+.br
+Set by administrator.
+.br
+Format: Boolean
+.br
+Default: True
+
+.IP "event"
+List of events that trigger the hook.  Can be operated on with 
+the "=", "+=", and "-=" operators.  The 
+.I provision
+event cannot be combined with any other events.
+.br
+Valid events: 
+.RS 11
+.nf
+"queuejob"
+"modifyjob" 
+"movejob" 
+"resvsub" 
+"runjob"
+"periodic"
+"provision"
+"execjob_begin"
+"execjob_end"
+execjob_prologue"
+"execjob_epilogue" 
+"execjob_preterm" 
+"execjob_launch" 
+"execjob_attach"
+"exechost_startup" 
+"exechost_periodic"
+"" (meaning no event)
+.fi
+.RE
+.IP
+.br
+Set by administrator.
+.br
+Format: string array 
+.br
+Default value: "" (meaning none, i.e. the hook is not triggered)
+
+.IP "fail_action"
+Specifies the action to be taken when hook fails due to alarm call or
+unhandled exception, or to an internal error such as not enough disk
+space or memory.  Can also specify a subsequent action to be taken
+when hook runs successfully.  Value can be either "none" or one or more of 
+"offline_vnodes", "clear_vnodes_upon_recovery", and "scheduler_restart_cycle". 
+If this attribute is set to multiple values, scheduler restart happens last.
+See the Hooks chapter in the PBS Professional Administrator's Guide.
+.br
+.I offline_vnodes
+.RS 11
+After unsuccessful hook execution, offlines the vnodes managed by the MoM
+executing the hook.  Only available for execjob_prologue, exechost_startup
+and execjob_begin hooks.
+.RE
+.IP
+.I clear_vnodes_upon_recovery
+.RS 11
+After successful hook execution, clears vnodes previously offlined via
+offline_vnodes fail action.  Only available for exechost_startup hooks.
+.RE
+.IP
+.I scheduler_restart_cycle
+.RS 11
+After unsuccessful hook execution, restarts scheduling cycle.  Only 
+available for execjob_begin and execjob_prologue hooks.
+.RE
+.IP
+.br
+Set by administrator.
+.br
+Format: string_array
+.br
+Default value: "none"
+
+.IP "freq"
+Number of seconds between periodic or exechost_periodic triggers.
+.br
+Set by administrator.
+.br 
+Format: integer
+.br
+Default: 120 seconds
+
+.IP "order"
+Indicates relative order of hook execution, for hooks sharing a trigger.
+Hooks with lower 
+.I order
+values execute before those with higher values.
+Does not apply to periodic or exechost_periodic hooks.
+.br
+Set by administrator.
+.br
+Format: Integer
+.br
+Default value: 1
+
+.IP "Type"
+The type of the hook.  Cannot be set for a built-in hook.
+.br
+Valid values: "pbs", "site"
+.br
+.I pbs
+.RS 11
+Hook is built in.
+.RE
+.IP
+.I site
+.RS 11
+Hook is custom (site-defined).
+.RE
+.IP
+.br
+Set by administrator.
+.br
+Format: String
+.br
+Default value: "site"
+
+.IP "user"
+Specifies who executes the hook.  
+.br
+Valid values: "pbsadmin", "pbsuser"
+.br
+.I "pbsadmin"
+.RS 11
+The hook executes as root.  
+.RE
+.IP
+.I "pbsuser"
+.RS 11
+The hook executes as the triggering job's owner.
+.RE
+.IP
+.br
+Set by administrator.
+.br
+Format: String
+.br
+Default value: "pbsadmin"
+
+.SH SEE ALSO
+The
+.I PBS Professional Hooks Guide,
+the
+.I PBS Professional Administrator's Guide,
+the
+.I PBS Professional Programmer's Guide,
+.br
+qmgr(1B),
+pbs_module(7B), 
+pbs_stathook(3B)
+
+

文件差异内容过多而无法显示
+ 1937 - 0
doc/man1/pbs_job_attributes.7B


+ 914 - 0
doc/man1/pbs_module.7B

@@ -0,0 +1,914 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_module 7B "20 April 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_module
+\- Python interface to PBS and PBS hook environment
+
+
+.SH DESCRIPTION
+ 
+The 
+.I pbs module 
+provides an interface to PBS and the hook environment.
+The interface is made up of Python objects, which have attributes and
+methods.  You can operate on these objects using Python code.
+For a description of each object, see the 
+.I PBS Professional Administrator's Guide.
+
+.SH PBS MODULE OBJECTS
+
+.IP  pbs.acl
+Represents a PBS ACL type. 
+.IP  pbs.args
+Represents a space-separated list of PBS arguments to commands like qsub, qdel.
+.IP  pbs.argv[]
+Represents a list of argument strings to be passed to the program
+.IP  pbs.BadAttributeValueError
+Raised when setting the attribute value of a pbs.* object to an invalid value.
+.IP  pbs.BadAttributeValueTypeError
+Raised when setting the attribute value of a pbs.* object to an invalid value type.
+.IP  pbs.BadResourceValueError
+Raised when setting the resource value of a pbs.* object to an invalid value.
+.IP  pbs.BadResourceValueTypeError
+Raised when setting the resource value of a pbs.* object to an invalid value type.
+.IP  pbs.checkpoint
+Represents a job's 
+.I Checkpoint 
+attribute.
+.IP  pbs.depend
+Represents a job's 
+.I depend
+attribute.
+.IP  pbs.duration
+Represents a time interval.
+.IP  pbs.email_list
+Represents the set of users to whom mail may be sent.
+.IP  pbs.env[]
+Dictionary of environment variables.
+.IP  pbs.event
+Represents a PBS event.
+.IP  pbs.EventIncompatibleError
+Raised when referencing a non-existent attribute in pbs.event().
+.IP  pbs.EXECHOST_PERIODIC
+The 
+.I exechost_periodic 
+event type.
+.IP  pbs.EXECHOST_STARTUP
+The 
+.I exechost_startup
+event type.
+.IP  pbs.EXECJOB_ATTACH
+The 
+.I execjob_attach
+event type.
+.IP  pbs.EXECJOB_BEGIN
+The 
+.I execjob_begin
+event type.
+.IP  pbs.EXECJOB_END
+The 
+.I execjob_end
+event type.
+.IP  pbs.EXECJOB_EPILOGUE
+The 
+.I execjob_epilogue
+event type.
+.IP  pbs.EXECJOB_LAUNCH
+The 
+.I execjob_launch
+event type.
+.IP  pbs.EXECJOB_PRETERM
+The 
+.I execjob_preterm
+event type.
+.IP  pbs.EXECJOB_PROLOGUE
+The 
+.I execjob_prologue
+event type.
+.IP  pbs.exec_host
+Represents a job's 
+.I exec_host 
+attribute.
+.IP  pbs.exec_vnode
+Represents a job's 
+.I exec_vnode 
+attribute.
+.IP  pbs.group_list
+Represents a list of group names.
+.IP  pbs.hold_types
+Represents a job's 
+.I Hold_Types 
+attribute.
+.IP  pbs.hook_config_filename
+Contains path to hook's configuration file.
+.IP  pbs.job
+Represents a PBS job.
+.IP  pbs.job_list[]
+Represents a list of pbs.job objects.
+.IP  pbs.job_sort_formula
+Represents the server's
+.I job_sort_formula 
+attribute.
+.IP  pbs.JOB_STATE_BEGUN
+Represents the job array state of having started.
+.IP  pbs.JOB_STATE_EXITING
+Represents the job state of exiting.
+.IP  pbs.JOB_STATE_EXPIRED
+Represents the subjob state of expiring.
+.IP  pbs.JOB_STATE_FINISHED
+Represents the job state of finished.
+.IP  pbs.JOB_STATE_HELD
+Represents the job state of held.
+.IP  pbs.JOB_STATE_MOVED
+Represents the job state of moved.
+.IP  pbs.JOB_STATE_QUEUED
+Represents the job state of queued.
+.IP  pbs.JOB_STATE_RUNNING
+Represents the job state of running.
+.IP  pbs.JOB_STATE_SUSPEND
+Represents the job state of suspended.
+.IP  pbs.JOB_STATE_SUSPEND_USERACTIVE
+Represents the job state of suspended due to user activity.
+.IP  pbs.JOB_STATE_TRANSIT
+Represents the job state of transiting.
+.IP  pbs.JOB_STATE_WAITING
+Represents the job state of waiting.
+.IP  pbs.join_path
+Represents a job's 
+.I Join_Path
+attribute.
+.IP  pbs.keep_files
+Represents a job's 
+.I Keep_Files 
+attribute.
+.IP pbs.license_count
+Represents a set of licensing-related counters.
+.IP  pbs.LOG_DEBUG
+Log level 004.
+.IP  pbs.LOG_ERROR
+Log level 004.
+.IP  pbs.LOG_WARNING
+Log level 004.
+.IP  pbs.mail_points
+Represents a job's 
+.I Mail_Points 
+attribute.
+.IP  pbs.MODIFYJOB
+The 
+.I modifyjob 
+event type.
+.IP  pbs.MOVEJOB
+The 
+.I movejob 
+event type.
+
+.IP pbs.ND_BUSY
+Represents 
+.I busy 
+vnode state.
+
+.IP pbs.ND_DEFAULT_EXCL
+Represents 
+.I default_excl sharing 
+vnode attribute value
+
+.IP pbs.ND_DEFAULT_SHARED
+Represents 
+.I default_shared sharing 
+vnode attribute value.
+
+.IP pbs.ND_DOWN
+Represents 
+.I down 
+vnode state
+
+.IP pbs.ND_FORCE_EXCL
+Represents 
+.I force_excl sharing 
+vnode attribute value.
+
+.IP pbs.ND_FREE
+Represents 
+.I free 
+vnode state. 
+
+.IP pbs.ND_GLOBUS
+PBS no longer supports Globus.  The Globus functionality has been 
+.B removed 
+from PBS.
+
+Represents
+.I globus 
+vnode 
+.I ntype.
+
+.IP pbs.ND_IGNORE_EXCL
+Represents 
+.I ignore_excl sharing 
+vnode attribute value.
+
+.IP pbs.ND_JOBBUSY
+Represents 
+.I job-busy 
+vnode state.
+
+.IP pbs.ND_JOB_EXCLUSIVE
+Represents 
+.I job-exclusive 
+vnode state.
+
+.IP pbs.ND_OFFLINE
+Represents 
+.I offline 
+vnode state.  
+
+.IP pbs.ND_PBS
+Represents 
+.I pbs 
+vnode 
+.I ntype.
+
+.IP pbs.ND_PROV
+Represents 
+.I provisioning 
+vnode state.
+
+.IP pbs.ND_RESV_EXCLUSIVE
+Represents
+.I resv-exclusive
+vnode state.
+
+.IP pbs.ND_STALE
+Represents 
+.I stale 
+vnode state.
+
+.IP pbs.ND_STATE_UNKNOWN
+Represents 
+.I state-unknown, down 
+vnode state.
+
+.IP pbs.ND_UNRESOLVABLE
+Represents the 
+.I unresolvable
+vnode state.
+
+.IP pbs.ND_WAIT_PROV
+Represents 
+.I wait-provisioning 
+vnode state.
+
+.IP  pbs.node_group_key
+Represents the server or queue 
+.I node_group_key
+attribute.
+.IP  pbs.path_list
+Represents a list of pathnames.
+.IP  pbs.pbs_conf[]
+Dictionary of entries in pbs.conf.
+.IP  pbs.pid
+Represents the process ID of a process belonging to a job.
+
+.IP  pbs.place
+Represents the 
+.I place
+job submission specification.
+.IP pbs.progname
+Path of job shell or executable.
+.IP  pbs.QTYPE_EXECUTION
+The 
+.I execution
+queue type.
+.IP  pbs.QTYPE_ROUTE
+The 
+.I route
+queue type.
+.IP  pbs.queue
+Represents a PBS queue.
+.IP  pbs.QUEUEJOB
+The 
+.I queuejob 
+event type.
+.IP  pbs.range
+Represents a range of numbers referring to array indices.
+.IP  pbs.resv
+Represents a PBS reservation.
+.IP  pbs.RESVSUB
+The 
+.I resvsub
+event type.
+.IP  pbs.RESV_STATE_BEING_DELETED
+Represents the reservation state RESV_BEING_DELETED.
+.IP  pbs.RESV_STATE_CONFIRMED
+Represents the reservation state RESV_CONFIRMED.
+.IP  pbs.RESV_STATE_DEGRADED
+Represents the reservation state RESV_DEGRADED.
+.IP  pbs.RESV_STATE_DELETED
+Represents the reservation state RESV_DELETED.
+.IP  pbs.RESV_STATE_DELETING_JOBS
+Represents the reservation state RESV_DELETING_JOBS.
+.IP  pbs.RESV_STATE_FINISHED
+Represents the reservation state RESV_FINISHED.
+.IP  pbs.RESV_STATE_NONE
+Represents the reservation state RESV_NONE.
+.IP  pbs.RESV_STATE_RUNNING
+Represents the reservation state RESV_RUNNING.
+.IP  pbs.RESV_STATE_TIME_TO_RUN
+Represents the reservation state RESV_TIME_TO_RUN.
+.IP  pbs.RESV_STATE_UNCONFIRMED
+Represents the reservation state RESV_UNCONFIRMED.
+.IP  pbs.RESV_STATE_WAIT
+Represents the reservation state RESV_WAIT.
+.IP  pbs.route_destinations
+Represents a queue's 
+.I route_destinations
+attribute.
+.IP  pbs.RUNJOB
+The 
+.I runjob
+event type.
+.IP  pbs.select
+Represents the 
+.I select
+job submission specification.
+.IP  pbs.server
+Represents the local PBS server.
+.IP  pbs.size
+Represents a PBS 
+.I size
+type.
+.IP  pbs.software
+Represents a site-dependent software specification resource.
+.IP  pbs.staging_list
+Represents a list of file stagein or stageout parameters.
+.IP  pbs.state_count
+Represents a set of job-related state counters.
+.IP  pbs.SV_STATE_ACTIVE
+Represents the server state "Scheduling".
+.IP  pbs.SV_STATE_HOT
+Represents the server state "Hot_Start".
+.IP  pbs.SV_STATE_IDLE
+Represents the server state "Idle".
+.IP  pbs.SV_STATE_SHUTDEL
+Represents the server state "Terminating, Delayed".
+.IP  pbs.SV_STATE_SHUTIMM
+Represents the server state "Terminating".
+.IP  pbs.SV_STATE_SHUTSIG
+Represents the server state "Terminating", when a signal has been caught.
+.IP  pbs.UnsetAttributeNameError
+Raised when referencing a non-existent name of a pbs.* object.
+.IP  pbs.UnsetResourceNameError
+Raised when referencing a non-existent name of a pbs.* object.
+.IP  pbs.user_list
+Represents a list of user names.
+.IP  pbs.vchunk
+Represents a resource chunk assigned to a job.
+.IP  pbs.version
+Represents PBS version information.
+.IP  pbs.vnode
+Represents a PBS vnode.
+.IP  pbs.vnode_list[]
+Represents a list of PBS vnodes.
+.IP  SystemExit
+Raised when accepting or rejecting an action.
+.LP
+
+.SH PBS MODULE GLOBAL METHODS
+.IP pbs.acl("[+|-]<entity>][,...]")
+Creates an object representing a PBS ACL, using the given string parameter.
+Instantiation of these objects requires a formatted input string.
+
+
+.IP pbs.args("<args>")
+where 
+.I <args> 
+are space-separated arguments to a command such as 
+.B qsub 
+or 
+.B qdel.
+Creates an object representing the arguments to the command.
+Example:
+.RS 10
+pbs.args("-Wsuppress_email=N -r y")
+.RE
+.IP
+Instantiation of these objects requires a formatted input string.
+
+.IP pbs.checkpoint("<checkpoint_string>")
+where 
+.I <checkpoint_string> 
+must be one of "n", "s", "c", "c=mmm", "w", or "w=mmm"
+Creates an object representing the job's
+.I Checkpoint 
+attribute, using the given string.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.depend("<depend_string>")
+.I <depend_string> 
+must be of format "<type>:<jobid>[,<jobid>...]", or "on:<count>", and
+where 
+.I <type> 
+is one of "after", "afterok", "afterany", "before", "beforeok",
+and "beforenotok".
+Creates a PBS dependency specification object representing the job's
+.I depend 
+attribute, using the given 
+.I <depend_string>.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.duration("[[hours:]minutes:]seconds[.milliseconds]")
+Creates a time specification duration instance, returning the
+equivalent number of seconds from the given time string. Represents an
+interval or elapsed time in number of seconds. Duration objects can be
+specified using either a time or an integer. See the
+"pbs.duration(<integer>)" creation method.
+.IP pbs.duration(<integer>)
+Creates an integer duration instance using the specified number of
+seconds.  A 
+.I pbs.duration 
+instance can be operated on by any of the
+Python 
+.I int 
+functions.  When performing arithmetic operations on a
+.I pbs.duration 
+type, ensure the resulting value is a 
+.I pbs.duration()
+type, before assigning to a job member that expects such a type.
+.IP pbs.email_list("<email_address1>[,<email_address2>...]")
+Creates an object representing a mail list.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.exec_host("host/N[*C][+...]")
+Create an object representing the 
+.I exec_host 
+job attribute, using the
+given host and resource specification.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.exec_vnode("<vchunk>[+<vchunk>...]")
+.I <vchunk> 
+is (<vnodename:ncpus=N:mem=M>)
+Creates an object representing the 
+.I exec_vnode 
+job attribute, using the
+given vnode and resource specification. When the 
+.B qrun -H 
+command is used, or when the scheduler runs a job, the 
+.I pbs.job.exec_vnode 
+object contains the vnode specification for the job.  Instantiation of these
+objects requires a formatted input string.
+.br
+Example:
+.br
+pbs.exec_vnode("(vnodeA:ncpus=N:mem=X)+(nodeB:ncpus=P:mem=Y+nodeC:mem=Z)")
+.br
+This object is managed and accessed via the 
+.I str() 
+or 
+.I repr() 
+functions. 
+.br
+Example:
+.br
+Python> ev = pbs.server().job("10").exec_vnode
+.br
+Python> str(ev)
+.br
+"(vnodeA:ncpus=2:mem=200m)+(vnodeB:ncpus=5:mem=1g)"
+
+.IP pbs.get_hook_config_file()
+Returns the path to the hook's configuration file, or None if there is
+no configuration file.  For example:
+.RS 10
+configfilepath = pbs.get_hook_config_file()
+.RE
+
+.IP pbs.get_local_nodename()
+This returns a Python str whose value is the name of the local natural vnode.
+If you want to refer to the vnode object representing the current
+host, you can pass this vnode name as the key to
+.I pbs.event().vnode_list[].  
+For example:
+.RS 10
+Vn = pbs.event().vnode_list[pbs.get_local_nodename()]
+.RE
+
+.IP pbs.get_pbs_conf()
+This method returns a dictionary of values which represent entries in
+the pbs.conf file.  The method reads the file on the host where a hook
+runs, so pre-execution event hooks get the entries on the server host,
+and execution event hooks get the entries on the execution host where
+the hook runs.  The method reads /etc/pbs.conf on the host where
+pbs_python runs.
+Example:
+.RS 10
+pbs_conf = pbs.get_pbs_conf()
+.br
+pbs.logmsg(pbs.LOG_DEBUG, "pbs home is " % (pbs_conf['PBS_HOME]))
+.RE
+.IP
+If you HUP pbs_mom (Linux/UNIX), pbs.get_pbs_conf returns the reloaded
+contents of the pbs.conf file.
+
+.IP pbs.group_list("<group_name>[@<host>][,<group_name>[@<host>]...]")
+Creates an object representing a PBS group list.
+To use a group list object:
+.br
+pbs.job.group_list = pbs.group_list(....)
+.br
+Instantiation of these objects requires a formatted input string.
+.IP pbs.hold_types("<hold_type_str>")
+where 
+.I <hold_type_str> 
+is one of "u", "o", "s", or "n".
+Creates an object representing the 
+.I Hold_Types 
+job attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.job_sort_formula("<formula_string>")
+where 
+.I <formula_string> 
+is a string containing a math formula. 
+Creates an object representing the 
+.I job_sort_formula 
+server attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.join_path({"oe"|"eo"|"n"})
+Creates an object representing the 
+.I Join_Path 
+job attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.keep_files("<keep_files_str>")
+where 
+.I <keep_files_str> 
+is one of "o", "e", "oe", "eo".
+Creates an object representing the 
+.I Keep_Files 
+job attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.license_count("Avail_Global:<W>Avail_Local:<X>Used:<Y>High_Use:<Z>")
+Instantiates an object representing a 
+.I license_count 
+attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.logjobmsg(job_ID,message)
+where 
+.I job_ID 
+must be an existing or previously existing job ID and where 
+.I message 
+is an arbitrary string.  This puts a custom string in the PBS Server
+log. The 
+.B tracejob 
+command can be used to print out the job-related
+messages logged by a hook script.  Messages are logged at log event
+class 
+.I pbs.LOG_DEBUG.
+.IP pbs.logmsg(log_event_class,message)
+where 
+.I message 
+is an arbitrary string, and where 
+.I log_event_class 
+can be one of the message log event class constants:
+.br
+pbs.LOG_WARNING
+.br
+pbs.LOG_ERROR
+.br
+pbs.LOG_DEBUG
+.br
+This puts a custom string in the daemon log.
+.IP pbs.mail_points("<mail_points_string>")
+where 
+.I <mail_points_string> 
+is "a", "b", and/or "e", or "n".
+Creates an object representing a 
+.I Mail_Points 
+attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.node_group_key("<resource>")
+Creates an object representing the resource to be used for node
+grouping, using the specified resource.
+.IP pbs.path_list("<path>[@<host>][,<path>@<host>...]")
+Creates an object representing a PBS pathname list.
+To use a path list object:
+.br
+pbs.job.Shell_Path_List = pbs.path_list(....)
+.br
+Instantiation of these objects requires a formatted input string.
+
+.IP pbs.env()
+Creates an empty environment variable list.  For example, to create
+an empty environment variable list:
+.RS 10
+pbs.event().env = pbs.pbs_env()
+.RE
+
+.IP pbs.place("[arrangement]:[sharing]:[group]")
+.I arrangement 
+can be "pack", "scatter", "free", "vscatter"
+.br
+.I sharing 
+can be "shared", "excl", "exclhost"
+.br
+.I group 
+can be of the form "group=<resource>"
+.br
+.I [arrangement], [sharing], 
+and 
+.I [group] 
+can be given in any order or combination.
+.br
+Creates a place object representing the job's place specification.
+Instantiation of these objects requires a formatted input string.
+.br
+Example:
+.br
+pl = pbs.place("pack:excl")
+.br
+s = repr(pl) (or s = `pl`)
+.br
+letter = pl[0] (assigns 'p' to letter)
+.br
+s = s + ":group=host" (append to string)
+br
+pl = pbs.place(s) (update original pl)
+.IP pbs.range("<start>-<stop>:<step>")
+Creates a PBS object representing a range of values.
+.br
+Example:
+.br
+pbs.range("1-30:3")
+.br
+Instantiation of these objects requires a formatted input string.
+
+.IP pbs.reboot([<command>])
+This stops hook execution, so that remaining lines in the hook script
+are not executed, and starts the tasks that would normally begin after
+the hook is finished, such as flagging the current host to be
+rebooted.  The MoM logs show the following:
+.RS 10
+<hook name> requested for host to be rebooted
+.RE
+.IP
+We recommend that before calling pbs.reboot(), you set any vnodes
+managed by this MoM offline, and requeue the current job, if this hook
+is not an exechost_periodic hook.  For example:
+.RS 10
+for  v in pbs.event().vnode_list.keys():
+.br
+\ \ \ pbs.event().vnode_list[v].state = pbs.ND_OFFLINE
+.br
+\ \ \ pbs.event().vnode_list[v].comment = "MoM host rebooting"
+.br
+pbs.event().job.rerun()
+.br
+pbs.reboot()
+.RE
+.IP
+The effect of the call to pbs.reboot() is not instantaneous. The
+reboot happens after the hook executes, and after any of the other
+actions such as pbs.event().job.rerun(), pbs.event().delete(), and
+pbs.event().vnode_list[] take effect.
+
+A hook with its user attribute set to pbsuser cannot successfully
+invoke pbs.reboot(), even if the owner is a PBS Manager or Operator.
+If this is attempted, the host is not rebooted, and the following
+message appears at log event class PBSEVENT_DEBUG2 in the MoM logs:
+.RS 10
+<hook_name>; Not allowed to issue reboot if run as user.
+.RE
+.IP
+The <command> is an optional argument.  It is a Python str which is
+executed instead of the reboot command that is the default for the
+system.  For example:
+.RS 10
+pbs.reboot("/usr/local/bin/my_reboot -s 10 -c 'going down in 10'")
+.RE
+.IP
+The specified <command> is executed in a shell on Linux/UNIX or via cmd on Windows.
+
+
+.IP pbs.route_destinations("<queue_spec>[,<queue_spec>,...]")
+where 
+.I <queue_spec> 
+is queue_name[@server_host[:port]]
+.br
+Creates an object that represents a 
+.I route_destinations 
+routing queue attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.select("[N:]res=val[:res=val][+[N:]res=val[:res=val]...]")
+Creates a 
+.I select 
+object representing the job's select specification.
+Instantiation of these objects requires a formatted input string.
+Example:
+.br
+sel = pbs.select("2:ncpus=1:mem=5gb+3:ncpus=2:mem=5gb")
+.br
+s = repr(sel) (or s = `sel`)
+.br
+letter = s[3] (assigns 'c' to letter)
+.br
+s = s + "+5:scratch=10gb" (append to string)
+.br
+sel = pbs.select(s) (reset the value of sel)
+.br
+.IP pbs.size(<integer>)
+Creates a PBS 
+.I size 
+object using the given integer value, storing the
+value as the number of bytes. Size objects can be specified using
+either an integer or a string. See the "pbs.size("<integer><suffix>")"
+creation method.
+.IP pbs.size("<integer><suffix>")
+Creates a PBS 
+.I size 
+object out of the given string specification. 
+See the 
+.I PBS Professional Reference Guide 
+for suffix information.
+The size of a word
+is the word size on the execution host. 
+.I Size 
+objects can be specified
+using either an integer or a string.  To operate on 
+.I pbs.size
+instances, use the "+" and "-" operators.  To compare 
+.I pbs.size
+instances, use the "==", "!=", ">", "<", ">=", and "<=" operators.
+Example: the sizes are normalized to the smaller of the 2 suffixes. In
+this case, "10gb" becomes "10240mb" and is added to "10mb":
+.br
+sz = pbs.size("10gb")
+.br
+sz = sz + 10mb
+.br
+10250mb
+.br
+Example: the following returns 
+.I True 
+because 
+.I sz 
+is greater than 100 bytes:
+.br
+if sz > 100:
+.br
+\ \ \ \ gt100 = True
+.br
+
+.IP pbs.software("<software_info_string>")
+Creates an object representing a site-dependent software resource.
+Instantiation of these objects requires a formatted input string.
+
+.IP pbs.staging_list("<filespec>[,<filespec>,...]")
+where 
+.I <filespec> 
+is <execution_path>@<storage_host>:<storage_path>
+Creates an object representing a job file staging parameters list.
+To use a staging list object:
+.br
+pbs.job.stagein = pbs.staging_list(....)
+.br
+Instantiation of these objects requires a formatted input string.
+.IP pbs.state_count("Transit:<U>Queued:<V>Held:<W>Running:<X>Exiting:<Y>Begun:<Z>)
+Instantiates an object representing a 
+.I state_count 
+attribute.
+Instantiation of these objects requires a formatted input string.
+.IP pbs.user_list("<user>[@<host>][,<user>@<host>...]")
+Creates an object representing a PBS user list.
+To use a user list object:
+.br
+pbs.job.User_List = pbs.user_list(....)
+.br
+Instantiation of these objects requires a formatted input string.
+
+.IP pbs.version("<pbs_version_string>")
+Creates an object representing the PBS version string.
+Instantiation of these objects requires a formatted input string.
+
+
+
+.SH ATTRIBUTES AND RESOURCES
+.br
+Hooks can read Server, Queue, or reservation resources. 
+Hooks can read vnode or job attributes and resources.  Hooks can modify
+.IP
+The resources requested by a job
+.br
+The resources used by a job
+.br
+The attributes of a job
+.br
+The resource arguments to pbs_rsub
+.br
+Vnode attributes and resources
+.br
+The shell or program to be executed in a job
+.br 
+The arguments to the shell or program to be executed in a job
+.br
+The environment of the job
+.LP
+
+Custom and built-in PBS resources are represented in Python dictionaries,
+where the resource names are the dictionary keys.  Built-in resources are
+listed in pbs_resources(7B).  You reference a resource through a vnode,
+the Server, the event that triggered the hook, or the current job, for example:
+
+.IP
+pbs.server().resources_available["< resource name>"]
+.br
+pbs.event().job.Resource_List["< resource name>"]
+.br 
+pbs.event().vnode_list[<vnode name>].resources_available["< resource name >"]
+.LP
+
+The resource name must be in quotes.
+Example: Get the number of CPUs:
+
+.IP
+ncpus = Resource_List["ncpus"]
+.LP
+
+An instance R of a job resource can be set as follows:
+.IP
+R["<resource name>"] = <resource value>
+.LP
+
+For example:
+.IP
+pbs.event().job().Resource_List["mem"] = 8gb
+.LP
+
+.SH EXCEPTIONS
+
+.IP  pbs.BadAttributeValueError
+Raised when setting the attribute value of a pbs.* object to an invalid value.
+.IP  pbs.BadAttributeValueTypeError
+Raised when setting the attribute value of a pbs.* object to an invalid value type.
+.IP  pbs.BadResourceValueError
+Raised when setting the resource value of a pbs.* object to an invalid value.
+.IP  pbs.BadResourceValueTypeError
+Raised when setting the resource value of a pbs.* object to an invalid value type.
+.IP  pbs.EventIncompatibleError
+Raised when referencing a non-existent attribute in pbs.event().
+.IP  pbs.UnsetAttributeNameError
+Raised when referencing a non-existent name of an attribute.
+.IP  pbs.UnsetResourceNameError
+Raised when referencing a non-existent name of a resource.
+.IP  SystemExit
+Raised when accepting or rejecting an action.
+.LP
+
+If a hook encounters an unhandled exception:
+.IP
+PBS rejects the corresponding action, and an error message is printed 
+to stderr.
+.br
+A message is printed to the daemon log.
+.LP
+
+
+
+
+
+.SH SEE ALSO
+The
+.I PBS Professional Administrator's Guide,
+.br
+pbs_hook_attributes(7B), pbs_resources(7B),
+qmgr(1B)
+
+

+ 777 - 0
doc/man1/pbs_node_attributes.7B

@@ -0,0 +1,777 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_node_attributes 7B "23 April 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_node_attributes 
+\- attributes of PBS vnodes
+
+
+.SH DESCRIPTION
+Vnodes have the following attributes:
+
+.IP comment 8
+Information about this vnode.  This attribute may be set by the
+manager to any string to inform users of any information relating to
+the node. If this attribute is not explicitly set, the PBS server will
+use the attribute to pass information about the node status,
+specifically why the node is down. If the attribute is explicitly set
+by the manager, it will not be modified by the server.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default: No default
+
+.IP current_aoe 8
+The AOE currently instantiated on this vnode.  Cannot be set on 
+server's host.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default: 
+.I Unset
+
+.IP current_eoe 8
+Current value of eoe on this vnode.  We do not recommend setting this
+attribute manually.
+.br
+Readable by all; settable by Manager (not recommended).
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default:
+.I Unset
+
+.IP in_multivnode_host 8
+Specifies whether a vnode is part of a multi-vnoded host.  Used
+internally.  Do not set.
+.br
+Readable and settable by Manager (not recommended).
+.br
+Format:
+.I Integer 
+.br
+Python type:
+.I int
+.br
+Behavior:
+.RS
+.IP 1 3
+Part of a multi-vnode host
+.IP Unset 3
+Not part of a multi-vnode host
+.RE
+.IP
+Default: 
+.I Unset   
+
+.IP jobs 8
+List of jobs running on this vnode.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I String
+.br
+Syntax: 
+.I <processor number>/<job ID>, ... 
+.br
+Python type:
+.I int
+.br
+
+.IP license 8
+Indicates whether this vnode is socket-licensed.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I Character
+.br
+Python type: 
+.I str
+.br
+Valid values:
+.RS
+.IP l 3
+This vnode is socket licensed.
+.RE
+.IP 
+Default: 
+.I Unset
+
+.IP license_info 8
+Number of socket licenses assigned to this vnode.  
+.br
+Readable by all; set by PBS.             
+.br
+Format: 
+.I Integer
+.br
+Python type:
+.I int
+.br
+Default: 
+.I Unset
+
+.IP lictype 8
+No longer used.
+
+.IP maintenance_jobs 8
+List of jobs that were running on this vnode, but have been suspended
+via the
+.I admin-suspend 
+signal to qsig.
+.br
+Readable by Manager; set by PBS.
+.br
+Format:
+.I string_array                      
+.br
+Python type:
+.I str
+.br
+Default: No default 
+
+.IP max_group_run 8
+The maximum number of jobs owned by any users in a single group
+allowed to run on this vnode at one time.
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format: 
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Default: No default
+
+.IP max_running
+The maximum number of jobs allowed to run on this vnode
+at any given time.  
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format: 
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Default: No default
+
+.IP max_user_run 8
+The maximum number of jobs owned by a single user allowed to 
+run on this vnode at one time.  
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format: 
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Default: No default
+
+.IP Mom
+Hostname of host on which MoM daemon runs.  
+.br
+Readable by all.  Can be explicitly set by Manager only via 
+.B qmgr, 
+and only at vnode creation. The server can set this to the FQDN of the host 
+on which MoM runs, if the vnode name is the same as the hostname.
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default: Value of 
+.I vnode 
+resource (vnode name)
+
+.IP name 8
+The name of this vnode.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default: No default
+
+.IP no_multinode_jobs 8
+Controls whether jobs which request more than one chunk are allowed to execute
+on this vnode.  Used for cycle harvesting.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I Boolean
+.br
+Python type:
+.I bool
+.br
+Behavior: 
+.RS
+.IP True 3
+Jobs requesting more than one chunk are not allowed to execute on this vnode.
+.RE
+.IP
+Default: 
+.I False
+
+.IP ntype 8
+The type of this vnode.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Valid values:
+.RS
+.IP PBS 3
+Normal vnode; not Globus
+.br
+Python type: 
+.I pbs.ND_PBS
+.IP globus 3
+A Globus vnode (this functionality has been removed). Globus can still
+send jobs to PBS, but PBS no longer supports sending jobs to Globus.
+.br
+Python type: 
+.I pbs.ND_GLOBUS
+.RE
+.IP
+.br
+Default: 
+.I PBS
+
+.IP partition 8
+Name of partition to which this vnode is assigned.  A vnode can be
+assigned to at most one partition.
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format:
+.I String
+.br
+Python type:
+.I str
+.br
+Default: No default
+
+.IP pbs_version 8
+The version of PBS for this MoM.  
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I String
+.br
+Python type: 
+.I str
+.br
+Default: No default
+
+.IP pcpus 8
+.B Deprecated.  
+The number of physical CPUs on this vnode.  This is set to the number
+of CPUs available when MoM starts.  For a multiple-vnode MoM, only the
+natural vnode has 
+.I pcpus.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Default: 
+.I Number of CPUs on startup
+
+.IP pnames
+The list of resources being used for placement sets.  
+Not used for scheduling; advisory only.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Syntax: 
+.I Comma-separated list of resource names
+.br
+Python type: 
+.I str
+.br
+Default: No default
+
+.IP Port 8
+Port number on which MoM daemon listens.  
+.br
+Can be explicitly set only via
+.B qmgr, 
+and only at vnode creation.  
+Readable and settable by Operator and Manager.
+.br
+Format: 
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Default: 
+.I 15002
+
+.IP power_provisioning 8
+Enables use of power profiles by this vnode.
+.br
+Readable by all; settable by Manager.
+.br
+Format:
+.I Boolean
+.br
+Python type:
+.I bool
+.br
+Behavior:
+.RS
+.IP True 3
+Power provisioning is enabled at this vnode.
+.IP False 3
+Power provisioning is disabled at this vnode.
+.RE
+.IP
+Default: 
+.I False
+
+.IP Priority 8
+The priority of this vnode compared with other vnodes.
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format:
+.I Integer
+.br
+Python type: 
+.I int
+.br
+Valid values: 
+.I -1024 to +1023
+.br
+Default: No default
+
+.IP provision_enable
+Controls whether this vnode can be provisioned.  
+Cannot be set on server's host.  
+.br
+Format: 
+.I Boolean
+.br
+Python type: 
+.I bool
+.br
+Behavior:
+.RS
+.IP True 3
+This vnode may be provisioned.  
+.IP False 3
+This vnode may not be provisioned.  
+.RE
+.IP
+Default: 
+.I False
+
+.IP queue 8
+The queue with which this vnode is associated.  Each vnode can be
+associated with at most 1 queue.  Queues can be associated with
+multiple vnodes.  Any jobs in a queue that has associated vnodes can
+run only on those vnodes.  If a vnode has an associated queue, only
+jobs in that queue can run on that vnode.  
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I String
+.br
+Python type:
+.I pbs.queue
+.br
+Behavior:
+.RS
+.IP "<name of queue>" 3
+Only jobs in specified queue may run on this vnode.  
+.IP Unset 3
+Any job in any queue that does not have associated vnodes can run on this vnode.
+.RE
+.IP 
+Default: No default
+
+.IP resources_assigned 8
+The total amount of each resource allocated to jobs and started
+reservations running on this vnode.
+.br
+Readable by all; set by PBS.
+.br
+Format: String
+.br
+Syntax: 
+.RS 11
+.I resources_assigned.<resource name>=<value>[,resources_assigned.<resource name>=<value>
+.RE
+.IP
+Python type: 
+.I pbs.pbs_resource
+.br
+Syntax: 
+.RS 11
+resources_assigned['<resource name>'] = < val> 
+.br
+where 
+.I resource name 
+is any built-in or custom resource
+.RE
+.IP
+Default: No default
+
+.IP resources_available 8
+The list of resource and amounts available on this vnode.  If not
+explicitly set, the amount shown is that reported by the pbs_mom
+running on this vnode.  If a resource value is explicitly set, that
+value is retained across restarts.
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format:
+.I String
+.br
+Syntax:
+.RS 11
+.I resources_available.<resource name>=<value>, 
+.I resources_available.<resource name> = <value>, ...
+.RE
+.IP 
+Python type:
+.I pbs.pbs_resource
+.br
+Syntax:
+.RS 11
+resources_available['<resource name>'] = < val> 
+.br
+where 
+.I resource name 
+is any built-in or custom resource
+.RE
+.IP 
+Default: No default
+
+.IP resv 8 
+List of advance and standing reservations pending on this vnode.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I String
+.br
+Syntax: 
+.RS 11
+.I <reservation ID>[, <reservation ID>, ...]
+.br
+(Comma-separated list of reservation IDs)
+.RE
+.IP
+Python type:
+.I str
+.br
+Example: resv = R142.examplemachine, R143.examplemachine
+.br
+Default: No default
+
+.IP resv_enable 8
+Controls whether the vnode can be used for advance and standing
+reservations.  Reservations are incompatible with cycle harvesting.
+.br
+Readable by all; settable by Manger.
+.br
+Format: 
+.I Boolean
+.br
+Python type: 
+.I bool
+.br
+Behavior: 
+.RS 11
+When set to 
+.I True, 
+this vnode can be used for reservations. Existing reservations are
+honored when this attribute is changed from 
+.I True 
+to 
+.I False.
+.RE
+.IP
+Default: 
+.I True
+
+.IP sharing 8
+Specifies whether more than one job at a time can use the resources of
+the vnode or the vnode's host.  Either (1) the vnode or host is
+allocated exclusively to one job, or (2) the vnode's or host's unused
+resources are available to other jobs.  
+.br
+Can be set using 
+.I pbs_mom -s insert
+only.
+.br
+Readable by all; settable by Operator and Manager.
+.br
+Format: 
+.I String
+.br
+Python type:
+.I int 
+.br
+Valid values: 
+.RS
+.IP default_shared 3
+Defaults to 
+.I shared
+.br
+Python type:
+.I pbs.ND_DEFAULT_SHARED
+.IP default_excl 3
+Defaults to 
+.I exclusive
+.br
+Python type:
+.I pbs.ND_DEFAULT_EXCL
+.IP default_exclhost 3
+Entire host is assigned to the job unless the job's sharing request
+specifies otherwise
+.br
+Python type:
+.I pbs.ND_DEFAULT_EXCLHOST
+.IP ignore_excl 3
+Overrides any job 
+.I place=excl
+setting
+.br
+Python type:
+.I pbs.ND_IGNORE_EXCL
+.IP force_excl 3
+Overrides any job
+.I place=shared
+setting
+.br
+Python type:
+.I pbs.ND_FORCE_EXCL
+.IP force_exclhost 3
+The entire host is assigned to the job, regardless of the job's sharing request
+.br
+Python type:
+.I pbs.ND_FORCE_EXCLHOST
+.IP Unset 3
+Defaults to 
+.I shared
+.RE
+.IP
+Behavior of a vnode or host is determined by a combination of the 
+.I sharing
+attribute and a job's placement directive, defined as follows:
+.nf
+                 | Vnode Behavior      | Host Behavior
+                 | when place=         | when place=
+                 |                     |   
+sharing value    | unset  shared excl  |exclhost !=exclhost
+----------------------------------------------------------------
+not set          | shared shared excl  | excl   depends on place
+default_shared   | shared shared excl  | excl   depends on place
+default_excl     | excl   shared excl  | excl   depends on place
+default_exclhost | excl   shared excl  | excl   depends on place
+ignore_excl      | shared shared shared| shared not exclusive
+force_excl       | excl   excl   excl  | excl   not exclusive
+force_exclhost   | excl   excl   excl  | excl   excl
+.fi
+
+Example: <vnode name>: sharing=force_excl
+.br
+Default value: 
+.I default_shared
+
+.IP state 8
+Shows or sets the state of the vnode.  
+.br
+Readable by all.  All states are set by PBS; Operator and Manager 
+can set 
+.I state
+to 
+.I offline.
+.br
+Format: 
+.I String 
+.br
+Syntax: 
+.I <state>[, <state>, ...]
+.br
+(Comma-separated list of one or more states)
+.br
+Python type: 
+.I int
+.br
+Valid values:
+.RS
+.IP busy 3
+Vnode is reporting load average greater than allowed max.
+Can combine with 
+.I offline
+.IP down 3
+Node is not responding to queries from the server.  
+Cannot be combined with 
+.I free, provisioning.
+.IP free 3
+Vnode is up and capable of accepting additional job(s).
+Cannot be combined with other states.
+.IP job-busy 3
+All CPUs on the vnode are allocated to jobs.
+Can combine with: 
+.I offline, resv_exclusive
+.IP job-exclusive 3
+Entire vnode is exclusively allocated to one job at the job's request.
+Can combine:
+.I offline, resv_exclusive
+.IP offline 3
+Jobs are not to be assigned to this vnode.  
+Can combine: 
+.I busy, job-busy, job-exclusive, resv_exclusive
+.IP provisioning 3
+Vnode is in being provisioned.  Cannot be combined with other states.
+.IP resv-exclusive 3
+Running reservation has requested exclusive use of vnode.  Can combine
+with: 
+.I job-exclusive, offline
+.IP stale 3
+Vnode was previously reported to server, but is no longer reported to
+server.  Cannot combine with 
+.I free, provisioning.
+.IP state-unknown 3
+The server has never been able to contact the vnode.  Either MoM is
+not running on the vnode, the vnode hardware is down, or there is a
+network problem.
+.IP unresolvable 3
+The server cannot resolve the name of the vnode.
+.IP wait-provisioning 3
+Vnode needs to be provisioned, but can't: limit reached
+for concurrently provisioning vnodes.  See the 
+.I max_concurrent_provision 
+server attribute.
+.RE
+.IP
+Default: No default
+
+.IP topology_info
+Contains information intended to be used in hooks.  
+.br
+Visible in and usable by hooks only.
+Invisible to Manager, Operator, User.
+.br
+Format: 
+.I XML String
+.br
+Python type: 
+.I str
+.br
+Default value: 
+.I Unset
+
+.IP vnode_pool 8
+Cray only.  Allows just one MoM, instead of all, to report inventory
+upon startup, allowing faster startup and less network communication
+between server and non-reporting MoMs.  On each Cray, all MoMs must
+have same setting for this attribute.  Can be set only at vnode
+creation; valid only on login nodes running a MoM.  Not supported on
+non-Cray machines.
+.br
+Readable by all; settable by Manager.
+.br
+Format: 
+.I Integer
+.br
+Python type:
+.I int
+.br
+Behavior:
+.RS
+.IP ">0" 3
+Only one MoM per Cray reports inventory.
+.IP Unset 3
+Each MoM reports inventory separately.
+.RE
+.IP 
+Default: 
+.I 0
+(Unset)
+
+
+.SH SEE ALSO
+The 
+.I PBS Professional Administrator's Guide, 
+qmgr(1B)
+

+ 88 - 0
doc/man1/pbs_professional.7B

@@ -0,0 +1,88 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_professional 7B "20 April 2018" Local "PBS Professional"
+.SH NAME
+.B PBS Professional
+\- The PBS Professional workload management system
+
+
+.SH DESCRIPTION
+PBS Professional is an HPC workload manager and job scheduler.
+PBS schedules jobs onto systems with the required resources, according
+to specified policy.  PBS runs on most major platforms.  See 
+.B www.pbsworks.com 
+and
+.B https://pbspro.atlassian.net/wiki/spaces/PBSPro/overview.
+
+.B Primary Commands
+.br
+.IP "init.d/pbs" 8
+Starts, stops or restarts PBS daemons on the local machine.
+This command is typically placed in /etc/init.d so that 
+PBS starts up automatically.  See the 
+.B pbs.8B
+man page.
+.br
+.IP "qmgr" 8
+Administrator's interface for configuring and managing PBS.  See the 
+.B qmgr.8B 
+man page.
+.IP "qstat" 8
+Administrator's and job submitter's tool for checking server, queue, and job status.
+See the 
+.B qstat.1B 
+man page.
+.IP "qsub" 8
+Job submitter's tool for submitting jobs to PBS.  See the 
+.B qsub.1B
+man page.
+.LP
+
+.B Documentation:
+.br
+.I PBS Professional Installation and Upgrade Guide
+.br
+.I PBS Professional Administrator's Guide
+.br
+.I PBS Professional Hooks Guide
+.br
+.I PBS Professional User's Guide
+.br
+.I PBS Professional Reference Guide
+
+.SH SEE ALSO
+.br
+pbs_mom(8B), pbs_server(8B), pbs_sched(8B)

+ 303 - 0
doc/man1/pbs_python.1B

@@ -0,0 +1,303 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_python 1B "23 October 2017" Local "PBS Professional"
+.SH NAME
+.B pbs_python 
+\- Python interpreter for debugging a hook script from the command line
+.SH SYNOPSIS
+.B pbs_python
+--hook  [-e <log event mask>] [-i <event input file>] 
+.RS 11
+[-L <log dir>] [-l <log file>] [-o <hook execution record>] 
+.br
+[-r <resourcedef file>] [-s <site data file>] [<Python script>]
+.RE
+
+.B pbs_python
+<standard Python options>
+
+.B pbs_python
+--version
+
+.SH DESCRIPTION
+The PBS Python interpreter, 
+.B pbs_python,
+is a wrapper for Python.  
+
+You can use the 
+.B pbs_python
+wrapper that is shipped with PBS to debug hooks.  Either:
+.RS 5
+Use the 
+.I --hook 
+option to 
+.B pbs_python
+to run 
+.B pbs_python
+as a wrapper to Python, employing the 
+.B pbs_python 
+options.  With the 
+.I --hook 
+option, you cannot use the standard Python options.  The rest of this
+man page covers how to use 
+.B pbs_python
+with the 
+.I --hook
+option.
+
+Do not use the 
+.I --hook
+option, so 
+.B pbs_python
+runs the Python interpreter, with the standard Python options, and without access to
+the 
+.B pbs_python 
+options.
+.RE
+
+.B Debugging Hooks
+.br
+You can get each hook to write out debugging files, and then modify the files
+and use them as debugging input to
+.B pbs_python.  
+Alternatively, you can write them yourself.  
+
+Debugging files can contain information about the event, about the site, and 
+about what the hook changed.  You can use these as inputs to a hook when debugging.
+
+For a complete description of using
+.B pbs_python
+with debugging files, see "Debugging Hooks" in the PBS Professional Hooks Guide.
+
+.SH Options to pbs_python
+.IP "--hook" 6
+This option is a switch.  When you use this option, you can use the
+PBS Python module (via "import pbs"), and the other options described
+here are available.  When you use this option, you cannot use the
+standard Python options.  This option is useful for debugging.  
+
+When you do not use this option, you cannot use
+the other options listed here, but you can use the standard 
+Python options.
+
+.IP "-e <log event mask>" 6
+Sets the mask that determines which event types are logged by
+.B pbs_python. 
+To see only debug messages, set the value to 0xd80. To
+see all messages, set the value to 0xffff.
+.br
+The 
+.B pbs_python 
+interpreter uses the same set of mask values that are
+used for the 
+.I $logevent <mask> 
+entry in the 
+.B pbs_mom 
+configuration file.
+See the pbs_mom.8B man page.  Available only when 
+.I --hook 
+option is used.
+
+.IP "-i <event input file>" 6
+Text file containing data to populate pbs.event() objects.  
+
+Each line specifies an attribute value or a resource value.  Syntax of
+each input line is one of the following:
+.RS 10
+<object name>.<attribute name>=<attribute value>
+.br
+<object name>.<resource list>[<resource name>]=<resource value>
+.RE
+.IP
+Where
+.RS 10
+<object name> is a PBS object name which can refer to its sub-objects.  Examples:  
+"pbs.event()", "pbs.event().job", "pbs.event().vnode_list["<vnode name>"]".
+.RE
+.IP
+Example input file:
+.RS 10
+.br
+pbs.event().hook_name=proto
+.br
+pbs.event().hook_type=site
+.br
+pbs.event().type=queuejob
+.br
+pbs.event().requestor=user1
+.br
+pbs.event().requestor_host=host1
+.br
+pbs.event().hook_alarm=40
+.br
+pbs.event().job.id=72
+.br
+pbs.event().job.Job_Name=job1
+.br
+pbs.event().job.Resource_List[ncpus]=5
+.br
+pbs.event().job.Resource_List[mem]=6mb
+.br
+pbs.event().vnode_list["host1"].resources_available["ncpus"] = 5
+.br
+pbs.event().vnode_list["host1"].resources_available["mem"] = 300gb
+.RE
+
+.IP
+Available only when 
+.I --hook 
+option is used.
+
+
+.IP "-L <log dir>" 6
+Directory holding the log file where pbs.logmsg() and pbs.logjobmsg()
+write their output.  Default is current working directory where 
+.B pbs_python
+is executed.
+Available only when 
+.I --hook 
+option is used.
+
+.IP "-l <log file>" 6
+Log file where pbs.logmsg() and pbs.logjobmsg() write their output.
+Default file name is current date in 
+.I yyyymmdd 
+format.
+Available only when 
+.I --hook 
+option is used.
+
+.IP "-o <hook execution record>" 6
+The hook execution record contains the changes made after executing the hook
+script, such as the attributes and resources set in any pbs.event()
+jobs and reservations, whether an action was accepted or rejected, and any
+pbs.reject() messages.
+.br
+Example hook execution record:
+.RS 10
+.br
+pbs.event().job.Job_Name=job2
+.br
+pbs.event().job.Resource_List[file]=60gb
+.br
+pbs.event().job.Resource_List[ncpus]=5
+.br
+pbs.event().job.Resource_List[mem]=20gb
+.br
+pbs.event().job.Account_Name=account2
+.br
+pbs.event().reject=True
+.br
+pbs.event().reject_msg=No way! 
+.RE
+
+.IP 
+Without this option, output goes to stdout.
+
+.IP
+Available only when 
+.I --hook 
+option is used.
+
+.IP "-r <resourcedef file>" 6
+File/path name containing a resource definition specifying a custom
+resource whose Python type is 
+.I pbs.resource.
+.br 
+Format: 
+.br
+.I <resource name> type=<typename> [flag=<value>]
+.br
+This file has the same format as the PBS_HOME/server_priv/resourcedef
+file.  Available only when 
+.I --hook 
+option is used.
+
+.IP "-s <site data file>" 6
+The site data file can contain any relevant information about the
+server, queues, vnodes, and jobs at the server.  This file 
+can be written by a hook or by the administrator.  
+.br
+When the hook writes it, this file contains the values that populate
+the server, queues, vnodes, reservations, and jobs, with all
+attributes and resources for which there are values.
+.br 
+The site data file is named 
+.I hook_<event type>_<hook name>_<random integer>.data.  
+Available only when 
+.I --hook 
+option is used.
+
+.IP "--version" 6
+The 
+.B pbs_python 
+command prints its version information and exits.  This option
+can only be used alone.  
+
+.SH ARGUMENTS
+.IP "<Python script>" 6
+The hook script to execute.
+We recommend importing the PBS Python module at the start of the script:
+.RS 9
+import pbs
+.RE
+.IP
+If you do not specify 
+.I Python script, 
+you can perform interactive
+debugging.  If you type the following:
+.RS 9
+pbs_python --hook -i hook.input
+.RE
+.IP
+The interpreter displays a prompt:
+.RS 9
+>>
+.RE
+.IP
+You can type your Python lines at the prompt:
+.RS 9
+>>import pbs
+.br
+>> e=pbs.event().job
+.br
+>> print e.id
+.br
+<job ID>
+.br
+...
+.RE
+

文件差异内容过多而无法显示
+ 1499 - 0
doc/man1/pbs_queue_attributes.7B


+ 223 - 0
doc/man1/pbs_ralter.1B

@@ -0,0 +1,223 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_ralter 1B "18 May 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_ralter 
+\- modify an existing advance or standing reservation
+.SH SYNOPSIS
+.B pbs_ralter
+[-E <end time>] [-I <block time>] [-m <mail points>] 
+           [-M <mail list>] [-N <reservation name>] [-R <start time>] 
+           <reservation ID>
+.br
+.B pbs_ralter
+--version
+.SH DESCRIPTION
+You can use the 
+.B pbs_ralter 
+command to alter an existing advance or standing reservation.  You can
+change the start time, end time, events that generate mail, mail
+recipient list, and reservation name.  You can change the end time for
+a running reservation with running jobs.  
+
+You can use this command to change an advance reservation or the next
+or current instance of a standing reservation.  
+
+After the change is requested, the change is either confirmed or
+denied. On denial of the change, the reservation is not deleted and is
+left as is, and the following message appears in the server's log:
+.nf
+   Unable to alter reservation <reservation ID> 
+.fi
+
+When a reservation is
+confirmed, the following message appears in the server's log:
+.nf
+   Reservation alter successful for <reservation ID> 
+.fi
+
+To find out whether or not the change was allowed: 
+.RS 3
+Use the pbs_rstat command: see whether you altered reservation attribute(s) 
+
+Use the interactive option: check for confirmation after the blocking time has run out 
+
+Check the server log for confirmation or denial messages
+.RE
+
+Before the change is confirmed or denied, the change is unconfirmed,
+and the reservation state is 
+.I AL.  
+
+Once a reservation change is confirmed, the reservation state is 
+.I CO 
+or 
+.I RN.  
+
+If the reservation has not started and it cannot be confirmed on the same vnodes, PBS
+searches for another set of vnodes.
+
+.B Required Privilege
+.br
+You must be the reservation owner or the PBS Administrator to run this command.
+
+.SH Options to pbs_ralter
+
+.IP "-R <start time>" 10
+Specifies reservation's new start time. This option can be used either
+when the reservation is not running or there are no jobs are submitted
+to the reservation.  You cannot use this option when a reservation is
+not empty and has started running.
+
+The specifications for providing the time are the same as for pbs_rsub:
+.br
+If the day, 
+.I DD, 
+is not specified, it defaults to today if the time
+.I hhmm 
+is in the future.  Otherwise, the day is set to tomorrow.  For
+example, if you alter a reservation with the specification -R 1110 at
+11:15 a.m., it is interpreted as being for 11:10 a.m. tomorrow.  If
+the month portion,
+.I MM, 
+is not specified, it defaults to the current month, provided that the specified day 
+.I DD, 
+is in the future.  Otherwise, the month is set to next month.  Similar
+rules apply to the two other optional, left-side components.
+
+Format: 
+.I Datetime
+
+.IP "-E <end time>" 10
+Specifies reservation's new end time. This option can be used even
+when the reservation is running and has jobs that are submitted to
+and/or are running in the reservation.
+
+Format: 
+.I Datetime
+
+.IP "-I <block time>" 10
+Specifies interactive mode. The pbs_ralter command will block, up to
+.I block time 
+seconds, while waiting for the reservation's change request
+to be confirmed or denied.
+
+The value for 
+.I block time 
+must be positive. The pbs_ralter command
+returns either the status 
+.I "CONFIRMED" 
+or the status 
+.I "DENIED".
+
+Format: 
+.I Integer
+
+Default: Not interactive
+
+.IP "-m <mail points>" 10
+Specifies the set of events that cause mail to be sent to the list of
+users specified in the 
+.I -M <mail list> 
+option.
+
+Format: 
+.I String
+.br
+Syntax: Either of
+.RS 13
+1) any combination of "a", "b", "c" or "e", or
+.br
+2) the single character "n"
+.RE
+.IP
+.nf
+Suboptions to -m Option:
+
+Character   Meaning
+--------------------------------------------------------------
+a           Notify if reservation is terminated for any reason
+b           Notify when the reservation period begins
+c           Notify when the reservation is confirmed
+e           Notify when the reservation period ends
+n           Send no mail.  Cannot be used with any of a, b, c or e.
+.fi
+
+Default: No default; if not specified, mail events are unchanged
+
+.IP "-M <mail list>" 10
+The list of users to whom mail is sent whenever the reservation
+transitions to one of the states specified in the
+.I -m <mail points> 
+option.  
+
+Format: 
+.I <username>[@<hostname>][,<username>[@<hostname>]...]
+
+Default: No default; if not specified, user list is unchanged
+
+.IP "-N <reservation name>" 10
+Specifies a name for the reservation.  
+
+Format: 
+.RS 13
+String up to 15 characters in length.  It must consist of printable,
+non-white space characters with the first character alphabetic.
+.RE
+.IP
+Default: No default; if not specified, reservation name is unchanged
+
+.IP "--version" 10
+The 
+.B pbs_ralter
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH OPERANDS
+The pbs_ralter command takes a reservation ID.
+.br
+For an advance reservation this has the form:
+.RS 4
+.I "R<sequence number>[.<server name>][@<remote server>]"
+.RE
+For a standing reservation this has the form:
+.RS 4
+.I "S<sequence number>[.<server name>][@<remote server>]"
+.RE
+
+.I @<remote server> 
+specifies a reservation at a server other than the default server.
+

+ 96 - 0
doc/man1/pbs_rdel.1B

@@ -0,0 +1,96 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_rdel 1B "18 May 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_rdel 
+\- delete a PBS advance or standing reservation 
+.SH SYNOPSIS
+.B pbs_rdel
+<reservation ID>[,<reservation ID>...]
+.br
+.B pbs_rdel
+--version
+.SH DESCRIPTION
+The 
+.B pbs_rdel
+command deletes reservations in the order specified.
+
+This command deletes the specified reservations, whether or not they
+are running, all jobs in the reservations, and the reservation queues.
+
+.B Required Privilege
+.br
+A reservation may be deleted by its owner, a PBS Operator,
+or a PBS Manager.
+
+.SH OPTIONS
+.IP "--version" 10
+The 
+.B pbs_rdel
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH OPERANDS
+The pbs_rdel command accepts one or more 
+.I reservation ID
+operands.  
+.br
+For an advance reservation this has the form:
+.RS 4
+.I "R<sequence number>[.<server name>][@<remote server>]"
+.RE
+For a standing reservation this has the form:
+.RS 4
+.I "S<sequence number>[.<server name>][@<remote server>]"
+.RE
+
+.I @<remote server> 
+specifies a reservation at a server other than the default server.
+
+.SH EXIT STATUS
+.IP "Zero" 10 
+Upon success
+.IP "Greater than zero" 10
+Upon failure to process any operand
+
+.SH SEE ALSO
+The
+.B PBS Professional User's Guide,
+the
+.B PBS Professional Administrator's Guide,
+pbs_rsub(1B),
+pbs_rstat(1B),
+pbs_resv_attributes(7B)

+ 140 - 0
doc/man1/pbs_release_nodes.1B

@@ -0,0 +1,140 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_release_nodes 1B "18 May 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_release_nodes 
+\- release vnodes assigned to a PBS job
+.SH SYNOPSIS
+.B pbs_release_nodes
+[-j <job ID>] <vnode> [<vnode> [<vnode>] ...]
+.br
+.B pbs_release_nodes 
+[-j <job ID>] -a
+.br
+.B pbs_release_nodes
+--version
+.SH DESCRIPTION
+
+You can use the 
+.B pbs_release_nodes 
+command to release no-longer-needed
+vnodes assigned to a running job, before the job would normally
+release them.  These vnodes are then available for use by other jobs.
+
+You can specify the names of vnodes to be released, or you can release
+all vnodes not on the primary execution host that are assigned to a
+running job via the 
+.I -a 
+option.
+
+.B Caveats and Restrictions
+.br
+You can release only vnodes that are not on the primary execution
+host.  You cannot release vnodes on the primary execution host.
+
+The job must be running (in the 
+.I R 
+state).
+
+The pbs_release_nodes command is not supported on vnodes tied to Cray
+X* series systems (vnodes whose 
+.I vntype 
+has the "cray_" prefix).
+
+The pbs_release_nodes command is not supported for vnodes managed by
+cpuset MoMs; partial release of vnodes may result in leftover cpusets.
+
+If cgroups support is enabled, and pbs_release_nodes is called to
+release some but not all the vnodes managed by a MoM, resources on
+those vnodes that are part of a cgroup are not released until the
+entire cgroup is released.
+
+.B Required Privilege
+.br
+This command can be run by the job owner, the PBS Manager, Operator,
+and Administrator, as well as root on Linux and Admin on Windows.
+
+.SH Options to pbs_release_nodes
+
+.IP "-a" 10
+Releases all job vnodes not on the primary execution host.  Cannot be
+used with list of vnode names.
+
+.IP "-j <job ID>" 10
+
+Specifies the job ID for the job whose vnode(s) are to be released.
+
+.IP "(no options)" 10
+Without the 
+.I -j 
+option, pbs_release_nodes uses the value of the
+.I PBS_JOBID 
+environment variable as the job ID of the job whose vnodes are to be released.
+
+.IP "--version" 10
+The pbs_release_nodes command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH Operands for pbs_release_nodes
+The pbs_release_nodes command can take as an operand a list of vnodes.  Format:
+.br
+.I <vnode name> [<vnode name> [<vnode name>] ...]
+.br
+Cannot be used with the 
+.I -a 
+option.
+
+.SH Usage
+This command can be run at the command line, or called inside a job
+script, where it can use the value of the 
+.I PBS_JOBID 
+environment variable.
+
+You can release any vnode that appears in the job's 
+.I exec_vnode 
+attribute that is not on the primary execution host.  You can release
+a particular set of a job's vnodes, or you can release all of a job's
+non-primary-execution-host vnodes.
+
+To release specific vnodes:
+.br
+.I pbs_release_nodes [-j <job ID>] <vnode name> [<vnode name>] ...]
+
+To release all of a jobÕs vnodes that are not on the primary execution host:
+.br
+.I pbs_release_nodes [-j <job ID>] -a
+
+

文件差异内容过多而无法显示
+ 1613 - 0
doc/man1/pbs_resources.7B


+ 695 - 0
doc/man1/pbs_resv_attributes.7B

@@ -0,0 +1,695 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_resv_attributes 7B "20 April 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_resv_attributes 
+\- attributes of PBS advance and standing reservations
+
+.SH DESCRIPTION
+PBS advance and standing reservations have the following attributes:
+
+.IP Account_Name 8
+No longer used.
+
+.IP Authorized_Groups 8
+List of groups who can or cannot submit jobs to this reservation.
+Group names are interpreted relative to the server, not the 
+submission host.  List is evaluated left-to-right; first match in 
+list is used.  This list is used to set the reservation queue's 
+.I acl_groups 
+attribute.  See the 
+.I G 
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I String
+.br
+Syntax:
+.RS 11
+.I [+|-]<group name> [,[+|-]<group name> ...] 
+.RE
+.IP
+Python type:
+.I pbs.acl
+.br
+Default: Reservation owner's login group
+
+.IP Authorized_Hosts 8
+The list of hosts from which jobs can and cannot be submitted to this reservation. 
+List is evaluated left-to-right; first match in list is used.  
+This list is used to set the reservation queue's 
+.I acl_hosts
+attribute.  See the 
+.I H
+option to the 
+.I pbs_rsub 
+command.  
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I String
+.br
+Syntax:
+.RS 11
+.I [+|-]<hostname> [,[+|-]<hostname> ...]
+.br
+Hostnames may be wildcarded using an asterisk, according to the following rules:
+.RS 3
+- A hostname can contain at most one asterisk
+.br
+- The asterisk must be the leftmost label
+.RE
+Examples:
+.RS 3
+*.test.example.com
+.br
+*.example.com
+.br
+*.com
+.RE
+.RE
+.RE
+.IP
+Python type:
+.I pbs.acl
+.br
+Default: No default (Jobs can be submitted from all hosts)
+
+.IP Authorized_Users 8
+The list of users who can or cannot submit jobs to this reservation.
+List is evaluated left-to-right; first match in list is used.  
+This list is used to set the reservation queue's 
+.I acl_users
+attribute.  See the 
+.I U 
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I String
+.br
+Syntax:
+.RS 11
+.I [+|-]<username>[<hostname>.<domain>] [, [+|-]<username>[<hostname>.<domain>] ...]
+.br
+where '-' means "deny" and '+' means "allow". 
+.br
+The hostname portion of a username may be wildcarded using an asterisk, 
+according to the following rules:
+.RS 3
+- A hostname can contain at most one asterisk
+.br
+- The asterisk must be the leftmost label in the hostname
+.RE
+Examples:
+.RS 3
+*.test.example.com
+.br
+*.example.com
+.br
+*.com
+.RE
+.RE
+.RE
+.IP
+Python type:
+.I pbs.acl
+.br
+Default: Reservation owner only
+
+.IP ctime 8
+The time that the reservation was created.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I Timestamp
+.RS 11
+Printed by qstat in human-readable
+.I Date
+format.  
+.br
+Output in hooks as seconds since epoch.
+.RE
+.IP 
+Python type:
+.I int
+.br
+Default: No default
+
+.IP group_list 8
+No longer used.
+
+.IP hashname 8
+No longer used.
+
+.IP "interactive" 8
+Number of seconds that the 
+.I pbs_rsub 
+command will block while waiting for confirmation or denial of the 
+reservation.  
+See the 
+.I -I block_time
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I Integer
+.br
+Behavior:
+.RS 11
+.IP "Less than zero" 3
+The reservation is automatically deleted if it cannot be confirmed in the time specified.
+.IP "Zero or greater than zero" 3
+The reservation is not automatically deleted after this time.  
+.RE
+.IP
+Python type:
+.I int
+.br
+Default: 
+.I Zero
+
+.IP "Mail_Points" 8
+Sets the list of events for which mail is sent by the server.  Mail 
+is sent to the list of users specified in the 
+.I Mail_Users
+attribute.  See the 
+.I m mail_points 
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I String 
+.br
+Syntax:
+.RS 11
+One or more letters "a", "b", "c", "e", or the string "n".  
+.br
+Cannot use "n" with any other letter.
+.RE
+.IP
+Behavior:
+.RS 11
+.IP a 3
+Notify when reservation is terminated
+.IP b 3
+Notify when reservation period begins
+.IP c 3
+Notify when reservation is confirmed
+.IP e 3
+Notify when reservation period ends
+.IP n 3
+Do not send mail.  Cannot be used with other letters.
+.RE
+.IP
+Python type:
+.I pbs.group_list
+.br
+Default: "ac"
+
+.IP "Mail_Users" 8
+The set of users to whom mail is sent for the reservation events
+specified in the 
+.I Mail_Points
+attribute.  See the 
+.I M mail_list 
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I String 
+.br
+Syntax:
+.RS 11
+.I <username>@<hostname>[,<username>@<hostname> ...]
+.RE
+.IP
+Python type:
+.I pbs.user_list
+.br
+Default: Reservation owner only
+
+.IP mtime 8
+The time that the reservation was last modified.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I Timestamp
+.RS 11
+Printed by qstat in human-readable
+.I Date
+format.  
+.br
+Output in hooks as seconds since epoch.
+.RE
+.IP
+Python type:
+.I int
+.br
+Default: No default
+
+.IP Priority 8
+No longer used.
+
+.IP queue 8
+Name of the reservation queue.  Jobs that 
+are to use resources belonging to this reservation are submitted to this queue. 
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I String
+.RS 11
+Format for an advance reservation:
+.I R<unique integer>
+.br
+Format for a standing reservation:
+.I S<unique integer>
+.RE
+.IP
+Python type:
+.I pbs.queue
+.br
+Default: No default
+
+.IP reserve_count 8
+The total number of occurrences in a standing reservation.
+.br 
+Readable by all; settable by all.
+.br
+Format:
+.I Integer
+.br
+Python type:
+.I int
+.br
+Default: No default
+
+.IP reserve_duration 8
+Reservation duration in seconds.  For a standing reservation, this is the
+duration for one occurrence.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I Integer
+.br
+Python type:
+.I pbs.duration
+.br
+Default: No default
+
+.IP reserve_end 8
+The date and time when an advance reservation or soonest occurrence of a
+standing reservation ends.  
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I Timestamp
+.RS 11
+Printed by qstat in human-readable
+.I Date
+format.  
+.br
+Output in hooks as seconds since epoch.
+.RE
+.IP
+Python type:
+.I int
+.br
+Default: No default
+
+.IP reserve_ID 8
+The reservation identifier. 
+.br
+Format:
+.I String 
+.RS 11
+Format for an advance reservation: 
+.I R<unique integer>.<server name>
+.br
+Format for a standing reservation: 
+.I S<unique integer>.<server name>
+.RE
+.IP
+Python type:
+.I str
+.br
+Default: No default
+
+.IP reserve_index 8
+The index of the soonest occurrence of a standing reservation.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I Integer
+.br
+Python type:
+.I int
+.br
+Default: No default
+
+.IP "Reserve_Name" 8
+The name assigned to the reservation during creation, if specified.  See the 
+.I N 
+option to the 
+.I pbs_rsub 
+command.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I String 
+.br
+Syntax:
+Up to 15 characters.  First character is alphabetic.
+.br
+Python type:
+.I str
+.br
+Default: No default
+
+.IP "Reserve_Owner" 8
+The login name on the submitting host of the user who created the
+reservation.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I String
+.br
+Syntax:
+.I <username>@<hostname>
+.br
+Python type:
+.I str
+.br
+Default: Login name of creator
+
+.IP reserve_retry 8
+If this reservation becomes degraded, this is set to the 
+next time that PBS will attempt to reconfirm this reservation.
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I Timestamp
+.RS 11
+Printed by qstat in human-readable
+.I Date
+format.  
+.br
+Output in hooks as seconds since epoch.
+.RE
+.IP
+Python type:
+.I int
+.br
+Default: No default
+
+.IP reserve_rrule 8
+The rule that describes the recurrence pattern of a standing reservation.
+See the 
+.I r
+option to the 
+.I pbs_rsub
+command.
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I String
+.br
+Syntax: either of two forms:
+.RS 11
+"FREQ=
+.I <freq_spec>;
+COUNT=
+.I <count_spec>;
+.I <interval_spec>"
+.br
+or
+.br
+"FREQ=
+.I <freq_spec>;
+UNTIL=
+.I <until_spec>; <interval_spec>"
+.br
+where
+.IP freq_spec 15
+Frequency with which the standing reservation repeats.  Valid values are:
+.br
+WEEKLY|DAILY|HOURLY
+
+.IP count_spec 15
+The exact number of occurrences.  Number up to 4 digits in length.  
+.br
+Format:
+.I Integer
+
+.IP interval_spec 15
+Specifies interval.  
+.br
+Format is one or both of:
+.br
+.I BYDAY = MO|TU|WE|TH|FR|SA|SU 
+.br
+or
+.br
+.I BYHOUR = 0|1|2|...|23
+.br
+
+.IP until_spec 15
+Occurrences will start up to but not after date and time 
+specified.
+.br
+.br
+Format:
+.I YYYYMMDD[THHMMSS] 
+.br
+Note that the year-month-day section is separated from 
+the hour-minute-second section by a capital T.
+.RE
+.IP
+Python type:
+.I str
+.br
+Default: No default
+
+.IP reserve_start 8
+The date and time when the reservation period for the reservation 
+or soonest occurrence begins.  
+.br
+Readable by all; settable by all.
+.br
+Format: 
+.I Timestamp
+.RS 11
+Printed by qstat in human-readable
+.I Date
+format.  
+.br
+Output in hooks as seconds since epoch.
+.RE
+.IP
+Python type:
+.I int
+
+.IP reserve_state 8
+The state of the reservation.  
+.br
+Readable by all; set by PBS.
+.br
+Format: 
+.I String
+.br
+Python type:
+Each value has its own reservation state constant.
+
+The following table shows each abbreviation, state, and Python constant:
+.RS
+
+.IP "NO   RESV_NONE            pbs.RESV_STATE_NONE"
+No reservation yet.
+
+.IP "UN   RESV_UNCONFIRMED     pbs.RESV_STATE_UNCONFIRMED "
+Reservation request is awaiting confirmation.
+
+.IP "CO   RESV_CONFIRMED       pbs.RESV_STATE_CONFIRMED "
+Reservation has been confirmed.  For a standing reservation, this means
+that all occurrences of the reservation have been confirmed.
+
+.IP "WT   RESV_WAIT            pbs.RESV_STATE_WAIT "
+Unused.  
+
+.IP "TR   RESV_TIME_TO_RUN     pbs.RESV_STATE_TIME_TO_RUN "
+Start of the reservation period.
+
+.IP "RN   RESV_RUNNING         pbs.RESV_STATE_RUNNING "
+Reservation period has started and reservation is running.
+
+.IP "FN   RESV_FINISHED        pbs.RESV_STATE_FINISHED "
+End of the reservation period.
+
+.IP "BD   RESV_BEING_DELETED   pbs.RESV_STATE_BEING_DELETED "
+Reservation is being deleted.
+
+.IP "DE   RESV_DELETED         pbs.RESV_STATE_DELETED "
+Reservation has been deleted.
+
+.IP "DJ   RESV_DELETING_JOBS   pbs.RESV_STATE_DELETING_JOBS "
+Jobs belonging to the reservation are being deleted.
+.RE
+.IP
+Default: No default
+
+.IP reserve_substate 8
+The substate of the reservation or occurrence.  The 
+substate is used internally by PBS.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I Integer
+.br
+Python type:
+.I int
+.br
+Default: No default
+
+.IP reserve_type 8
+No longer used.
+
+.IP "Resource_List" 8
+The list of resources allocated to the reservation.  Jobs running in
+the reservation cannot use in aggregate more than the specified amount
+of a resource.
+.br
+Readable by all; settable by all.
+.br
+Format:
+.I String
+.br
+Syntax:
+.RS 11
+.I Resource_List.<resource name>=<value>[,Resource_List.<resource name>=<value> ...]
+.RE
+.IP
+Python type: 
+.I pbs.pbs_resource
+.br
+Syntax:
+.RS 11
+.I Resource_List["<resource name>"]=<resource value>
+.br
+where 
+.I resource name 
+is any built-in or custom resource
+.RE
+.IP
+Default: No default
+
+.IP resv_nodes 8
+The list of vnodes and resources allocated from them to satisfy 
+the chunks requested for this reservation or occurrence.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I String
+.br
+Syntax:  
+.RS 11
+.I (<vnode name>:<resource name>=<value>[:<resource name>=<value>]...) 
+.I [+(<vnode name>:<resource name>=<value>[:<resource name>=<value>])+...]
+.RE
+.IP
+Python type:
+.I pbs.exec_vnode
+.br
+Default: No default
+
+.IP server 8
+Name of server.
+.br
+Readable by all; set by PBS.
+.br
+Format:
+.I String
+.br
+Python type:
+.I pbs.server
+.br
+Default: No default
+
+.IP User_List 8
+No longer used.
+
+.IP Variable_List 8
+Not used.
+
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+pbs_rstat(1B), 
+pbs_rsub(1B), 
+pbs_resources(7B)
+

+ 120 - 0
doc/man1/pbs_rstat.1B

@@ -0,0 +1,120 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_rstat 1B "25 October 2017" Local "PBS Professional"
+.SH NAME
+.B pbs_rstat 
+\- show status of PBS advance or standing reservations
+.SH SYNOPSIS
+.B pbs_rstat 
+[-B] [-F] [-S] [<reservation ID>...]
+.br
+.B pbs_rstat 
+--version
+.SH DESCRIPTION
+The
+.B pbs_rstat
+command shows the status of all reservations at the PBS server.
+Denied reservations are not displayed.
+
+.B Required Privilege
+.br
+This command can be run by a user with any level of PBS privilege.  For
+full output, users without manager or operator privilege cannot print
+custom resources which where created to be invisible to users.
+
+.SH Output
+The
+.B pbs_rstat
+command displays output in any of brief, short, or full formats.
+
+See the 
+.B pbs_resv_attributes(7B) 
+man page for information about reservation attributes, and the 
+"States" chapter in the PBS Professional Reference Guide.
+
+.SH OPTIONS
+.IP "-B" 10
+Brief output.  Displays each reservation identifier only.
+
+.IP "-F" 10
+Full output.  Displays all reservation attributes that are not set to 
+the default value.  Users without manager or operator privilege
+cannot print custom resources which were created to be invisible to users.
+
+.IP "-S" 10
+Short output.  Displays a table showing the name, queue, owner, state, 
+start time, duration, and end time of each reservation.
+
+.IP "--version" 10
+The 
+.B pbs_rstat
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.IP "(no options)" 10
+Short output.  Same behavior as 
+.I -S 
+option.
+
+.SH OPERANDS
+The 
+.B pbs_rstat 
+command accepts one or more
+.I reservation ID
+operands.  
+.br
+
+For an advance reservation, this has the form:
+.RS 4
+.I "R<sequence number>[.<server name>][@<remote server>]"
+.RE
+
+For a standing reservation, this has the form:
+.RS 4
+.I "S<sequence number>[.<server name>][@<remote server>]"
+.RE
+
+.I @<remote server> 
+specifies a reservation at a server other than the default server.
+
+.SH SEE ALSO
+The
+.B PBS Professional User's Guide,
+the
+.B PBS Professional Administrator's Guide,
+.br
+pbs_rsub(1B), pbs_rdel(1B), pbs_resv_attributes(7B)
+

+ 694 - 0
doc/man1/pbs_rsub.1B

@@ -0,0 +1,694 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_rsub 1B "19 February 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_rsub 
+\- create a PBS advance or standing reservation 
+
+.SH SYNOPSIS
+.B pbs_rsub 
+[-D <duration>] [-E <end time>] [-g <group list>] 
+.RS 9
+[-G <auth group list>] [-H <auth host list>] [-I <block time>]
+[-m <mail events>] [-M <mail list>] [-N <reservation name>]
+[-q <destination>] [-r <recurrence rule>] [-R <start time>]  
+[-u <user list>] [-U <auth user list>] [-W <attribute value list>]
+-l <resource request> [-l <placement>]
+.RE
+
+.B pbs_rsub 
+--version
+
+.SH DESCRIPTION
+The 
+.B pbs_rsub
+command is used to create an advance or standing reservation.
+An advance reservation reserves specific 
+resources for the requested time period, and a standing reservation
+reserves specific resources for recurring time periods.  When 
+a reservation is created, it has an associated queue.
+
+After the reservation is requested, it is either confirmed or denied.
+Once the reservation has been confirmed, authorized users submit jobs to the 
+reservation's queue via
+.B qsub 
+and 
+.B qmove.
+
+A confirmed reservation will accept jobs at any time.
+The jobs in its queue can run only during the reservation 
+period, whether during a single advance reservation or 
+during the occurrences of a standing reservation.
+
+When an advance reservation ends, all of its jobs are
+deleted, whether running or queued.  When an occurrence of a 
+standing reservation ends, only its running jobs are deleted; 
+those jobs still in the queue are not deleted.
+
+To get information about a reservation, use the 
+.B pbs_rstat 
+command.
+
+To delete a reservation, use the 
+.B pbs_rdel 
+command.  Do not use the
+.B qdel 
+command.
+
+The behavior of the 
+.B pbs_rsub 
+command may be affected by 
+any site hooks.  Site hooks can modify the reservation's attributes.
+
+
+.SH REQUIREMENTS
+
+When using
+.B pbs_rsub
+to request a reservation, you must specify two of the following 
+options: 
+.I -R, -E, 
+and
+.I -D.
+The resource request 
+.I -l walltime
+can be used instead of the 
+.I -D 
+option.
+
+If you want to run jobs in a reservation that will request exclusive placement,
+you must create the reservation with exclusive placement via -l place=excl.
+
+.SH OPTIONS
+.IP "-D <duration>" 8
+Specifies reservation duration. If the start
+time and end time are the only times specified, this duration time is
+calculated.  
+.br
+Format: 
+.I Duration.  
+See 
+.B FORMATS.
+.br
+Default: none
+.RE
+.IP "-E <end time>" 8
+Specifies the reservation end time.  If start time and duration are
+the only times specified, the end time value is calculated.    
+.br
+Format: 
+.I Datetime. 
+See 
+.B FORMATS.
+.br
+Default: none.
+.RE
+.IP "-g <group list>" 8
+The 
+.I group list
+is a comma-separated list of group names. 
+The server uses entries in this list, along with an ordered set 
+of rules, to associate a group name with the reservation. 
+The reservation creator's primary group is automatically added to this list.
+.br
+Format: <group>@<hostname>[,<group>@<hostname> ...]
+.RE
+.IP "-G <auth group list>" 8
+Comma-separated list of names of groups who
+can or cannot submit jobs to this reservation.  Group names are
+interpreted in the context of the server's host, not the context of the host 
+from which the job is submitted. 
+.br
+This list becomes the 
+.I acl_groups 
+list for the 
+reservation's queue. 
+More specific entries should be listed before more general, because the
+list is read left-to-right, and the first match determines access.
+.br
+If both the
+.I Authorized_Users
+and 
+.I Authorized_Groups
+reservation attributes are set, a user must belong to both in order to
+be able to submit jobs to this reservation.  If the reservation
+creator specifies this list, the creator's group is not automatically
+added to the list.
+.br
+Refer to the 
+.I Authorized_Groups 
+reservation attribute in the 
+pbs_resv_attributes(7B) man page.  
+.br
+Format: [+|-]<group name>[,[+|-]<group name> ...]
+.br
+Default: All groups are authorized to submit jobs.
+.RE
+.IP "-H <auth host list>" 8
+Comma-separated list of hosts from which jobs can and cannot be 
+submitted to this reservation.  This list becomes the 
+.I acl_hosts 
+list for the reservation's queue. 
+.br
+More specific entries should be listed before more general, because the
+list is read left-to-right, and the first match determines access.
+If the reservation creator specifies this list, the creator's 
+host is not automatically added to the list.
+.br
+See the 
+.I Authorized_Hosts 
+reservation attribute in the pbs_resv_attributes(7B) man page.
+.br
+Format: [+|-]<hostname>[,[+|-]<hostname> ...]
+.br
+Default: All hosts are authorized to submit jobs
+.RE
+.IP "-I <block time>" 8
+Specifies interactive mode.  The 
+.B pbs_rsub 
+command will block, up to 
+.I block time 
+seconds, while waiting for the reservation request to be 
+confirmed or denied.
+.br
+If 
+.I block time
+is positive, and the reservation isn't confirmed or denied in 
+the specified time, the ID string for the reservation is returned 
+with the status "UNCONFIRMED".
+.br
+If 
+.I block time
+is negative, and a scheduler doesn't confirm or deny the reservation in 
+the specified time, the reservation is deleted.
+.br
+Format: Integer.
+.br
+Default: Not interactive
+.RE
+
+.IP "-l <placement>" 8
+The 
+.I placement
+specifies how vnodes are reserved. 
+The 
+.I place
+statement can contain the following elements, in any order:
+.IP " " 11
+-l place=[
+.I <arrangement>
+][:
+.I <sharing>
+][:
+.I <grouping>
+]
+.LP
+.IP " " 8
+where
+.IP " " 11
+.RS 
+.IP arrangement 3
+Whether this reservation chunk is willing to share this vnode or host 
+with other chunks from this reservation.  One of 
+.I free
+|
+.I pack
+|
+.I scatter
+| 
+.I vscatter
+
+.IP sharing 3
+Whether this reservation chunk is willing to share this vnode or host
+with other reservations or jobs.  One of 
+.I excl 
+| 
+.I share 
+| 
+.I exclhost
+
+.IP grouping 3
+Whether the chunks from this reservation should be placed on vnodes
+that all have the smae value for a resource.  Can have only one
+instance of
+.I group=resource
+.LP
+.LP
+.RE
+.LP
+.IP " " 8
+and where
+.IP " " 11
+.RS
+.IP free 3
+Place reservation on any vnode(s).
+.IP pack
+All chunks are taken from one host.
+.IP scatter 3
+Only one chunk with any MPI processes is taken from a host.
+A chunk with no MPI processes may be taken from the same vnode as
+another chunk.
+.IP vscatter 3
+Only one chunk is taken from any vnode.  Each chunk must fit on a vnode.
+.IP excl 3
+Only this reservation uses the vnodes chosen.
+.IP exclhost 3
+The entire host is allocated to the reservation.
+.IP shared 3
+This reservation can share the vnodes chosen.
+.IP group=<resource> 3
+Chunks are grouped according to a 
+.I resource.  
+All vnodes in the group must have a common value for 
+.I resource, 
+which can be either the built-in resource
+.I host
+or a custom vnode-level resource.
+.br
+.I resource
+must be a string or a string array.
+.LP
+.LP
+.RE
+.LP
+.IP " " 8
+If you want to run jobs in the reservation that will request exclusive 
+placement, you must create the reservation with exclusive placement via 
+.B -l place=excl.
+
+The place statement cannot begin with a colon.  Colons are delimiters; use 
+them only to separate parts of a place statement, unless they are quoted
+inside resource values.
+
+Note that nodes can have sharing attributes that override
+job placement requests.  See the
+.B pbs_node_attributes(7B)
+man page.
+.LP
+.IP " " 8
+For more on reservations, see 
+.B The PBS Professional User's Guide.
+.RE
+.IP "-l resource request" 8
+The 
+.I resource request 
+specifies the resources required for the reservation. These 
+resources are used for the limits on the queue that is dynamically created 
+for the reservation. The aggregate amount of resources for currently 
+running jobs from this queue will not exceed these resource limits. 
+Jobs in the queue that 
+request more of a resource than the queue limit for that resource are not 
+allowed to run. Also, the queue inherits the value of any resource limit set 
+on the server, and these are used for the job if the reservation request 
+itself is silent about that resource.
+A non-privileged user cannot submit a reservation requesting a custom 
+resource which has
+been created to be invisible or read-only for users.
+
+Resources are requested
+by using the
+.I -l
+option, either in
+.I chunks
+inside of
+.I selection statements,
+or in job-wide requests using
+.I <resource name>=<value>
+pairs.
+
+Requesting resources in chunks:
+.RS 
+.IP " " 3
+.I -l select=[N:]<chunk>[+[N:]<chunk> ...]
+.LP
+where
+.I N
+specifies how many of that chunk, and
+a
+.I chunk
+is of the form:
+
+.IP " " 3
+.I <resource name>=<value>[:<resource name>=<value> ...]
+.LP
+
+Requesting job-wide resources:
+.IP " " 3
+.I -l <resource name>=<value>[,<resource name>=<value> ...]
+.LP
+.RE
+
+.IP "-m <mail events>" 8
+Specifies the set of events that cause mail to be sent to the 
+list of users specified in the 
+.I -M mail list
+option. 
+.br
+Format: string consisting of one of the following:
+.RS
+1) any combination of "a", "b", "c" or "e"
+.br
+2) the single character "n"
+.IP a
+Notify if the reservation is terminated for whatever reason
+.IP b
+Notify when the reservation period begins
+.IP c 
+Notify when the reservation is confirmed
+.IP e 
+Notify when the reservation period ends
+.IP n
+Send no mail.  Cannot be used with any of 
+.I a, b, c
+or 
+.I e.
+.LP
+Default:
+.I ac
+.RE
+
+.IP "-M <mail list>" 8
+The list of users to whom mail is sent 
+whenever the reservation transitions to one of the states 
+specified in the 
+.I -m mail events
+option. 
+.br
+Format: <username>[@<hostname>][,<username>[@<hostname>]...]
+.br
+Default: reservation owner.
+.RE
+.IP "-N <reservation name>" 8
+Specifies a name for the reservation. 
+.br
+Format: 
+.I Reservation name.  
+See 
+.B FORMATS.
+.br
+Default: None.
+.RE
+.IP "-q <destination>" 8
+Specifies the destination server at which to create the reservation. 
+.br
+Default: The default server is used if this option is not selected.
+.RE
+
+.IP "-r <recurrence rule>" 8
+Specifies rule for recurrence of standing reservations.  Rule must conform to iCalendar
+syntax, and is specified using a subset of parameters from RFC 2445.
+.br
+Valid syntax for 
+.I recurrence rule 
+takes one of two forms:
+.RS 11
+.I FREQ=<freq spec>;COUNT=<count spec>;<interval spec>
+.RE
+.IP " " 8
+or
+.RS 11
+.I FREQ=<freq spec>;UNTIL=<until spec>; <interval spec>
+.RE
+.IP " " 8
+where
+.RS 11
+.IP "freq spec" 5
+Frequency with which the standing reservation repeats.  Valid values are:
+.br
+WEEKLY|DAILY|HOURLY
+
+.IP "count spec" 5
+The exact number of occurrences.  Number up to 4 digits in length.  
+Format: integer.
+
+.IP "interval spec" 5
+Specifies interval.  Format is one or both of:
+.br
+BYDAY = MO|TU|WE|TH|FR|SA|SU 
+.br
+or
+.br
+BYHOUR = 0|1|2|...|23
+.br
+When using both, separate them with a semicolon.
+.br
+Elements specified in the recurrence rule override those 
+specified in the arguments to the 
+.I -R 
+and 
+.I -E
+options.  For example, the 
+.I BYHOUR 
+specification overrides the hourly part of the
+.I -R
+option.  For example, 
+.br
+-R 0730 -E 0830 ... BYHOUR=9
+.br
+results in a reservation that starts at 9:30 and runs for 1 hour.
+See the 
+.B PBS Professional User's Guide.
+
+.IP "until spec" 5
+Occurrences will start up to but not after date and time 
+specified.
+.br
+Format: YYYYMMDD[THHMMSS] 
+.br
+Note that the year-month-day section is separated from 
+the hour-minute-second section by a capital T.
+.RE
+.IP " " 8
+Requirements:
+.br
+The recurrence rule must be on one unbroken line and must be enclosed
+in double quotes.  
+
+A start and end date must be used when specifying a recurrence rule.  
+See the 
+.I R
+and
+.I E 
+options.
+
+The PBS_TZID environment variable must be set at the submission host.  The 
+format for PBS_TZID is a timezone location.  Examples: America/Los_Angeles,
+America/Detroit, Europe/Berlin, Asia/Calcutta.  See the
+.B PBS Professional User's Guide.
+
+.B Examples of Standing Reservations
+.br
+For a reservation that runs every day from 8am to 10am, for a total of 10 occurrences:
+.RS 
+.IP " " 3
+pbs_rsub -R 0800 -E 1000 -r "FREQ=DAILY;COUNT=10"
+.LP
+
+Every weekday from 6am to 6pm until December 10 2008
+.IP " " 3
+pbs_rsub -R 0600 -E 1800 
+.br
+-r "FREQ=WEEKLY; BYDAY=MO,TU,WE,TH,FR; UNTIL=20081210"
+.LP
+
+Every week from 3pm to 5pm on Monday, Wednesday, and Friday, for 9 occurrences, 
+i.e., for three weeks:
+.RS 5
+pbs_rsub -R 1500 -E 1700
+.br
+-r "FREQ=WEEKLY;BYDAY=MO,WE,FR; COUNT=3"
+.RE
+.RE
+
+.IP "-R <start time>" 8
+.RS
+.LP
+Specifies reservation starting time. If the reservation's end time 
+and duration are the only times specified, this start time is calculated.
+
+If the day,
+.I DD ,
+is not specified, it defaults to today if the time
+.I hhmm
+is in the future. Otherwise, the day is set to tomorrow.
+For example, if you submit a reservation with the specification 
+.I "-R 1110"
+at 11:15 a.m., it is interpreted as being for 11:10am tomorrow.
+If the month portion,
+.I MM ,
+is not specified, it defaults to the current month, provided that the specified 
+day
+.I DD ,
+is in the future. Otherwise, the month is set to next month. Similar
+rules apply to the two other optional, left-side components.
+.br
+Format: 
+.I Datetime
+.LP
+.RE
+.IP "-u <user list>" 8
+Not used. Comma-separated list of user names.
+.br
+Format: <username>[@<hostname>][,<username>[@<hostname>] ...]
+.br
+Default: None
+.RE
+.IP "-U <auth user list>" 8
+Comma-separated list of users who are and are not allowed to 
+submit jobs to this reservation.  
+This list becomes the 
+.I acl_users 
+attribute for the reservation's queue. 
+More specific entries should be listed before more general, because the
+list is read left-to-right, and the first match determines access. 
+
+If both the
+.I Authorized_Users
+and 
+.I Authorized_Groups
+reservation attributes are set, a user must belong to both in order to be able to 
+submit jobs to this reservation.
+The reservation creator's username is automatically added to this list,
+whether or not the reservation creator specifies this list.
+
+Refer to the 
+.I Authorized_Users
+reservation attribute on the pbs_resv_attributes man page.
+.br
+Format:
+.I [+|-]<username>@<hostname>[,[+|-]<username>@<hostname>...]
+.br
+Default: Job owner only
+.br
+.RE
+.IP "-W attribute value list" 8
+This allows you to define other attributes for the reservation.
+Supported attributes:
+.RS
+.IP "qmove=<job ID>" 5
+Converts a normal job designated by 
+.I job ID
+into a reservation job that will run
+as soon as possible.  Creates the 
+reservation with its queue and moves the job into the reservation's 
+queue.  
+Uses the resources requested by the job to create the reservation.  
+
+When the reservation is created, it inherits its resources from the job, 
+not from the resources requested through the
+.B pbs_rsub
+command.
+
+You can use the 
+.I -I 
+option to specify a timeout for the conversion.  If you use the 
+.B qmove
+option to convert a job to a reservation, and the reservation is not
+confirmed within the timeout period, the reservation is deleted.  The
+default timeout period is 
+.I 10 seconds.
+There is no option for this kind of reservation to be unconfirmed.
+
+To specify the timeout, you must give a negative value for the 
+.I -I 
+option.  For example, to specify a timeout of 300 seconds:
+
+   pbs_rsub -Wqmove=<job ID> -I -300
+
+The 
+.I -R 
+and 
+.I -E 
+options to 
+.B pbs_rsub
+are disabled when using the 
+.I qmove=<job ID>
+attribute.
+
+Some shells require that you enclose a job array ID in double quotes.
+.RE
+
+.IP "--version" 8
+The 
+.B pbs_rsub
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH OUTPUT
+The 
+.B pbs_rsub 
+command returns the reservation identifier.  
+.br
+For an advance reservation, this has the form 
+.IP
+.I R<NNNN>.<server name>
+.LP
+where 
+.I NNNN 
+is a unique integer.  The associated queue's name is the prefix, 
+.I R<NNNN>.
+
+For a standing reservation, this has the form 
+.IP
+.I S<NNNN>.<server name>
+.LP
+where 
+.I NNNN 
+is a unique integer.  The associated queue's name is the prefix, 
+.I S<NNNN>.
+
+.SH FORMATS
+.IP "Datetime format"
+.I "[[[[CC]YY]MM]DD]hhmm[.SS]"
+
+.IP "Reservation name"
+String up to 236 characters in length. It must consist of printable,
+non-white space characters with the first character alphabetic.  The
+first character must be alphabetic, numeric, plus sign, dash or minus,
+or underscor.  The name must not contain special characters.
+
+
+.SH SEE ALSO
+The
+.B PBS Professional User's Guide,
+the
+.B PBS Professional Administrator's Guide,
+.br
+pbs_resv_attributes(7B),
+pbs_rdel(1B),
+pbs_rstat(1B), 
+qmove(1B),
+qsub(1B)	

+ 311 - 0
doc/man1/pbs_sched_attributes.7B

@@ -0,0 +1,311 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_sched_attributes 7B "18 June 2018" Local "PBS Professional"
+.SH NAME
+.B pbs_sched_attributes
+\- attributes of default PBS scheduler and multischeds
+.SH DESCRIPTION
+These are the attributes of the default PBS scheduler and PBS multischeds.
+
+.IP comment 8
+For certain scheduler errors, PBS sets the scheduler's 
+.I comment
+attribute to specific error messages.  You can use the 
+.I comment 
+attribute to notify another administrator of something, but PBS does overwrite
+the value of 
+.I comment 
+under certain circumstances.
+.br
+Format: 
+.I String
+
+.IP do_not_span_psets 8
+Specifies whether or not the scheduler requires the job to fit within
+one existing placement set.
+.br
+When this attribute is 
+.I True, 
+the job must fit in one existing
+placement set.  All existing placement sets are checked.  If the job
+fits in an occupied placement set, the job waits for the placement set
+to be available.  If the job cannot fit within a single placement set,
+it won't run.
+.br
+When this attribute is 
+.I False, 
+the scheduler first attempts to place
+the job in a single placement set, but if it cannot, it allows the job
+to span placement sets, running on whichever vnodes can satisfy the
+job's resource request.
+.br
+Readable by all and settable by the PBS Manager and Operator only.
+.br
+Format: 
+.I Boolean
+.br
+Default: 
+.I False
+
+.IP job_sort_formula_threshold 8
+Lower bound for calculated priority for job.  If job priority is at 
+or below this value, the job is not eligible to run in the current
+scheduler cycle.  Settable by Manager.  
+.br
+Format: 
+.I Float
+.br
+Default: None
+
+.IP only_explicit_psets 8
+Specifies whether placement sets are created for unset resources.  
+.br
+When 
+.I True,
+placement sets are not created from vnodes whose value for a resource is unset.
+.br
+When
+.I False, 
+placement sets are created from vnodes whose value for a resource is unset.
+.br
+Readable by all and settable by the PBS Manager and Operator only.
+.br
+Format: 
+.I Boolean
+.br
+Default:
+.I False
+
+.IP opt_backfill_fuzzy 8
+Sets the tradeoff between scheduling cycle speed and granularity of 
+estimated start time calculation.  
+.br
+Readable by all; settable by Manager.
+.br
+Valid values: 
+.RS 11
+.IP off
+Finest granularity; no speedup.
+.IP low
+Fairly fine granularity; some speedup.
+.IP medium
+Medium granularity; medium speedup.
+.IP high
+Coarse granularity; greatest speedup.
+.RE
+.IP
+.br
+Format: 
+.I String
+.br 
+Default: unset (behaves like 
+.I low
+).
+
+.IP partition 8
+Comma-separated list of partitions for which this scheduler is to run jobs.
+Cannot be set on default scheduler.
+.br
+Format:
+.I String array
+.br
+Default: "None"
+
+.IP pbs_version 8
+The version of PBS for this scheduler.  Readable only by Manager and Operator.
+Not settable.
+
+.IP sched_host 8
+The hostname of the machine on which the scheduler runs. 
+Cannot be set on default scheduler; value for default scheduler is
+server hostname.
+Visible only to the PBS Manager or Operator, and read-only.
+.br
+Format: 
+.I String
+.br
+Default value for multischeds: server's host
+
+.IP scheduler_iteration 8
+Time in seconds between scheduling iterations.  
+.br
+If you set the server's scheduler_iteration attribute, that value is
+assigned to the default scheduler's scheduler_iteration attribute, and
+vice versa.
+.br
+Format: 
+.I Integer seconds
+.br
+Default:
+.I 600
+
+.IP scheduling 8
+Enables scheduling of jobs.  
+.br
+If you set the server's scheduling attribute, that value is
+assigned to the default scheduler's scheduling attribute, and
+vice versa.
+.br
+Format:
+.I Boolean
+.br
+Default value for default scheduler:
+.I True
+.br
+Default value for multischeds: 
+.I False
+
+.IP sched_cycle_length 8
+The scheduler's maximum cycle length.  
+Overwritten by the 
+.I -a
+option to the
+.I pbs_sched
+command.
+.br
+Readable by all and settable by the PBS Manager and Operator only.
+.br
+Format: 
+.I Duration
+ expressed as integer seconds, or 
+.I [[hours:]minutes:]seconds[.milliseconds]
+.br
+Default: 
+.I 20:00 (20 minutes)
+
+.IP sched_host 8
+The hostname of the machine on which this scheduler runs.  
+.br
+Cannot be set on default scheduler; value for default scheduler is server
+hostname.  
+.br
+Must be set by administrator.
+.br
+Format: 
+.I String
+.br
+Default value for multischeds: 
+.I server hostname
+
+.IP sched_log 8
+Directory where this scheduler writes its logs.  Permissions should be
+755.  Must be owned by root.  Cannot be shared with another scheduler.
+Use default value; do not set.
+.br
+Format: 
+.I String
+.br
+Default: 
+.I $PBS_HOME/sched_logs_<scheduler name>
+
+.IP sched_port 8
+Port on which this scheduler listens.  Cannot be set on default scheduler.
+Must be set by administrator.  
+.br
+Format: 
+.I String
+.br
+Default: None
+
+.IP sched_preempt_enforce_resumption 8
+Controls whether the scheduler treats preempted jobs as top jobs.  When 
+.I True
+, these are top jobs.  Readable by all.  Settable by Manager.
+.br 
+Format: 
+.I Boolean
+.br
+Default: 
+.I False
+
+.IP sched_priv 8
+Directory where this scheduler keeps its fairshare usage, resource_group, 
+holidays, and sched_config files. Must be owned by root.  
+Use default value; do not set.
+.br
+Format: 
+.I String
+.br
+Default: 
+.I $PBS_HOME/sched_priv_<scheduler name>
+
+.IP state 8
+State of this scheduler. 
+.br
+Valid values:
+.RS 11
+.IP down
+Scheduler is not running.
+.IP idle
+Scheduler is running and is waiting for a scheduling cycle to be triggered.
+.IP scheduling
+Scheduler is running and is in a scheduling cycle.
+.RE
+.IP 
+Format:
+.I String
+.br
+Default value for default scheduler: 
+.I idle
+.br
+Default value for multischeds:
+.I down
+
+.IP throughput_mode  8
+When 
+.I True, 
+allows scheduler to run faster; it doesn't have to wait for each job
+to be accepted, and doesn't wait for execjob_begin hooks to finish.
+Also when this attribute is 
+.I True, 
+jobs that are changed via qalter, server_dyn_res
+scripts, and peering can run in the same scheduler cycle in which they 
+were changed.
+.br
+Readable by all; settable by Manager and Operator.
+.br
+Format: 
+.I Boolean
+.br
+Default: 
+.I True
+
+.SH SEE ALSO
+The 
+.B PBS Professional Administrator's Guide, 
+The 
+.B PBS Professional User's Guide, 
+qmgr(1B)

文件差异内容过多而无法显示
+ 2185 - 0
doc/man1/pbs_server_attributes.7B


+ 158 - 0
doc/man1/pbsdsh.1B

@@ -0,0 +1,158 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbsdsh 1B "13 October 2017" Local "PBS Professional"
+.SH NAME
+.B pbsdsh 
+\- distribute tasks to vnodes under PBS
+
+.SH SYNOPSIS
+.B pbsdsh 
+[-c <copies>] [-s] [-v] [-o] -- <program> [<program args>]
+.br
+.B pbsdsh 
+[-n <vnode index>] [-s] [-v] [-o] -- <program> [<program args>]
+.br
+.B pbsdsh 
+--version
+
+.SH DESCRIPTION
+The 
+.B pbsdsh
+command allows you to distribute and execute a task on each of the vnodes
+assigned to your job by executing (spawning) the application on each
+vnode.  The 
+.B pbsdsh 
+command uses the PBS Task Manager, or TM, to distribute the program on 
+the allocated vnodes.
+
+When run without the 
+.I -c 
+or the 
+.I -n 
+option, 
+.B pbsdsh 
+will spawn the program
+on all vnodes allocated to the PBS job.  The spawns take place concurrently;
+all execute at (about) the same time.
+
+Note that the double dash must come after the options and before the 
+program and arguments.  The double dash is only required for Linux.
+
+The 
+.B pbsdsh 
+command runs one task for each line in the $PBS_NODEFILE.  Each MPI rank 
+gets a single line in the $PBS_NODEFILE, so if you are running multiple 
+MPI ranks on the same host, you still get multiple 
+.B pbsdsh 
+tasks on that host.
+
+.B Example
+.br
+The following example shows the 
+.B pbsdsh 
+command inside of a PBS batch job. The options indicate that the user wants 
+.B pbsdsh 
+to run the myapp program with one argument (app-arg1) on all four vnodes 
+allocated to the job (i.e. the default behavior).
+
+.RS 5
+#!/bin/sh
+.br
+#PBS -l select=4:ncpus=1
+.br
+#PBS -l walltime=1:00:00
+
+pbsdsh ./myapp app-arg1
+.RE
+
+.SH OPTIONS
+.IP "-c copies"
+The program is spawned 
+.I copies
+times on the vnodes allocated, one per vnode, unless
+.I copies 
+is greater than the number of vnodes.
+If 
+.I copies
+is greater than the number of vnodes, 
+it wraps around, running multiple instances on some vnodes.
+This option is mutually exclusive with 
+.I -n.
+.IP "-n <vnode index>"
+The program is spawned only on a single vnode, which is the 
+.I vnode index -th
+vnode allocated.  This option is mutually exclusive with 
+.I -c.
+.IP -o
+No obit request is made for spawned tasks.  The program does not wait for
+the tasks to finish.
+.IP -s
+Te program is run in turn on each vnode, one after the other.
+.IP -v
+Produces verbose output about error conditions and task exit status.
+
+.IP --version
+The 
+.B pbsdsh
+command returns its PBS version information and exits.
+This option can only be used alone
+
+.SH OPERANDS
+.IP program
+The first operand,
+.I program ,
+is the program to execute.  The double dash must precede the 
+.I program 
+under Linux.
+.LP
+.IP "program args"
+Additional operands,
+.I program args ,
+are passed as arguments to the 
+.I program.
+
+.SH STANDARD ERROR
+The 
+.B pbsdsh 
+command writes a diagnostic message to standard error for
+each error occurrence.
+
+.SH SEE ALSO
+The
+.B PBS Professional User's Guide,
+the
+.B PBS Professional Administrator's Guide,
+qsub(1B), tm(3).

文件差异内容过多而无法显示
+ 1280 - 0
doc/man1/qalter.1B


+ 236 - 0
doc/man1/qdel.1B

@@ -0,0 +1,236 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qdel 1B "30 November 2017" Local "PBS Professional"
+.SH NAME
+.B qdel 
+- delete PBS jobs
+.SH SYNOPSIS
+.B qdel 
+[ -Wforce | -Wsuppress_email=<N>] [-x] <job ID> [<job ID> ...]
+.br
+.B qdel
+--version
+.SH DESCRIPTION
+The 
+.B qdel 
+command deletes jobs in the order given, whether they are at the local
+server or at a remote server.  
+
+.B Usage
+.br
+The qdel command is used without options to delete queued, running,
+held, or suspended jobs, while the
+.I -x  
+option gives it the additional capacity to delete finished or moved
+jobs.  With the
+.I -x 
+option, this command can be used on finished and moved jobs, in
+addition to queued, running, held, or suspended jobs.
+
+When this command is used without the 
+.I -x 
+option, if job history is enabled, the deleted job's history is
+retained.  The 
+.I -x 
+option is used to additionally remove the history of the job being
+deleted.
+
+If someone other than the job's owner deletes the job, mail is
+sent to the job's owner, or to a list of mail recipients if 
+specified during 
+.B qsub.  
+See the 
+.B qsub(1B)
+man page.
+
+If the job is in the process of provisioning,
+it can be deleted only by using the 
+.I -W force
+option.
+
+.B "How Behavior of qdel Command Can Be Affected"
+.br
+The server's 
+.I default_qdel_arguments
+attribute may affect the behavior of the 
+.B qdel 
+command.  This attribute is settable by the administrator 
+via the 
+.B qmgr
+command.  The attribute may be set to "-Wsuppress_email=<N>".
+The server attribute is overridden by command-line arguments.
+See the 
+.B pbs_server_attributes(1B) 
+man page.
+
+.B Sequence of Events
+.IP " " 3
+The job's running processes are killed.
+.IP
+The epilogue runs.
+.IP
+Files that were staged in are staged out.  This includes
+standard out (.o) and standard error (.e) files.
+.IP
+Files that were staged in or out are deleted.
+.IP
+The job's temp directory is removed.
+.IP
+The job is removed from the MOM(s) and the server.
+.LP
+
+.B Required Privilege
+.br
+A PBS job may be deleted by its owner, an Operator, or the
+administrator.  The server deletes a PBS job by sending a 
+.B SIGTERM
+signal, then, if there are remaining processes, a
+.B SIGKILL 
+signal.  
+
+
+.SH OPTIONS
+.IP "(no options)" 8
+Can delete queued, running, held, or suspended jobs.  
+Does not delete job history for specified job(s).
+.IP "-W force" 8
+Deletes the job whether or not the job's execution host is 
+reachable.  Deletes the job whether or not the job is in the
+process of provisioning.  Cannot be used with the 
+.I -Wsuppress_email
+option.
+
+If the server can contact the MoM, this option is ignored; the 
+server allows the job to be deleted normally.  If the server 
+cannot contact the MoM or the job is in the 
+.I E
+state, the server deletes its information about the job.
+
+.IP "-Wsuppress_email=<N>" 8
+Sets limit on number of emails sent when deleting multiple jobs.  
+.RS 11
+If 
+.I N
+>= 1 and 
+.I N 
+or more 
+.I job IDs
+are given, 
+.I N 
+emails are sent.  
+.br
+If 
+.I N
+>=1 and less than 
+.I N job IDs
+are given, the number of emails is
+the same as the number of jobs.  
+.br
+If 
+.I N
+= 0, this option is ignored.  
+.br
+If 
+.I N
+= -1, no email is sent.
+.RE
+.LP
+.IP " " 8
+The 
+.I <N>
+argument is an integer.  Note that there is no space between "W" and "suppress_email".
+Cannot be used with the 
+.I -Wforce
+option.
+.LP
+.IP "-x" 8
+Can delete running, queued, suspended, held, finished, or moved jobs.
+Deletes job history for specified job(s).
+.LP
+.IP "--version" 8
+The 
+.B qdel
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH OPERANDS
+The 
+.B qdel 
+command accepts one or more space-separated
+.I job ID
+operands.  These operands can be job identifiers, job array
+identifiers, subjob dentifiers, or subjob range identifiers.
+
+Job IDs have the form:
+.br
+.I \ \ \ <sequence number>[.<server name>][@<server name>]
+
+Job arrays have the form:
+.br
+.I \ \ \ <sequence number>[][.<server name>][@<server name>]
+
+Subjobs have the form:
+.br
+.I \ \ \ <sequence number>[<index>][.<server name>][@<server name>]
+
+Ranges of subjobs have the form:
+.br
+.I \ \ \  <sequence number>[<first>-<last>][.<server name>][@<server name>]
+
+Job array identifiers must be enclosed in double quotes for some shells.
+
+
+.SH STANDARD ERROR
+The 
+.B qdel 
+command writes a diagnostic message to standard error for each
+error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of input
+
+.IP "Greater than zero" 8
+Upon error
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+pbs_queue_attributes(7B), pbs_server_attributes(1B), 
+qsub(1B), qsig(1B), pbs_deljob(3B)

+ 207 - 0
doc/man1/qhold.1B

@@ -0,0 +1,207 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qhold 1B "30 November 2017" Local "PBS Professional"
+.SH NAME
+.B qhold 
+\- hold PBS batch jobs
+
+
+.SH SYNOPSIS
+.B qhold
+[-h <hold list>] <job ID> [<job ID> ...]
+.br
+.B qhold
+--version
+
+.SH DESCRIPTION
+Places one or more holds on a job.  A job that has a hold is not
+eligible for execution.  Can be used on jobs and job arrays, but not
+on subjobs or ranges of subjobs.
+
+If a job identified by
+.I job ID
+is in the queued, held, or waiting states, then all that occurs is
+that the hold type is added to the job.  The job is then put into the
+held state if it resides in an execution queue.
+
+If the job is running, the result of the 
+.B qhold 
+command depends upon whether the job can be checkpointed.
+The job can be checkpointed if the OS supports checkpointing, or 
+if the application being checkpointed supports checkpointing.  See
+the 
+.I PBS Professional Administrator's Guide.
+If the job can be checkpointed, the following happens:
+.RS 3
+The job is checkpointed and its execution is interrupted.
+
+The resources assigned to the job are released.
+
+The job is placed in the held state in the execution queue.
+
+The job's 
+.I Hold_Types 
+attribute is set to 
+.I u
+for 
+.I user hold.
+.RE
+
+If checkpoint / restart is not supported, 
+.B qhold 
+simply sets the
+job's 
+.I Hold_Types 
+attribute to 
+.I u.  
+The job continues to execute.
+
+A job's dependency places a 
+.I system 
+hold on the job.  When the
+dependency is satisfied, the 
+.I system 
+hold is removed.  This 
+.I system 
+hold
+is the same as the one set by an administrator.  If the administrator
+sets a 
+.I system 
+hold on a job with a dependency, when the
+dependency is satisfied, the job becomes eligible for execution.
+
+If the job is in the process of provisioning, it cannot be held.
+
+A hold on a job can be released by the administrator, a Manager, 
+an Operator, or the job owner, when the job reaches the time set
+in its 
+.I Execution_Time
+attribute, or when a dependency clears.  See 
+.B qrls.1B.
+
+.B Effect of Privilege on Behavior
+.br
+The following table shows the holds and the privilege required to set each:
+.RS 3
+Hold  Meaning       Who Can Set
+.br
+--------------------------------------------------------------
+.IP u 6
+User          Job owner, Operator, Manager, 
+.br
+              administrator, root
+.IP o 6
+Other         Operator, Manager, administrator, root
+.IP s 6
+System        Manager, administrator, root, 
+.br
+              PBS (dependency)
+.IP n 6
+None          Job owner, Operator, Manager, 
+.br
+              administrator, root
+.IP p 6
+Bad password  Administrator, root
+.RE
+.LP
+
+.SH OPTIONS
+.IP "(no options)" 8
+Same as 
+.I -h u.
+Applies the 
+.I user
+hold to the specified job(s).
+.IP "-h <hold list>" 8
+Types of holds to be placed on the job(s).
+
+The
+.I hold list
+argument is a string consisting of one or more of the letters
+.I """u""", """o""", 
+or 
+.I """s"""
+in any combination, or one of the letters
+.I """n""" 
+or 
+.I """p""".
+
+.IP "--version" 8
+The 
+.B qhold
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+
+.SH OPERANDS
+The 
+.B qhold 
+command can be used on jobs and job arrays, but not on subjobs or ranges 
+of subjobs.  The 
+.B qhold 
+comand accepts one or more 
+.I job IDs
+in the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.br
+.I <sequence number>[][.<server name>][@<server name>]
+.RE
+Note that some shells require that you enclose a job array identifier in
+double quotes.
+
+.SH STANDARD ERROR
+The 
+.B qhold 
+command writes a diagnostic message to standard error for each
+error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of all operands
+
+.IP "Greater than zero" 8
+If the 
+.B qhold 
+command fails to process any operand
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+qrls(1B), qalter(1B), qsub(1B), pbs_alterjob(3B), pbs_holdjob(3B),
+pbs_rlsjob(3B), pbs_job_attributes(7B), pbs_resources(7B)

+ 179 - 0
doc/man1/qmove.1B

@@ -0,0 +1,179 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qmove 1B "15 December 2017" Local "PBS Professional"
+.SH NAME
+.B qmove 
+- move PBS batch job
+
+.SH SYNOPSIS
+.B qmove 
+<destination> <job ID> [<job ID> ...]
+.br
+.B qmove
+--version
+
+.SH DESCRIPTION
+Moves a job from one queue to another.  
+
+The behavior of the 
+.B qmove 
+command may be affected by 
+any site hooks.  Site hooks can modify the job's attributes, 
+change its routing, etc.
+
+.B Restrictions
+.br
+The
+.B qmove
+command can be used on job arrays, but not on subjobs or ranges of
+subjobs.  
+
+Job arrays can only be moved from one server to another if
+they are in the 'Q', 'H', or 'W' states, and only if there are no
+running subjobs.  The state of the job array is preserved, and the job
+array will run to completion on the new server.
+.LP
+A job in the
+.B Running ,
+.B Transiting ,
+or
+.B Exiting
+state cannot be moved.  
+
+A job in the process of provisioning cannot 
+be moved.
+
+
+
+.SH EFFECT OF PRIVILEGE ON BEHAVIOR
+
+An unprivileged user can use the 
+.B qmove 
+command to move a job only when
+the move would not violate queue restrictions.  A privileged user
+(root, Manager, Operator) can use the 
+.B qmove 
+command to move a job
+under some circumstances where an unprivileged user cannot.  The
+following restrictions apply only to unprivileged users:
+
+.RS 4
+The queue must be enabled
+
+.br
+Moving the job into the queue must not exceed the queue limits for
+jobs or resources
+
+.br
+If the job is an array job, the size of the job array must not exceed 
+.I max_array_size 
+for the queue
+
+.br 
+The queue cannot have its 
+.I from_route_only
+attribute set to 
+.I True
+(accepting jobs only from routing queues)
+.RE
+
+.SH OPTIONS
+.IP "--version" 4
+The 
+.B qmove
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+
+.SH OPERANDS
+.IP destination 4
+Where job(s) are to end up.  First operand.  Syntax:
+.RS 4
+.I <queue name>
+.RS 4
+Moves the job(s) into the specified queue at the job's current server.
+.RE
+.br
+.I @<server name>
+.RS 4
+Moves the job(s) into the default queue at the specified server.
+.RE
+.br
+.I <queue name>@<server name>
+.RS 4
+Moves the job(s) into the specified queue at the specified server.
+.RE
+.RE
+
+.LP
+.IP "job ID" 4
+Job(s) and/or job array(s) to be moved to the new destination.  The
+.B qmove
+command accepts one or more
+.I job ID
+operands of the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.br
+.I <sequence number>[][.<server name>][@<server name>]
+.RE
+
+Note that some shells require that you enclose a job array identifier 
+in double quotes.
+
+
+.br
+.SH STANDARD ERROR
+The 
+.B qmove 
+command writes a diagnostic messages to standard error for each
+error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 4
+Upon success
+
+.IP "Greater than zero" 4
+Upon failure
+
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qsub(1B), pbs_movejob(3B)

+ 117 - 0
doc/man1/qmsg.1B

@@ -0,0 +1,117 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qmsg 1B "15 December 2017" Local "PBS Professional"
+.SH NAME
+.B qmsg 
+- write message string into one or more job output files
+.SH SYNOPSIS
+.B qmsg
+[-E] [-O] <message string>
+<job ID> [<job ID> ...]
+.br
+.B qmsg
+--version
+
+.SH DESCRIPTION
+Writes a message string into one or more output files of the job.
+Typically this is done to leave an informative message in the output
+of the job.  Also called "sending a message to a job".  
+
+The 
+.B qmsg
+command writes messages into the files of jobs by sending a 
+.I Message Job 
+batch request to the batch server that owns the job.  The 
+.B qmsg
+command does not directly write the message into the files of the job.
+
+The 
+.B qmsg 
+command cannot be used on job arrays, subjobs, or ranges of
+subjobs.
+
+.SH OPTIONS
+.IP "-E" 8
+The message is written to the standard error of each job.
+
+.IP "-O" 8
+The message is written to the standard output of each job.
+
+.IP "--version" 8
+The 
+.B qmsg
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.IP "(no options)" 8
+The message is written to the standard error of each job.
+
+.SH  OPERANDS
+.IP "message string" 8
+The message to be written. String.  First operand.  If the string contains
+blanks, the string must be quoted.  If the final character of the string 
+is not a newline, a newline character is added when written to the job's file.
+
+.IP "job ID" 8
+The job(s) to receive the message string.  This operand follows the 
+.I message string
+operand.  Cannot be a job array, subjob, or range of subjobs.  The 
+.B qmsg 
+command accepts one or more
+.I job ID
+operands of the form:
+.br
+.I <sequence number>[.<server name>][@<server name>]
+
+.SH STANDARD ERROR
+The 
+.B qmsg
+command writes a diagnostic message to standard error for
+each error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon success
+.IP "Greater than zero" 8
+Upon failure
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide, 
+.br
+qsub(1B), pbs_msgjob(3B)

+ 119 - 0
doc/man1/qorder.1B

@@ -0,0 +1,119 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qorder 1B "18 December 2017" Local "PBS Professional"
+.SH NAME
+.B qorder 
+\- exchange order of two PBS batch jobs.
+.SH SYNOPSIS
+.B qorder 
+<job ID> <job ID>
+.br
+.B qorder 
+--version
+.SH DESCRIPTION
+
+Exchanges positions in queue(s) of two jobs, whether in the same or different
+queue(s).
+
+No attribute of either job, e.g. priority, is changed.
+The impact of interchanging the order within or between queues is dependent on local
+job scheduling policy; contact your systems administrator.  
+
+.B Restrictions
+.br
+A job in the
+.B running
+state cannot be reordered.
+.br
+The 
+.B qorder
+command can be used on job arrays, but not on subjobs or ranges of subjobs.
+.br
+The two jobs must be located at the same server.
+
+.B Effect of Privilege on Behavior
+.br
+For an unprivileged user to reorder jobs, both jobs must be owned by
+the user.  A privileged user (Manager, Operator) can reorder any jobs.
+
+.SH OPTIONS
+.IP "--version" 8
+The 
+.B qorder
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH OPERANDS
+Both operands are
+.I job IDs
+which specify the jobs to be exchanged.
+The 
+.B qorder
+command accepts two
+.I job ID
+operands of the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.br
+.I <sequence number>[][.<server name>][@<server name>]
+.RE
+
+If you specify a server for both jobs, they must be at the same server.
+
+Note that some shells require that you enclose a job array identifier in
+double quotes.
+
+.SH STANDARD ERROR
+The 
+.B qorder 
+command writes diagnostic messages to standard error for each
+error occurrence.
+
+.SH EXIT STATUS
+.IP "Zero" 8
+Upon successful processing of all operands
+.IP "Greater than zero" 8
+If the 
+.B qorder 
+command fails to process any operand
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qsub(1B), qmove(1B), pbs_orderjob(3B), pbs_movejob(3B)

+ 136 - 0
doc/man1/qrerun.1B

@@ -0,0 +1,136 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qrerun 1B "18 December 2017" Local "PBS Professional"
+.SH NAME
+.B qrerun 
+- requeue a PBS job
+.SH SYNOPSIS
+.B qrerun 
+[-W force]
+<job ID> [<job ID> ...]
+.br
+.B qrerun 
+--version
+
+.SH DESCRIPTION
+If possible, kills the specified job(s), then requeues each job in the
+execution queue from which it was run. 
+
+The 
+.B qrerun
+command can be used on jobs, job arrays, subjobs, and ranges of subjobs.
+If you give a job array identifier as an argument, the job array is
+returned to its initial state at submission time, or to its altered
+state if it has been qaltered.  All of that job array's subjobs are
+requeued, which includes those that are currently running, and those
+that are completed and deleted. If a you give a subjob or range as an
+argument, those subjobs are requeued.
+
+.B Restrictions
+.br
+If a job is marked as not rerunnable, 
+.B qrerun 
+neither kills nor requeues the job.  See the
+.I -r 
+option for the
+.B qsub 
+and
+.B qalter
+commands, and the 
+.I Rerunable 
+job attribute.
+
+The
+.B qrerun 
+command cannot requeue a job or subjob which is not running, is held, 
+or is suspended.
+
+.B Required Privilege
+.br
+PBS Manager or Operator privilege is required to use this command.
+
+.SH OPTIONS
+.IP "-W force" 8
+The job is to be requeued even if the vnode on which the job is
+executing is unreachable, or if the job's substate is 
+.I provisioning.
+.IP "--version" 8
+The 
+.B qrerun
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+
+.SH  OPERANDS
+The qrerun
+command accepts one or more
+.I job ID
+operands of the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.br
+.I <sequence number>[][.<server name>][@<server name>]
+.br
+.I <sequence number>[<index>][.<server name>][@<server name>]
+.br
+.I <sequence number>[<index start>-<index end>][.<server name>] 
+.br
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [@<server name>]
+.RE
+
+Note that some shells require that you enclose a job array identifier in
+double quotes.
+.br
+
+.SH STANDARD ERROR
+The
+.B qrerun
+command writes a diagnostic message to standard error for
+each error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of all operands
+.IP "Greater than zero" 8
+Upon failure to process any operand
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qsub(1B), qalter(1B), pbs_alterjob(3B), pbs_rerunjob(3B)

+ 166 - 0
doc/man1/qrls.1B

@@ -0,0 +1,166 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qrls 1B "18 December 2017" Local "PBS Professional"
+.SH NAME
+.B qrls 
+- release hold on PBS jobs
+.SH SYNOPSIS
+.B qrls
+[-h <hold list>] <job ID> [<job ID> ...]
+.br
+.B qrls
+--version
+.SH DESCRIPTION
+The
+.B qrls
+command removes or releases holds on batch jobs or job arrays, 
+but not on subjobs or ranges of subjobs.
+
+A job may have one or more types of holds which make the job
+ineligible for execution.
+
+If you 
+.B qrls
+a job whose 
+.I Execution_Time
+attribute is not set to a time in the future, the job changes to the 
+.I queued
+state.  If 
+.I Execution_Time
+is in the future, the job changes to the
+.I waiting
+state.
+
+Holds can be set by the owner, an Operator, or Manager, when a job 
+has a dependency, or when a job has its 
+.I Execution_Time 
+attribute set to a time in the future.  Se the 
+.B qhold
+man page.
+
+.B Effect of Privilege on Behavior
+.br
+The following table shows the holds and the privilege required to release each:
+.RS 3
+Hold  Meaning       Privilege Required to Release
+.br
+--------------------------------------------------------------
+.IP u 6
+User          Job owner, Operator, Manager, 
+.br
+              administrator, root
+.IP o 6
+Other         Operator, Manager, administrator, root
+.IP s 6
+System        Manager, administrator, root, 
+.br
+              PBS (dependency)
+.IP n 6
+None          Job owner, Operator, Manager, 
+.br
+              administrator, root
+.IP p 6
+Bad password  Administrator, root
+.RE
+.LP
+
+.SH OPTIONS
+.IP "(no options)" 8
+Defaults to
+.I -h u,
+removing
+.I user
+hold.
+.IP "-h <hold list>" 8
+Types of holds to be released for the job(s).
+
+The
+.I hold list
+argument is a string consisting of one or more of the letters
+.I """u""", """o""", 
+or 
+.I """s"""
+in any combination, or one of the letters
+.I """n""" 
+or 
+.I """p""".
+
+.IP "--version" 8
+The 
+.B qrls
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH  OPERANDS
+The 
+.B qrls
+command can be used on jobs and job arrays, but not on subjobs or ranges 
+of subjobs.  The 
+.B qrls 
+comand accepts one or more 
+.I job IDs
+in the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.br
+.I <sequence number>[][.<server name>][@<server name>]
+.RE
+Note that some shells require that you enclose a job array identifier in
+double quotes.
+
+.SH STANDARD ERROR
+The 
+.B qrls 
+command writes a diagnostic message to standard error for
+each error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of all operands
+
+.IP "Greater than zero" 8
+If the 
+.B qrls
+command fails to process any operand
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qsub(1B), qalter(1B), qhold(1B), pbs_alterjob(3B), pbs_holdjob(3B), and
+pbs_rlsjob(3B).

+ 534 - 0
doc/man1/qselect.1B

@@ -0,0 +1,534 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qselect 1B "11 January 2018" Local "PBS Professional"
+.SH NAME
+.B qselect 
+- select specified PBS jobs
+.SH SYNOPSIS
+.B qselect
+[-a [<op>] <date and time>] [-A <account string>] 
+.RS 8
+[-c [<op>] <interval>] [-h <hold list>] [-H] [-J] 
+.br
+[-l <resource list>] [-N <name>] [-p [<op>] <priority>] 
+.br
+[-P <project>] [-q <destination>] [-r <rerun>] [-s <states>] 
+.br
+[-t <time option> [<comparison>] <specified time>] [-T] 
+.br
+[-u <user list>] [-x]
+.RE
+.br
+.B qselect
+--version
+
+.SH DESCRIPTION
+The
+.B qselect
+command lists those jobs that meet the specified selection criteria.
+You can compare certain job attribute values to specified values using
+a comparison operator shown as 
+.I op 
+in the option description.
+
+You can select jobs, job arrays, or subjobs.  You can select jobs from
+one server per call to the command.
+
+Each option acts as a filter restricting which jobs are listed.  
+
+You can select jobs according to the values of some of the resources
+in the 
+.I Resource_List 
+job attribute.  You can also select jobs
+according the selection directive (although because this is a string,
+you can only check for equality or inequality.)
+
+Jobs that are finished or moved are listed only when the 
+.I -x 
+or 
+.I -H
+options are used.  Otherwise, job selection is limited to queued and
+running jobs.
+
+.B Comparison Operations
+.br
+You can select jobs by comparing the values of certain job attributes
+to values you specify.  The following table lists the comparison 
+operations you can use:
+
+.B Operation \ \ Type of Comparison
+.br
+-----------------------------------------------------------------------
+.IP .eq. 12
+The value of the attribute of the job is equal to the value of the
+option argument.
+.IP .ne. 12
+The value of the attribute of the job is not equal to the value of the
+option argument.
+.IP .ge. 12
+The value of the attribute of the job is greater than or equal to the
+value of the option argument.
+.IP .gt. 12	
+The value of the attribute of the job is greater than the value of the
+option argument.
+.IP .le. 12
+The value of the attribute of the job is less than or equal to the
+value of the option argument.
+.IP .lt. 12
+The value of the attribute of the job is less than the
+value of the option argument.
+.LP
+
+For example, to select jobs whose 
+.I Priority 
+attribute has a value greater than 
+.I 5:
+.br
+.B \ \ \ qselect -p.gt.5
+
+Where an optional comparison is not specified, the comparison
+operation defaults to 
+.I .eq, 
+meaning PBS checks whether the value of the
+attribute is equal to the option argument.
+
+.B Required Permissions
+.br
+When selecting jobs according to resource values, users without
+Operator or Manager privilege cannot specify custom resources which
+were created to be invisible to unprivileged users.
+
+.SH Options to qselect
+.IP "(no options)" 8
+Lists all jobs at the server which the user is authorized to list
+(query status of).
+
+.IP "-a [<op>] <date and time>" 8
+.B Deprecated.  
+Restricts selection to those jobs whose 
+.I Execution_Time
+attribute qualifies when compared to the 
+.I date and time
+argument.  You can select a range of execution times by using this
+option twice, to compare to a minimum time and a maximum time.
+
+The 
+.I date and time
+argument has the format:
+.br
+.I [[CC]YY]MMDDhhmm[.SS]
+.br
+where the 
+.I MM 
+is the two digits for the month, 
+.I DD 
+is the day of the month, 
+.I hh 
+is the hour, 
+.I mm 
+is the minute, and the optional 
+.I SS 
+is the seconds.  
+.I CC 
+is the century and 
+.I YY 
+the year.
+
+.IP "-A <account string>" 8
+Restricts selection to jobs whose 
+.I Account_Name
+attribute matches the specified
+.I account string.
+
+.IP "-c [<op>] <interval>" 8
+Restricts selection to jobs whose 
+.I Checkpoint
+interval attribute meets the comparison criteria.
+
+The 
+.I interval
+argument can take one of the following values:
+.RS 11
+.I c
+.br
+.I c=<minutes>
+.br
+.I n
+.br
+.I s
+.br
+.I w
+.br
+.I w=<minutes>
+.RE
+.IP " "  8
+We give the range of interval  values for the 
+.I Checkpoint
+attribute the following ordered relationship:
+.br
+.I  n\ >\ s\ >\ c=minutes\ >\ c\ >\ u
+
+(Information about 
+.I w
+and 
+.I w=<minutes>
+is not available.)
+
+For an interval value of 
+"u", only ".eq" and ".ne" are valid.
+
+.IP "-h <hold list>" 8
+Restricts the selection of jobs to those with a specific set of hold types.
+The holds in the 
+.I Hold_Types
+job attribute must be the same as those in the 
+.I hold list
+argument, but can be in a different order.
+
+The
+.I hold list
+argument is a string consisting of the single letter
+.I n,
+or one or more of the letters
+.I u,
+.I o,
+.I p,
+or 
+.I s 
+in any combination.  If letters are duplicated, they are treated as if they
+occurred once.
+The letters represent the hold types:
+
+.B Letter \ \ Hold Type
+.br
+---------------------------------------------------------------
+.nf
+n        None
+u        User
+o        Other
+p        Bad password
+s        System
+.fi
+
+.IP "-H" 8
+Restricts selection to finished and moved jobs.
+
+.IP "-J" 8
+Limits selection to job arrays only.
+
+.IP "-l <resource list>" 8
+Restricts selection of jobs to those with specified resource amounts.
+Resource must be job-wide, or be 
+.I mem, ncpus, 
+or 
+.I vmem.
+
+The 
+.I resource list
+is in the following format:
+.br
+.I <resource name> <op> <value>[,<resource name> <op> <value> ...]
+
+You must specify
+.I op,
+and you can use any of the comparison operators.
+
+Because resource specifications for chunks using the select statement,
+and placement using the place statement, are stored as strings, the
+only useful operators for these are 
+.I .eq.  
+and 
+.I .ne.
+
+Unprivileged users cannot specify custom resources
+which were created to be invisible to unprivileged users.
+
+.IP "-N <name>" 8
+Restricts selection of jobs to those with the specified value for the
+.I Job_Name
+attribute.
+
+.IP "-p [<op>] <priority>" 8
+Restricts selection of jobs to those with the specified 
+.I Priority 
+value(s).
+
+.IP "-P <project>" 8
+Restricts selection of jobs to those matching the specified value for the 
+.I project
+attribute.
+
+Format: 
+.I Project Name;
+see the 
+.I PBS Professional Reference Guide.
+
+.IP "-q <destination>" 8
+Restricts selection to those jobs at the specified 
+.I destination.
+
+The
+.I destination
+may take of one of the following forms:
+.RS 11
+.I <queue name>
+.br
+Restricts selection to the specified queue at the default server.
+.br
+.I @<server name>
+.br
+Restricts selection to the specified server.
+.br
+.I <queue name>@<server name>
+.br
+Restricts selection to the specified queue at the specified server. 
+.RE
+.IP " " 8
+If the -q option is not specified, jobs are selected from the default server.
+
+.IP "-r <rerun>" 8
+Restricts selection of jobs to those with the specified value for the 
+.I Rerunable
+attribute.  The option argument 
+.I rerun
+must be a single character, either
+.I y
+or 
+.I n.
+
+.IP "-s <states>" 8
+Restricts job selection to those whose
+.I job_state
+attribute has the specified value(s).
+
+The
+.I states
+argument is a character string consisting of any combination of these
+characters:
+.I B
+, 
+.I E
+, 
+.I F
+,
+.I H
+,
+.I M
+,
+.I Q
+,
+.I R
+,
+.I S
+,
+.I T
+,
+.I U
+,
+.I W
+, and
+.I X.
+(A repeated character is accepted, but no additional meaning is
+assigned to it.)
+
+.nf
+.B State \ \ Meaning
+---------------------------------------------------------------
+B       Job array has started execution
+E       The Exiting state
+F       The Finished state
+H       The Held state
+M       The Moved state
+Q       The Queued state
+R       The Running state
+S       The Suspended state
+T       The Transiting state
+U       Job suspended due to workstation user activity
+W       The Waiting state
+X       The eXited state.  Subjobs only
+.fi
+
+.IP
+Jobs in any of the specified states are selected.
+
+Job arrays are never in states 
+.I R, S, T, 
+or 
+.I U.  
+Subjobs may be in those states.
+
+.IP "-t <time option> [<op>] <specified time>" 8
+Jobs are selected according to one of their time-based attributes.  The 
+.I time option
+specifies which time-based attribute is tested.  You give the 
+.I specified time
+in 
+.I datetime
+format.  See the 
+.I PBS Professional Reference Guide.
+
+The 
+.I time option 
+is one of the following:
+
+.nf
+.B Time 
+.B Option \ Time Attribute \ Attribute Description
+---------------------------------------------------------------
+a       Execution_Time  Timestamp.  Time the job is eligible 
+                        for execution.  Specified in datetime 
+                        format.
+
+c       ctime           Timestamp; time at which the job was
+                        created.  Printed by qstat in 
+                        human-readable format.  Output in hooks
+                        as seconds since epoch.
+
+e       etime           Timestamp; time when job became 
+                        eligible to run, i.e. was enqueued in 
+                        an execution queue and was in the "Q" 
+                        state.  Reset when a job moves queues, 
+                        or is held then released.  Not affected 
+                        by qaltering.  Printed by qstat in 
+                        human-readable format.  Output in hooks 
+                        as seconds since epoch.
+
+g       eligible_time   Amount of eligible time job accrued 
+                        waiting to run.  Specified as duration.
+
+m       mtime           Timestamp; the time that the job was 
+                        last modified, changed state, or 
+                        changed locations.  Printed by qstat in 
+                        human-readable format.  Output in hooks 
+                        as seconds since epoch.
+
+q       qtime           Timestamp; the time that the job 
+                        entered the current queue.  Printed by 
+                        qstat in human-readable format.  Output 
+                        in hooks as seconds since epoch.
+
+s       stime           Timestamp; time the job started.  
+                        Updated when job is restarted.  Printed 
+                        by qstat in human-readable format.  
+                        Output in hooks as seconds since epoch.
+
+t       estimated.      Job's estimated start time.  Specified 
+        start_time      in datetime format.  Printed by qstat in 
+                        human-readable format.  Output in hooks 
+                        as seconds since epoch.
+.fi
+
+To bracket a time period, use the 
+.I -t
+option twice.
+.br
+For example, to select jobs using 
+.I stime 
+between noon and 3 p.m.:
+.br
+.B \ \ \ qselect -ts.gt.09251200 -ts.lt.09251500
+
+.IP "-T" 8
+Limits selection to jobs and subjobs.
+
+.IP "-u <user list>" 8
+Restricts selection to jobs owned by the specified usernames.
+
+Syntax of
+.I user_list:
+.br
+.I <username>[@<hostname>][,<username>[@<hostname>],...]
+
+Selects jobs which are owned by the listed users at the corresponding hosts. 
+Hostnames may be wildcarded on the left end, e.g. "*.nasa.gov".  A username
+without a "@<hostname>" is equivalent to "<username>@*", meaning that it is 
+valid at any host.
+
+.IP "-x" 8
+Selects finished and moved jobs in addition to queued and running jobs.
+
+.IP "-X" 8
+Selects completed or deleted subjobs (subjobs in 
+.I X 
+state).
+
+.IP "--version" 8
+The 
+.B qselect
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH STANDARD OUTPUT
+PBS writes a list of the selected job IDs to standard output.  Each
+job ID is separated by white space.  A job ID can represent a job, a
+job array, or a subjob.  Each job ID has one of the forms:
+.br
+.I <sequence number>.<server name>[@<server name>]
+.br
+.I <sequence number>[].<server name>[@<server name>]   
+.br
+.I <sequence number>[<index>].<server name>[@<server name>]
+.br
+.I @<server name> 
+identifies the server which currently owns the job.
+
+.SH STANDARD ERROR
+The 
+.B qselect 
+command writes a diagnostic message to standard error for
+each error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of all options presented to the
+.B qselect 
+command
+.IP "Greater than zero" 8
+If the 
+.B qselect 
+command fails to process any option
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qstat(1B),
+qsub(1B), 
+pbs_job_attributes(7B),
+pbs_resources(7B)
+

+ 249 - 0
doc/man1/qsig.1B

@@ -0,0 +1,249 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH qsig 1B "26 December 2017" Local "PBS Professional"
+.SH NAME
+.B qsig 
+\- signal a PBS batch job
+.SH SYNOPSIS
+.B qsig
+[-s <signal>] <job ID> [<job ID> ...]
+.br
+.B qsig
+--version
+
+.SH DESCRIPTION
+The
+.B qsig
+command sends a signal to all the processes of the specified jobs.  
+The 
+.B qsig 
+command sends a 
+.I Signal Job
+batch request to the server which owns the job.
+
+The 
+.B qsig
+command can be used for jobs, job arrays, subjobs, and ranges of subjobs.
+If it is used on a range of subjobs, the running subjobs in the range 
+are signaled.
+
+Not all signal names are recognized by 
+.B qsig
+; if using a signal name does not work, try issuing the signal number instead.
+
+.B Using admin-suspend and admin-resume
+.br
+If you have a vnode requiring maintenance while remaining powered up,
+where you do not want jobs running during the maintenance, you can use
+the special signals 
+.I admin-suspend 
+and 
+.I admin-resume 
+to suspend and resume the jobs on the vnode.  When you use 
+.I admin-suspend 
+on a vnode's
+job(s), the vnode goes into the 
+.I maintenance 
+state, and its scheduler does not schedule jobs on it.  You must separately 
+.I admin-suspend 
+each job on the vnode.  When its last 
+.I admin-suspended 
+job is admin-resumed, a vnode leaves the 
+.I maintenance 
+state.  
+
+.B Restrictions
+.br
+The request to signal a job is rejected if:
+.IP -
+The user is not authorized to signal the job
+.IP -
+The job is not in the 
+.I running
+or 
+.I suspended
+state
+.IP -
+The requested signal is not supported by the system upon which the
+job is executing
+.IP -
+The job is in the process of provisioning
+.IP -
+You attempt to use 
+.I admin-resume 
+on a job that was 
+.I suspend
+ed
+.IP -
+You attempt to use 
+.I resume 
+on a job that was 
+.I admin-suspend
+ed
+.LP
+
+.B Required Privilege
+.br
+Manager or Operator privilege is required to use the 
+.I admin-suspend, admin-resume, suspend, 
+or 
+.I resume
+signals.  Unprivileged users can use other signals.
+
+.SH OPTIONS
+.IP "-s" 8
+PBS sends SIGTERM to the job.
+.IP "-s <signal>" 8
+PBS sends signal
+.I signal
+to the job.
+.IP "--version" 8
+The 
+.B qsig
+command returns its PBS version information and exits.
+This option can only be used alone.
+
+.SH SIGNALS
+You can send standard signals to a job, or the special signals described below.
+The
+.I signal
+argument can be in any of the following formats:
+.RS 4
+A signal name, e.g.
+.I SIGKILL
+
+The signal name without the 
+.I SIG
+prefix, e.g. 
+.I KILL
+
+An unsigned signal number, e.g.
+.I 9
+.RE
+
+The signal name
+.I SIGNULL
+is allowed; in this case the server sends the signal 0 to the job, which 
+has no effect.
+
+.B Special Signals
+.br
+The following special signals are all lower-case, and have no
+associated signal number:
+
+.IP "admin-suspend"
+Suspends a job and puts its vnodes into the 
+.I maintenance 
+state.  The job is put into the 
+.I S 
+state and its processes are suspended.  
+When suspended, a job is not executing and is not charged for
+walltime.
+.br
+Syntax:
+.I qsig -s admin-suspend <job ID>
+
+.IP "admin-resume"
+Resumes a job that was suspended using the 
+.I admin-suspend 
+signal, without waiting for its scheduler.   Cannot be used on jobs that were suspended with 
+.I suspend 
+signal.  
+.br
+Syntax:
+.I qsig -s admin-resume <job ID>
+
+.IP "suspend" 
+Suspends specified job(s).  Job goes into 
+.I suspended (S)
+state.  When suspended, a job is not
+executing and is not charged for walltime.
+
+.IP "resume"
+Marks specified job(s) for resumption by a
+scheduler when there are sufficient resources.  If you use
+.B qsig -s resume 
+on a job that was suspended using 
+.B qsig -s suspend
+, the job is resumed when there are sufficient resources.  Cannot
+be used on jobs that were suspended with 
+.I admin_suspend 
+signal.  
+
+.SH  OPERANDS
+The 
+.B qsig 
+command accepts one or more
+.I job ID
+operands.  For a job, this has the form:
+.RS 4
+.I <sequence number>[.<server name>][@<server name>]
+.RE
+
+For a job array, 
+.I job ID
+takes the form:
+.RS 4
+.I <sequence number>[][.<server name>][@<server name>]
+.RE
+
+Note that some shells require that you enclose a job array identifier in
+double quotes.
+
+.SH STANDARD ERROR
+The 
+.B qsig 
+command writes a diagnostic messages to standard error for
+each error occurrence.
+
+.SH EXIT STATUS
+.IP Zero 8
+Upon successful processing of all the operands presented to the
+.B qsig 
+command
+.IP "Greater than zero" 8
+If the 
+.B qsig 
+command fails to process any operand
+
+.SH SEE ALSO
+The
+.I PBS Professional User's Guide,
+the
+.I PBS Professional Administrator's Guide,
+.br
+qsub(1B), pbs_sigjob(3B),
+pbs_resources(7B)

文件差异内容过多而无法显示
+ 1085 - 0
doc/man1/qstat.1B


文件差异内容过多而无法显示
+ 1632 - 0
doc/man1/qsub.1B


+ 127 - 0
doc/man3/pbs_alterjob.3B

@@ -0,0 +1,127 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_alterjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_alterjob - alter PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B "int pbs_alterjob(\^int connect, char\ *job_id, struct\ attrl\ *attrib, char\ *extend\^)"
+
+.SH DESCRIPTION
+Issue a batch request to alter a batch job.
+.LP
+A
+.I "Modify Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP 
+The argument,
+.I job_id ,
+identifies which job is to be altered.  It is specified in the form:
+.br
+.RS 4
+.I sequence_number.server
+.RE
+.LP
+The parameter,
+.I attrib ,
+is a pointer to an
+.I attrl
+structure which is defined in pbs_ifl.h as:
+.sp
+.Ty
+.nf
+    struct attrl {
+        char *name;
+        char *resource;
+        char *value
+        struct attrl *next;
+    };
+.fi
+The 
+.I attrib
+list is terminated by the first entry where
+.I next
+is a null pointer.
+.LP
+The
+.I name
+member points to a string which is the name of the attribute.  The
+.I value
+member points to a string which is the value of the attribute.
+The attribute names are defined in pbs_ifl.h.
+.br
+
+.LP
+If
+.I attrib
+itself is a null pointer, then no attributes are altered.
+.LP
+Associated with an attribute of type ATTR_l (the letter ell)
+is a resource name indicated by
+.I resource 
+in the
+.I attrl
+structure.
+All other attribute types should have a pointer to a null string ("") for
+.I resource .
+.LP
+If the resource of the specified resource name is already present in the job's
+.I Resource_List
+attribute, it will be altered to the specified value.  If the resource
+is not present in the attribute, it is added.
+.LP
+Certain attributes of a job may or may not be alterable depending on
+the state of the job;  see \f3qalter\f1(1B).
+.sp
+.LP
+The parameter,
+.I extend ,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qalter(1B), qhold(1B), qrls(1B), qsub(1B), pbs_connect(3B), pbs_holdjob(3B),
+and pbs_rlsjob(3B)
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_alterjob\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 124 - 0
doc/man3/pbs_connect.3B

@@ -0,0 +1,124 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_connect 3B "18 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_connect - connect to a PBS batch server
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_connect(\^char *server\^)
+.RS 6
+extern char *pbs_server;
+.RE
+.SH DESCRIPTION
+A virtual stream (TCP/IP) connection is established with the server
+specified by
+.I server.
+.LP
+This function must be called before any of the other 
+.B pbs_
+functions.
+They will transmit their batch requests over the connection established
+by this function.
+Multiple requests may be issued over the connection before it is closed.
+.LP
+The connection should be closed by a call to \f3pbs_disconnect\f1()
+when all requests have been sent to the server.
+.LP
+The parameter called 
+.I "server"
+is of the form:
+.RS 4
+.I host_name[:port].
+.RE
+If 
+.I port
+is not specified, the standard PBS port number will be used.
+.LP
+If the parameter,
+.I server,
+is either the null string or a null pointer,
+a connection will be opened to the default server.
+The default server is defined
+by (a) the setting of the environment
+variable
+.B PBS_DEFAULT
+which contains a destination, or (b) by adding the parameter
+.B PBS_SERVER
+to the global configuration file /etc/pbs.conf.
+.LP
+The variable
+.I pbs_server,
+declared in pbs_ifl.h,
+is set on return to point to the server
+name to which pbs_connect() connected or attempted to connect.
+
+.B pbs_connect()
+determines whether or not the complex has a failover server configured.
+It also determines which server is the primary and which is the secondary.
+.B pbs_connect() 
+is called by client commands, and directs traffic to the correct server.
+
+In order to use 
+.B pbs_connect 
+with Windows, initialize the network
+library and link with 
+.B winsock2.  
+To do this, call 
+.B winsock_init() 
+before calling 
+.B pbs_connect(), 
+and link against the 
+.B ws2_32.lib 
+library.
+
+.SH SEE ALSO
+qsub(1B),
+pbs_alterjob(3B), pbs_deljob(3B), pbs_disconnect(3B), pbs_geterrmsg(3B), 
+pbs_holdjob(3B), pbs_locjob(3B), pbs_manager(3B), pbs_movejob(3B), 
+pbs_msgjob(3B), pbs_rerunjob(3B), pbs_rlsjob(3B), pbs_runjob(3B),
+pbs_selectjob(3B), pbs_selstat(3B), pbs_sigjob(3B), pbs_statjob(3B), 
+pbs_statque(3B), pbs_statserver(3B), pbs_submit(3B), pbs_terminate(3B),
+pbs_server(8B),
+and the PBS Professional Programmer's Guide
+.SH DIAGNOSTICS
+When the connection to batch server
+has been successfully created, the routine will return a connection
+identifier which is positive.
+Otherwise, a negative value is returned.  The error number is set
+in pbs_errno.

+ 67 - 0
doc/man3/pbs_default.3B

@@ -0,0 +1,67 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_default 3B "August 2011" Local "PBS Professional"
+.SH NAME
+.B pbs_default 
+- return the name of the default PBS server
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B char *pbs_default()
+
+.SH DESCRIPTION
+A character string is returned containing the name of the default
+PBS server.
+The default server is defined
+by (a) the setting of the environment
+variable
+.B PBS_DEFAULT
+which contains a destination, or (b) by adding the parameter
+.B PBS_SERVER
+to the global configuration file /etc/pbs.conf.
+
+.SH DIAGNOSTICS
+If the default server cannot be determined, a NULL value is
+returned.
+
+.SH SEE ALSO
+qsub(1B),
+pbs_connect(3B), pbs_disconnect(3B),
+and the 
+.B PBS Professional Programmer's Guide
+

+ 87 - 0
doc/man3/pbs_deljob.3B

@@ -0,0 +1,87 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+
+.TH pbs_deljob 3B "26 August 2011" Local "PBS Professional"
+.SH NAME
+.B pbs_deljob 
+- delete a PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_deljob\^(\^int\ connect, char\ *job_id, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to delete a batch job.
+If the batch job is running, the execution server will send the
+.B SIGTERM
+signal followed by
+.B SIGKILL .
+.LP
+A 
+.I "Delete Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of 
+.B pbs_connect().
+.LP
+The argument,
+.I job_id ,
+identifies which job is to be deleted.  It is specified in the form:
+.br
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The argument, 
+.I extend ,
+is overloaded to serve more than one purpose.
+If 
+.I extend
+points to a string other than the above, it is taken as text to be appended
+to the message mailed to the job owner.   This mailing occurs if the
+job is deleted by a user other than the job owner.
+.SH "SEE ALSO"
+qdel(1B) and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by the 
+.B pbs_deljob()
+function has been completed successfully
+by a batch server, the routine will return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 77 - 0
doc/man3/pbs_delresv.3B

@@ -0,0 +1,77 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_delresv 3B "26 August 2011" Local "PBS Professional"
+.SH NAME
+pbs_delresv - delete a reservation 
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_delresv\^(\^int\ connect, char\ *resv_id, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to delete a reservation.
+If the reservation is in state RESV_RUNNING, and there are jobs remaining in 
+the reservation queue, the jobs will be deleted before the reservation is 
+deleted.
+.LP
+A 
+.I "Delete Reservation"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The argument,
+.I resv_id ,
+identifies which reservation is to be deleted, it is specified in the form:
+.RS 4
+.I "R<sequence_number>.<server>"
+.RE
+.LP
+The argument, 
+.I extend 
+is currently unused.
+.LP
+.SH "SEE ALSO"
+pbs_rdel(1B) and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by the \f3pbs_delresv\f1()
+function has been completed successfully
+by a batch server, the routine will return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 58 - 0
doc/man3/pbs_disconnect.3B

@@ -0,0 +1,58 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_disconnect 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_disconnect - disconnect from a PBS batch server
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_disconnect(int connect)
+
+.SH DESCRIPTION
+The virtual stream connection specified by
+.I connect ,
+which was established with a server
+by a call to \f3pbs_connect\f1(),
+is closed.
+.SH SEE ALSO
+pbs_connect(3B)
+.SH DIAGNOSTICS
+When the connection to batch server
+has been successfully closed, the routine will return zero.
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 61 - 0
doc/man3/pbs_geterrmsg.3B

@@ -0,0 +1,61 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_geterrmsg 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_geterrmsg - get error message for last PBS batch operation
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B char *pbs_geterrmsg(int connect)
+
+.SH DESCRIPTION
+Return the error message text associated with a batch server
+request.
+.LP
+If the preceding batch interface library call over the connection specified by 
+.I connect
+resulted in an error return from the server,
+there may be an associated text message.  If it exists, this function
+will return a pointer to the null terminated text string.
+.SH SEE ALSO
+pbs_connect(3B)
+.SH DIAGNOSTICS
+If an error text message was returned by a server in reply to the previous
+call to a batch interface library function, \f3pbs_geterrmsg\f1()
+will return a pointer to it.
+Otherwise, pbs_geterrmsg() returns the null pointer.

+ 85 - 0
doc/man3/pbs_holdjob.3B

@@ -0,0 +1,85 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_holdjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_holdjob - place a hold on a PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+
+.B int pbs_holdjob(\^int\ connect, char\ *job_id, char\ *hold_type, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to place a hold upon a job.
+.LP
+A 
+.I "Hold Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The argument, 
+.I job_id ,
+identifies which job is to be held, it is specified in the form:
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The parameter, 
+.I hold_type ,
+contains the type of hold to be applied.  The possible values are
+defined in pbs_ifl.h.
+.LP
+If
+.I hold_type
+is either a null pointer or points to a null string, USER_HOLD
+will be applied.
+.LP
+The parameter,
+.I extend ,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qhold(1B), pbs_connect(3B), pbs_alterjob(3B), and pbs_rlsjob(3B)
+.SH DIAGNOSTICS
+When the batch request generated by 
+.B pbs_holdjob ()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 85 - 0
doc/man3/pbs_locjob.3B

@@ -0,0 +1,85 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_locjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_locjob - locate current location of a PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B char *pbs_locjob\^(\^int connect, char\ *job_id, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to locate a batch job.
+If the server currently manages the batch job, or knows which server does
+currently manage the job, it will reply with the location of the job.
+.LP
+A 
+.I "Locate Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The argument,
+.I job_id ,
+identifies which job is to be located, it is specified in the form:
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The argument,
+.I extend ,
+is reserved for implementation-defined extensions.  It is not currently 
+used by this function.
+.LP
+The return value is a pointer to a character sting which contains the
+current location if known.
+The syntax of the location string is:
+.RS 4
+.I "server_name" 
+.RE
+If the location of the job is not known, the return value is the NULL pointer.
+.SH "SEE ALSO"
+qsub(1B) and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by the \f3pbs_locjob\f1()
+function has been completed successfully
+by a batch server, the routine will return a non null pointer to the
+destination.
+Otherwise, a null pointer is returned.  The error number is set in pbs_errno.
+\" turn off any extra indent left by the Sh macro

+ 198 - 0
doc/man3/pbs_manager.3B

@@ -0,0 +1,198 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_manager 3B "13 Sept 2011" Local "PBS Professional"
+.SH NAME
+.B pbs_manager 
+\- modifies a PBS batch object
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_manager(\^int\ connect, int\ command, int\ obj_type, char\ *obj_name, 
+.B struct\ attropl\ *attrib, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to perform administration functions at a server.
+With this request, server objects such as queues can
+be created and deleted, and have their attributes set and unset.
+.LP
+A
+.I "Manage"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+This request requires full batch administrator privilege.
+.LP
+The parameter,
+.I command ,
+specifies the operation to be performed.  See pbs_ifl.h:
+.br
+
+.IP " " 4
+.B    MGR_CMD_CREATE \ \  
+creates the object
+.br
+.B    MGR_CMD_DELETE \ \ 
+deletes the object
+.br
+.B    MGR_CMD_SET \ \ \ \ \  
+sets the value
+.br
+.B    MGR_CMD_UNSET\ \ \ \ 
+unsets the value
+.br
+.B    MGR_CMD_IMPORT \ \ 
+imports the hook
+.br
+.B    MGR_CMD_EXPORT \ \ 
+exports the hook
+.LP
+
+
+The parameter,
+.I obj_type ,
+declares the type of object upon which the command operates.  See pbs_ifl.h:
+.br
+.IP " " 4
+.B MGR_OBJ_SERVER  \ \ 
+Server object
+.br
+.B MGR_OBJ_QUEUE   \ \ \ 
+Queue object
+.br
+.B MGR_OBJ_NODE   \ \ \ \ 
+Node object
+.br
+.B MGR_OBJ_HOOK   \ \ \ \ 
+Hook object
+.LP
+The parameter,
+.I obj_name ,
+is the name of the specific object.
+.LP
+The parameter,
+.I attrib ,
+is a pointer to an
+.I attropl
+structure which is defined in pbs_ifl.h as:
+.sp
+.Ty
+.nf
+    struct attropl {
+        char   *name;
+        char   *resource;
+        char   *value;
+        enum batch_op op;
+        struct attropl *next;
+    };
+.fi
+.sp
+The
+.I attrib
+list is terminated by the first entry where
+.I next
+is a null pointer.
+.LP
+The
+.I name
+member points to a string which is the name of the attribute.
+.LP
+If the attribute is one which contains a set of resources, the
+specific resource is specified in the structure member
+.I resource .
+Otherwise, the member resource is pointer to a null string.
+.LP
+The
+.I value
+member points to a string which is the new value of the attribute.
+For parameterized limit attributes, this string contains
+all parameters for the attribute.
+.LP
+The 
+.I op
+member defines the manner in which the new value is assigned to the
+attribute.
+The operators are:
+.B "enum batch_op { ..., SET, UNSET, INCR, DECR };"
+.br
+.LP
+
+For MGR_CMD_IMPORT, specify attropl "name" as "content-type", 
+"content-encoding", and "input-file" along with the corresponding 
+"value" and an "op" of SET.
+
+For MGR_CMD_EXPORT, specify attropl "name" as "content-type", 
+"content-encoding", and "output-file" along with the corresponding 
+"value" and an "op" of SET.
+
+The parameter
+.I extend
+is reserved for implementation-defined extensions.
+.LP
+Privilege required for functions depends on whether those functions
+are used with hooks.
+.br
+When not used with hooks:
+.IP
+Functions MGR_CMD_CREATE and MGR_CMD_DELETE require PBS Manager privilege.
+.br
+Functions MGR_CMD_SET and MGR_CMD_UNSET require PBS Manager or Operator privilege.
+.LP
+When used with hooks:
+.IP
+All commands require root privilege on the server host.
+.LP
+Functions MGR_CMD_IMPORT, MGR_CMD_EXPORT, and MGR_OBJ_HOOK are used only with hooks, 
+and therefore require root privilege on the server host.
+
+
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_manager\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.
+
+.SH SEE ALSO
+The 
+.B PBS Professional Programmer's Guide,
+.br
+qmgr(1B), 
+pbs_connect(3B)
+
+

+ 136 - 0
doc/man3/pbs_modify_resv.3B

@@ -0,0 +1,136 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_modify_resv 3B "20 February 2018" Local "PBS Professional"
+.SH NAME
+pbs_modify_resv - modify a PBS reservation
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B char *pbs_modify_resv(int server_connect, char *resv_id, struct attropl *attrib, char *extend)
+
+.SH DESCRIPTION
+Issue a batch request to modify a reservation.
+.LP
+A
+.I "Modify Reservation"
+batch request is generated and sent to the server.
+The parameter
+.I server_connect 
+is the socket on which we connect to the server.
+The parameter 
+.I resv_id
+is the reservation ID.
+.LP
+The parameter
+.I attrib
+is a list of attributes to be changed.
+Each attribute is an 
+.I attropl
+structure which is defined in pbs_ifl.h as:
+.sp
+.Ty
+.nf
+    struct attrl {
+        char   *name;
+        char   *resource;
+        char   *value;
+        struct attrl *next;
+        enum batch_op op;
+    };
+.fi
+.sp
+The
+.I attrib
+list is terminated by the first entry where
+.I next
+is a null pointer.
+.LP
+The
+.I name
+member points to a string which is the name of the attribute.  The
+.I value
+member points to a string which is the value of the attribute.
+The attribute names are defined in pbs_ifl.h.
+.LP
+If an attribute is not named in the
+.I attrib
+array, the default action is taken.  It is either assigned
+the default value or is not passed with the reservation.  The action
+depends on the attribute.
+If
+.I attrib
+itself is a null pointer, then the default action is taken for
+each attribute.
+.LP
+An attribute of type ATTR_l (the letter ell) has 
+a resource name indicated by
+.I resource 
+in the
+.I attrl
+structure.
+All other attribute types should have a pointer to a null string for
+.I resource.
+.LP
+The
+.I op
+member is forced to a value of 
+.I SET
+by pbs_modify_resv().
+.LP
+The parameter,
+.I extend,
+is reserved for implementation-defined extensions.
+.LP
+The return value is a character string which is the
+.I reservation identifier
+assigned to the job by the server.
+The space for the 
+.I reservation identifier
+string is allocated by \f3pbs_modify_resv\f1()
+and should be released via a call to \f3free\f1()
+by the user when no longer needed.
+
+.SH "SEE ALSO"
+pbs_rsub(1B) and pbs_connect(3B)
+
+.SH DIAGNOSTICS
+When the batch request generated by pbs_modify_resv()
+function has been completed successfully by a batch server, the routine will
+return a pointer to a character string which is the reservation identifier of the
+modified reservation.
+Otherwise, a null pointer is returned and the error code is set in pbs_error.

+ 102 - 0
doc/man3/pbs_movejob.3B

@@ -0,0 +1,102 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_movejob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_movejob - move a PBS batch job to a new destination
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_movejob(\^int\ connect, char\ *job_id, char\ *destination, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to move a job to a new destination.
+The job is removed from the present queue and instantiated in a new
+queue.
+.LP
+A
+.I "Move Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The 
+.I job_id
+parameter identifies which job is to be moved; it is specified in the form:
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The
+.I destination
+parameter specifies the new destination for the job.  It is specified as:
+.RS 4
+.I [queue][@server] .
+.RE
+If
+.I destination
+is a null pointer or a null string,
+the destination will be the default queue at the current server.  If
+.I destination
+specifies a queue but not a server, the destination will be the named queue
+at the current server.  If
+.I destination
+specifies a server but not a queue, the destination will be
+the default queue at the named server.  If
+.I destination
+specifies both a queue and a server, the destination is that queue at that 
+server.
+.LP
+A job in the
+.B Running ,
+.B Transiting ,
+or
+.B Exiting
+state cannot be moved.
+.LP
+The parameter,
+.I extend ,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qmove(1B), qsub(1B), and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_movejob\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 84 - 0
doc/man3/pbs_msgjob.3B

@@ -0,0 +1,84 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_msgjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_msgjob - record a message for a running PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_msgjob(\^int\ connect, char\ *job_id, int\ file, char\ *message, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to write a message in an output file of a batch job.
+.LP
+A
+.I "Message Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The argument,
+.I job_id ,
+identifies the job to which  the message is to be sent;
+it is specified in the form:
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The parameter,
+.I file ,
+indicates the file or files to which the message string is to be written.
+See pbs_ifl.h for acceptable values.
+
+.LP
+The parameter,
+.I message ,
+is the message string to be written.
+.LP
+The parameter,
+.I extend ,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qmsg(1B) and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_msgjob\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 75 - 0
doc/man3/pbs_orderjob.3B

@@ -0,0 +1,75 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_orderjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_orderjob - reorder PBS batch jobs in a queue
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_orderjob(\^int\ connect, char\ *job_id1, char\ *job_id2, char\ *extend\^)
+
+.SH DESCRIPTION
+Issue a batch request to swap the order of two jobs with in a single queue.
+.LP
+An
+.I "Order Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The parameters
+.I job_id1
+and
+.I job_id2
+identify which jobs are to be swapped.  They are specified in the form:
+.RS 4
+.I "sequence_number.server" 
+.RE
+.LP
+The parameter,
+.I extend
+, is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qorder(1B), qmove(1B), qsub(1M), and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_orderjob\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 85 - 0
doc/man3/pbs_relnodesjob.3B

@@ -0,0 +1,85 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_relnodesjob 3B "6 November 2017" Local "PBS Professional"
+.SH NAME
+.B pbs_relnodesjob 
+- release some or all of the non-primary-execution-host vnodes assigned to a PBS job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_relnodesjob (int connect, char *job_id, char *node_list, char *extend)
+
+.SH DESCRIPTION
+Issue a batch request to release some or all of the vnodes not on the primary 
+execution host that are assigned to a batch job.
+.LP
+A
+.I "RelnodesJob"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect, 
+which is the return value of \f3pbs_connect\f1().
+.LP
+The argument,
+.I job_id,
+identifies the job whose vnodes are to be released;
+it is specified in the form:
+.RS 4
+.I "<sequence number>.<server>"
+.RE
+.LP
+The parameter,
+.I node_list,
+is a list of vnode names separated by plus signs ("+") whose parent MoM is not the
+MoM on the primary execution host.  If 
+.I node_list
+is NULL, it refers to all the vnodes that are not on the primary
+execution host that are assigned to the job.
+
+The parameter,
+.I extend,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+pbs_connect(3B)
+.SH DIAGNOSTICS
+When the 
+.B pbs_relnodesjob() 
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non-zero error is returned.  The error number is also set
+in pbs_errno.

+ 76 - 0
doc/man3/pbs_rerunjob.3B

@@ -0,0 +1,76 @@
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.TH pbs_rerunjob 3B "3 March 2015" Local "PBS Professional"
+.SH NAME
+pbs_rerunjob - rerun a PBS batch job
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.B int pbs_rerunjob(\^int\ connect, char\ *job_id,\ char\ *extend)
+
+.SH DESCRIPTION
+Issue a batch request to rerun a batch job.
+.LP
+A
+.I "Rerun Job"
+batch request is generated and sent to the server over the connection
+specified by
+.I connect 
+which is the return value of \f3pbs_connect\f1().
+.LP
+If the job is marked as being not rerunnable, the request will fail and
+an error will be returned.
+.LP
+The argument,
+.I job_id ,
+identifies which job is to be rerun it is specified in the form:
+.RS 4
+.I "sequence_number.server"
+.RE
+.LP
+The parameter,
+.I extend ,
+is reserved for implementation-defined extensions.
+.SH "SEE ALSO"
+qrerun(1B), qsub(1B), and pbs_connect(3B)
+.SH DIAGNOSTICS
+When the batch request generated by \f3pbs_rerunjob\f1()
+function has been completed successfully by a batch server, the routine will
+return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.

+ 244 - 0
doc/man3/pbs_rescquery.3B

@@ -0,0 +1,244 @@
+.\"
+.\" Copyright (C) 1994-2018 Altair Engineering, Inc.
+.\" For more information, contact Altair at www.altair.com.
+.\"
+.\" This file is part of the PBS Professional ("PBS Pro") software.
+.\"
+.\" Open Source License Information:
+.\"
+.\" PBS Pro is free software. You can redistribute it and/or modify it under the
+.\" terms of the GNU Affero General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or (at your option) any
+.\" later version.
+.\"
+.\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+.\" FOR A PARTICULAR PURPOSE.
+.\" See the GNU Affero General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Affero General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Commercial License Information:
+.\"
+.\" For a copy of the commercial license terms and conditions,
+.\" go to: (http://www.pbspro.com/UserArea/agreement.html)
+.\" or contact the Altair Legal Department.
+.\"
+.\" Altair’s dual-license business model allows companies, individuals, and
+.\" organizations to create proprietary derivative works of PBS Pro and
+.\" distribute them - whether embedded or bundled with other software -
+.\" under a commercial license agreement.
+.\"
+.\" Use of Altair’s trademarks, including but not limited to "PBS™",
+.\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
+.\" trademark licensing policies.
+.\"
+.if \n(Pb .ig Ig
+.TH pbs_rescquery 3B "1 Oct 2009" Local "PBS Professional"
+.\" The following macros are style for object names and values.
+.de Ar		\" command/function arguments and operands (italic)
+.ft 2
+.if \\n(.$>0 \&\\$1\f1\\$2
+..
+.de Av		\" data item values  (Helv)
+.if  \n(Pb .ft 6
+.if !\n(Pb .ft 3
+.ps -1
+.if \\n(.$>0 \&\\$1\s+1\f1\\$2
+..
+.de At		\" attribute and data item names (Helv Bold)
+.if  \n(Pb .ft 6
+.if !\n(Pb .ft 2
+.ps -1
+.if \\n(.$>0 \&\\$1\s+1\f1\\$2
+..
+.de Ty		\" Type-ins and examples (typewriter)
+.if  \n(Pb .ft 5
+.if !\n(Pb .ft 3
+.if \\n(.$>0 \&\\$1\f1\\$2
+..
+.de Er		\" Error values ( [Helv] )
+.if  \n(Pb .ft 6
+.if !\n(Pb .ft 3
+\&\s-1[\^\\$1\^]\s+1\f1\\$2
+..
+.de Sc		\" Symbolic constants ( {Helv} )
+.if  \n(Pb .ft 6
+.if !\n(Pb .ft 3
+\&\s-1{\^\\$1\^}\s+1\f1\\$2
+..
+.de Al		\" Attribute list item, like .IP but set font and size
+.if !\n(Pb .ig Ig
+.ft 6
+.IP "\&\s-1\\$1\s+1\f1"
+.Ig
+.if  \n(Pb .ig Ig
+.ft 2
+.IP "\&\\$1\s+1\f1"
+.Ig
+..
+.\" the following pair of macros are used to bracket sections of code
+.de Cs
+.ft 5
+.nf
+..
+.de Ce
+.sp
+.fi
+.ft 1
+..
+.\" End of macros 
+.Ig
+.SH NAME
+pbs_rescquery, avail, totpool, usepool - query resource availability
+.SH SYNOPSIS
+#include <pbs_error.h>
+.br
+#include <pbs_ifl.h>
+.sp
+.ft 3
+.nf
+int pbs_rescquery\^(\^int\ connect, char\ **resourcelist, int *arraysize,
+int *available, int *allocated, int *reserved, int *down \^)
+.sp
+char *avail\^(\^int connect, char *resc\^)
+.sp
+int totpool\^(\^int connect, int update\^)
+.sp
+int usepool\^(\^int connect, int update\^)
+.fi
+.ft 1
+.SH DESCRIPTION
+.if \n(Pb .ig Ig
+.HP 2
+.Ig
+.if !\n(Pb .ig Ig
+.sp
+.Ig
+.B pbs_rescquery
+.br
+Issue a request to the batch server to query the availability of resources.
+.Ar connect
+is the connection returned by \f3pbs_connect\fP().
+.Ar resourcelist 
+is an array of one or more strings specifying the resources to be queried.
+.Ar arraysize
+is the is the number of strings in resourcelist.
+.Ar available ,
+.Ar allocated ,
+.Ar reserved ,
+and
+.Ar down
+are integer arrays of size arraysize.  The amount of resource specified in
+the corresponding resourcelist string which is available, already allocated,
+reserved, and down/off-line is returned in the integer arrays.
+.IP
+At the present time the only resources which may be specified is "nodes". 
+It may be specified as 
+.br
+.Ty \ \ \ \ nodes
+.br
+.Ty \ \ \ \ nodes= 
+.br
+.Ty \ \ \ \ nodes=\f2specification\f1
+.br
+where specification is what a user specifies in the -l option argument list
+for nodes.  See the qsub(1B) and pbs_resources(7B) man pages.
+.IP
+Where the node resourcelist is a simple type, such as "nodes", "nodes=",
+or "nodes=\f2type\fP", the numbers returned reflect the actual number of nodes
+(of the specified type) which are \f2available\fP, \f2allocated\fP,
+\f2reserved\fP, or \f2down\fP.
+.IP
+For a more complex node resourcelist, such as
+"nodes=2" or "nodes=type1:type2", only the value returned in 
+.I available
+has meaning.
+If the number in
+.I available
+is positive, it is the number of nodes required to satisfy the specification
+and that some set of nodes are available which will satisfy it, see 
+.I avail ().
+If the number in
+.I available
+is zero, some number of nodes required for the specification are
+currently unavailable, the request might be satisfied at a later time.
+If the number in
+.I available
+is negative, no combination of known nodes can fulfill the specification.
+.if \n(Pb .ig Ig
+.HP 2
+.Ig
+.if !\n(Pb .ig Ig
+.sp
+.Ig
+.B avail
+.br
+The
+.I avail ()
+call is provided as a conversion aid for schedulers written for early versions
+of PBS.   The avail() routine uses pbs_rescquery() and returns a character
+string answer.  
+.Ar connect
+is the connection returned by \f3pbs_connect\fP().
+.Ar resc
+is a single 
+.I node=specification
+specification as discussed above.  If the nodes to satisfy the specification
+are currently available, the return value is the character string
+.B yes .
+If the nodes are currently unavailable, the return is the character string
+.B no .
+If the specification could never be satisfied, the return is the string
+.B never .
+An error in the specification returns the character string
+.B ? .
+.if \n(Pb .ig Ig
+.HP 2
+.Ig
+.if !\n(Pb .ig Ig
+.sp
+.Ig
+.B totpool
+.br
+The 
+.I totpool ()
+function returns the total number of nodes known to the PBS server.  This is
+the sum of the number of nodes available, allocated, reserved, and down.
+The parameter
+.Ar connection
+is the connection returned by pbs_connect().
+The parameter
+.Ar update
+if non-zero, causes totpool() to issue a pbs_rescquery() call to obtain
+fresh information.   If zero, numbers from the prior pbs_rescquery() are used.
+.if \n(Pb .ig Ig
+.HP 2
+.Ig
+.if !\n(Pb .ig Ig
+.sp
+.Ig
+.B usepool
+.br
+.I usepool ()
+returns the number of nodes currently in use, the sum of allocated, reserved, 
+and down.
+The parameter
+.Ar connection
+is the connection returned by pbs_connect().
+The parameter
+.Ar update
+if non-zero, causes totpool() to issue a pbs_rescquery() call to obtain
+fresh information.   If zero, numbers from the prior pbs_rescquery() are used.
+.SH "SEE ALSO"
+qsub(1B), pbs_connect(3B), pbs_disconnect(3B), pbs_rescreserve(3B) and
+pbs_resources(7B)
+.SH DIAGNOSTICS
+When the batch request generated by the \f3pbs_rescquery\f1()
+function has been completed successfully
+by a batch server, the routine will return 0 (zero).
+Otherwise, a non zero error is returned.  The error number is also set
+in pbs_errno.
+.LP
+The functions usepool() and totpool() return -1 on error.

+ 0 - 0
doc/man3/pbs_rescreserve.3B


部分文件因为文件数量过多而无法显示