李佳儒
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # PBS ## [pbs絕對正確的教學,保證一看就會,手把手教學](https://memes.tw/user-gif/a2cc82a36c9dd92e62a356de9d17901d.gif) ## 介紹 PBS為cluster job調節系統-> 目前有三個分支: openPBS、PBS pro、Torque 基本須知:PBS只做工作調節而已,所以必須在所有環境已經設置的情況下,他會去調用各個伺服器的資源,worker之間早已免密碼 PBS架構from[PBS 排程及COMET Linux 系統架構](http://web.che.ntu.edu.tw/stlin/freshman/pbsskill) ![](https://i.imgur.com/MzXJ6ah.png) 另一圖from[openpbs centos 7 配置安装手把手教程](http://thisis.yorven.site/blog/index.php/2020/12/06/openpbs-install-instructions/) ![](https://i.imgur.com/vKC8p8Z.png) ## openpbs ### download from github https://github.com/openpbs/openpbs `git clone https://github.com/openpbs/openpbs` For centos-7 ```shell= ## Install the prerequisite packages for building PBS. 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 python3-devel tcl-devel \ tk-devel swig expat-devel openssl-devel libXext libXft \ autoconf automake gcc-c++ ## Install the prerequisite packages for running PBS. In addition to the commands below, you should also install a text editor of your choosing (vim, emacs, gedit, etc.). yum install -y expat libedit postgresql-server postgresql-contrib python3 \ sendmail sudo tcl tk libical ## 進入資料夾 cd openpbs ## Generate the configure script and Makefiles. ./autogen.sh ## Configure the build for your environment. You may utilize theparameters displayed in the previous step:./configure --help. ./configure --prefix=/opt/pbs ## Build PBS by running "make". make ##Install PBS. Use sudo to run the command as root. make inatll ## Configure PBS by executing the post-install script. sudo /opt/pbs/libexec/pbs_postinstall ## Edit /etc/pbs.conf to configure the PBS services that should be started. If you are installing PBS 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 ## Some file permissions must be modified to add SUID privilege. sudo chmod 4755 /opt/pbs/sbin/pbs_iff /opt/pbs/sbin/pbs_rcp ## Start the PBS services. sudo /etc/init.d/pbs start ## All configured PBS services should now be running. Update your PATH and MANPATH variables by sourcing the appropriate PBS profile or logging out and back in. ##For Bourne shell (or similar) run the following: . /etc/profile.d/pbs.sh ``` :::warning :fire:阿然後咧 ::: * 以上是github開源碼弄得 阿不知道要怎麼弄了 網路上一時找不到 之後再說 ### RPM下載 另一個方法是用rpm下載 有些版本才有 * 版本列表 https://github.com/openpbs/openpbs/tags 以下為19.1.3版本 ```shell= ## prerequsite 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 python3-devel tcl-devel \ tk-devel swig expat-devel openssl-devel libXext libXft \ autoconf automake gcc-c++ yum install -y expat libedit postgresql-server postgresql-contrib python3 \ sendmail sudo tcl tk libical yum install -y gzip perl-Env perl-Switch ## install cd / wget https://github.com/openpbs/openpbs/releases/download/v19.1.3/pbspro_19.1.3.centos_7.zip unzip pbspro_19.1.3.centos_7 cd pbspro_19.1.3.centos_7 ``` 因為[4/7遇到的問題](https://hackmd.io/magj1td5RIiqhGLoK2avmw#48)所以要改psql的版本 * server 台 ```shell= rpm -ivh pbspro-server-19.1.3-0.x86_64.rpm ## 因為要把client也裝在server底下(盡量不要這麼做) rpm -ivh -nodeps pbspro-client-19.1.3-0.x86_64.rpm vim /etc/pbs.conf ## 通常沒啥需要改的 除了PBS_START_MOM之外的PBS_START_*都要是 1 ## 阿因為遇到一些問題 要改psql的版本(參照上面連結) ## 找現有版本 rpm -qa | grep postgresql ## 把 9.2.24刪掉 ## 下載 PostgreSQL 套件庫資訊 wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm ## 安裝 PostgreSQL 套件庫資訊與 EPEL sudo yum install pgdg-redhat-repo-latest.noarch.rpm epel-release ## 安裝指定版本的 PostgreSQL sudo yum install postgresql11-server postgresql11-contrib ## 初始化 PostgreSQL 資料庫 sudo /usr/pgsql-11/bin/postgresql-11-setup initdb ## 啟動 PostgreSQL 伺服器 sudo systemctl start postgresql-11 sudo systemctl enable postgresql-11 ## 在bashrc或/etc/profile 中 export PATH=$PATH:/usr/pgsql-11/bin ## 初始化PBS /opt/pbs/libexec/pbs_habitat ## 開啟PBS /etc/init.d/pbs start ``` * worker台 ```shell= rpm -ivh pbspro-execution-19.1.3-0.x86_64.rpm vim /etc/pbs.conf ## 將「CHANGE_THIS_TO_PBS_PRO_SERVER_HOSTNAME」取代為「pbsmaster」這個Hostname。\ #另外也請注意,裡面的PBS_START_MOM要是 1,其他的PBS_START_* 都應該要是 0。 vim /var/spool/pbs/mom_priv/config ## 將「CHANGE_THIS_TO_PBS_PRO_SERVER_HOSTNAME」取代為「pbsmaster」這個Hostname ## 開啟PBS service pbs start ``` * 完成上述動作後 回到server台 ```shell= ## 加入worker節點 qmgr -c "create node A01" qmgr -c "create node A03" qmgr -c "create node A04" ## 確認節點 pbsnodes -a ``` 至此 服務已可使用 ## PBS指令 [Cluster Leopard 2.0](http://leopard.mcl.math.ncu.edu.tw/usage.xhtml) [PBS 排程及COMET Linux 系統架構](http://web.che.ntu.edu.tw/stlin/freshman/pbsskill) [PBS 命令与使用 - Unix/Linux - 一夜孤城](http://www.360doc.com/content/11/0225/09/4182758_95923140.shtml) [PBS Professional Quick Start Guide](https://www.cerit-sc.cz/media/2107982/tahak-pbs-pro-small.pdf) [Commonly Used PBS Commands](https://www.nas.nasa.gov/hecc/support/kb/commonly-used-pbs-commands_174.html) 主要有在用的是 * qsub:To submit a batch job to the specified queue using a script(提交作業腳本) * `qsub -I -q queue_name -l resource_list `看有多少resource-interactive job * qstat:To display queue information(查詢作業狀態) * qdel:To delete (cancel) a job(刪除已提交的作業) * pbsnodes可查看nodes狀態 ## PBS script 取自國網中心台灣杉1號中文使用手冊 ``` # 指定資源種類與數量 #PBS -l <resource name>=<value> # 指定job名稱 (選擇性) #PBS -N <job name> # 指定queue名稱 #PBS –q <destination queue> # 指定計畫名稱 #PBS –P <project name> # 合併std-err 與std-out (選擇性) #PBS -j eo ``` EX: ``` # 序列job (1核心) #PBS -l select=1:ncpus=1 # MPI job (2 節點、每節點 8 個處理器) #PBS -l select=2:ncpus=8:mpiprocs=8 # 結合MPI和OpenMP的job (2 MPI 與 16 threads) #PBS -l select=2:ncpus=8:mpiprocs=1:ompthreads=8 # 結合MPI和CUDA的job (每節點 4 GPUs) #PBS -l select=2:ncpus=40:ngpus=4:mpiprocs=4 # 計算時間為1小時 #PBS -l walltime=1:00:00 ``` PBS_O_WORKDIR The absolute path of the current working directory of the qsub utility process. ## 出現問題時 `tracejob [job ID]` 會顯示出log,像下方 ![](https://i.imgur.com/Q5OYKyQ.png) 或是使用 `qstat -as job_id` * 可以去worker pbs裡面的MOM LOG查詢計算時的出錯事項 ``` cd /var/spool/pbs/mom_logs ``` * 未傳送的可以看 在 ``` /var/spool/pbs/undelivered ``` PBS用scp傳送檔案時 需要在user SSH免密碼的情況以及檔案目錄可供客戶端讀寫 ``` chmod 777 /pwd ``` ## 成功檔案 ## 自己下載來用小結 如果用我們超電A01~A04這樣的話 檔案共享用NFS 排程用PBS 在沒用容器下就是A02叫A01、A03、A04來算(A02為server 其他為worker) A02給worker執行檔 各worker用自己的mpirun執行A02給的程式執行檔(其他worker要吃到執行檔的路徑,方法為放在NFS共享資料夾下面)或是export PATH 推測容器平行計算加PBS的方法為 每個worker module load singularity和mpi 開啟client給的SIF檔 然後對client的input檔(容器外)做client要求的資源分配計算 程式執行檔在worker自己的容器內 ~~mpi理論上也是~~ * 事實上MPI可內外溝通 所以版本要一樣 ## [PBS總結懶人包](https://truth.bahamut.com.tw/s01/202009/0d896d7b3b965d48d674e65eeccc27cb.JPG) ## PBS上屆的nemo.pbs ```shell= #!/bin/bash #PBS -N nemo-s12 #PBS -q normal #PBS -l select=32:ncpus=24:mpiprocs=23:ompthreads=1:mem=96gb #PBS -l walltime=10:00 #PBS -P 50000042 #PBS -j oe #PBS -o pbsout.txt cd $PBS_O_WORKDIR module purge module load singularity/3.4.0 boost/1.71.0/intel19/parallel nn_GYRE=25 ln_bench=true jpkglo=31 # We set the domain decomposition to 32*23 because # NEMO not allow the 32*24 decomposition jpni=32 jpnj=23 ln_timing=ture node=32 ncpu=23 hostfile=hostfile SINRUN=`which singularity` SINPAR="exec --no-home -w --pwd /opt/NEMO/cfgs/gyre_pisces_test/EXP00/" SANDBOX=nemo NEMO_BIN_PATH=$SANDBOX/opt/NEMO/cfgs/gyre_pisces_test/EXP00 MPIRUN=`which mpirun` MPIPAR="-genv FI_TCP_IFACE=mlx5_0:1 -ppn 23" RESDIR=latest-test echo "======================================================================================" echo "nn_GYRE = $nn_GYRE" echo "ln_bench = $ln_bench" echo "jpkglo = $jpkglo" echo "--------------------------------------------" echo "jpni = $jpni" echo "jpnj = $jpnj" echo "ln_timing = $ln_timing" echo "--------------------------------------------" echo "node = $node" echo "ncpu = $ncpu" echo "hostfile = $hostfile" echo "--------------------------------------------" echo "SINRUN = $SINRUN" echo "SINPAR = $SINPAR" echo "SANDBOX = $SANDBOX" echo "--------------------------------------------" echo "NEMO_BIN_PATH = $NEMO_BIN_PATH" echo "MPIRUN = $MPIRUN" echo "MPIPAR = $MPIPAR" echo "--------------------------------------------" echo "RESDIR = $RESDIR" echo "======================================================================================" # generate the hostfile for mpi rm -f $hostfile for (( i=1; i<=$node; i=i+1 )) do S[${i}]=`sed -n "$(($i*$ncpu))p" $PBS_NODEFILE` echo "${S[$i]}" >> $hostfile done #modify the configuration to namelist sed -i "38c \ nn_GYRE = $nn_GYRE ! GYRE resolution [1/degrees]" $NEMO_BIN_PATH/namelist_cfg sed -i "39c \ ln_bench = .$ln_bench. ! ! =T benchmark with gyre: the gridsize is kept constant" $NEMO_BIN_PATH/namelist_cfg sed -i "40c \ jpkglo = $jpkglo ! number of model levels" $NEMO_BIN_PATH/namelist_cfg sed -i "1301c \ jpni = $jpni ! jpni number of processors following i (set automatically if < 1)" $NEMO_BIN_PATH/namelist_ref sed -i "1302c \ jpnj = $jpnj ! jpnj number of processors following j (set automatically if < 1)" $NEMO_BIN_PATH/namelist_ref sed -i "1326c \ ln_timing = .$ln_timing. ! timing by routine write out in timing.output file" $NEMO_BIN_PATH/namelist_ref #run NEMO time -p $MPIRUN $MPIPAR $SINRUN $SINPAR $SANDBOX ./nemo #move the output cd $NEMO_BIN_PATH mkdir -p $PBS_O_WORKDIR/result/$RESDI mv ocean.output communication_report.txt layout.dat output.namelist.* timing.output *.nc $PBS_O_WORKDIR/result/$RESDIR cp namelist_* $PBS_O_WORKDIR/result/$RESDIR ``` ## 互動式job ``` qsub -X -I -l select=1:ncpus=5:ngpus=1 -l walltime=01:00:00 -q dgx -A install -P 50000033 ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully