BS 是公開源代碼的作業管理系統,在此環境下運行,用戶不需要指定程序在哪些節點上運行,程序
所需的硬件資源由PBS 管理和分配。
1、PBS 命令
PBS 提供4 條命令用於作業管理。
(1) qsub 命令—用於提交作業腳本
命令格式:
qsub [-a date_time] [-c interval] [-C directive_prefix]
[-e path] [-I] [-j join] [-k keep] [-l resource_list] [-m mail_options]
[-M user_list][-N name] [-o path] [-p priority] [-q destination] [-r c]
[-S path_list] [-u user_list][-v variable_list] [-V]
[-W additional_attributes] [-z]
[script]
參數說明:因為所采用的選項一般放在pbs 腳本中提交,所以具體見PBS 腳本選項。
例:# qsub aaa.pbs 提交某作業,系統將產生一個作業號
(2) qstat 命令—用於查詢作業狀態信息
命令格式:qstat [-f][-a][-i] [-n][-s] [-R] [-Q][-q][-B][-u]
參數說明:
-f jobid 列出指定作業的信息
-a 列出系統所有作業
-i 列出不在運行的作業
-n 列出分配給此作業的結點
-s 列出隊列管理員與scheduler 所提供的建議
-R 列出磁盤預留信息
-Q 操作符是destination id,指明請求的是隊列狀態
-q 列出隊列狀態,並以alternative 形式顯示
-au userid 列出指定用戶的所有作業
-B 列出PBS Server 信息
-r 列出所有正在運行的作業
-Qf queue 列出指定隊列的信息
-u 若操作符為作業號,則列出其狀態。
若操作符為destination id,則列出運行在其上的屬於user_list 中用戶的作業狀態。
例:# qstat -f 211 查詢作業號為211 的作業的具體信息。
(3) qdel 命令—用於刪除已提交的作業
命令格式:qdel [-W 間隔時間] 作業號
命令行參數:
例:# qdel -W 15 211 15 秒後刪除作業號為211 的作業
(4) qmgr 命令—用於隊列管理
qmgr -c “create queue batch queue_type=execution”
qmgr -c “set queue batch started=true”
qmgr -c “set queue batch enabled=true”
qmgr -c “set queue batch resources_default.nodes=1″
qmgr -c “set queue batch resources_default.walltime=3600″
qmgr -c “set server default_queue=batch”
2、PBS 腳本文件
PBS 腳本文件由腳本選項和運行腳本兩部分組成。
(1) PBS 作業腳本選項 (若無-C 選項,則每項前面加‘#PBS’)
-a date_time : date_time 格式為:[[[[CC]YY]MM]DD]hhmm[.SS]
表示經過date_time 時間後作業才可以運行。
-c interval : 定義作業的檢查點間隔,如果機器不支持檢查點,則忽略此選項。
-C directive_prefix :在腳本文件中以directive_prefix 開頭的行解釋為qsub 的命
令選項。(若無此選項,則默認為’#PBS’ )
-e path :將標準錯誤信息重定向到path
-I :以交互方式運行
-j join :將標準輸出信息與標準錯誤信息合並到一個文件join 中去。
-k keep :定義在執行結點上保留標準輸出和標準錯誤信息中的哪個文件。
keep 為o 表示保留前者,e 表示後者,oe 或eo 表示二者都保留,
n 表示皆不保留。若忽略此選項,二者都不保留。
-l resource_list : 定義資源列表。以下為幾個常用的資源種類。
cput=N : 請求N 秒的CPU 時間; N 也可以是hh:mm:ss 的形式。
mem=N[K|M|G][B|W]:請求N {kilo|mega|giga}{bytes|words} 大小的內存。
nodes=N:ppn=M :請求N 個結點,每個結點M 個處理器。
-m mail_options :mail_option 為a:作業abort 時給用戶發信;為b:作業開始運行發信;為e:
作業結束運行時發信。若無此選項,默認為a。
-M user_list : 定義有關此作業的mail 發給哪些用戶。
-N name : 作業名,限15 個字符,首字符為字母,無空格。
-o path : 重定向標準輸出到path。
-p priority : 任務優先級,整數,[-1024,1023],若無定義則為0.
-q destination : destination 有三種形式: queue , @server,queue@server。
-r y|n : 指明作業是否可運行,y 為可運行,n 為不可運行。
-S shell : 指明執行運行腳本所用的shell,須包含全路徑。
-u user_list : 定義作業將在運行結點上以哪個用戶名來運行。
-v variable_list : 定義export 到本作業的環境變量的擴展列表。
-V : 表明qsub 命令的所有環境變量都export 到此作業。
-W additional_attributes : 作業的其它屬性。
-z : 指明qsub 命令提交作業後,不在終端顯示作業號。
(2) 運行腳本同LINUX 下一般的運行腳本文件。
[註]:腳本文件中的mpirun_rsh 命令行中的節點列表文件要用環境變量表示
$PBS_NODEFILE,這個環境變量表示由pbs 自動分配給作業的節點列表;
節點數為命令行中指定的進程數。
格式如下:
mpirun_rsh –np 進程數 –hostfile $PBS_NODEFILE 可執行程序名
3、PBS 環境下運行示例
(1)腳本文件編輯示例
實例1:運行mpi 程序
命令行:#vi aaa.pbs
編輯的內容:
#PBS -N myjob
#PBS -o /home/jz/my.out
#PBS -e /home/jz/my.err
#PBS –l nodes=2:ppn=2
cd 目錄(你們原來直接在節點上運行時所在的目錄)
mpirun_rsh –np 4 –hostfile $PBS_NODEFILE /home/jz/helloworld
解釋:原先大家都是在中斷輸入 mpirun_rsh…..這些命令執行程序的,現在只要把這些提交命令放
在.pbs 配置文件的最後,由PBS 來調度執行(自動分配節點和其它資源)。
Myjob 是為你此次要運行的程序起的任務名,可以改成你自己想要的名字
原先輸出信息都是直接在屏幕上顯示的,現在屏幕上的顯示全部輸出到文件中,上例中輸出文
件是/home/jz/my.out 文件,大家可以根據自己的需要修改(目錄,文件名)。程序運行時遇到的一些錯誤會
記錄在.err 文件中。好處:因為對每個任務都設定了不同的輸出文件,所以看結果只要打開相應文件看就可
以了,不需要開多個終端,而且裏面有任務的詳細信息,比如實際分配的是哪些節點計算,運行時間等。
#PBS –l nodes=2:ppn=2,你們程序需要幾個節點只要修改nodes 後的數字就可以了,ppn=2 保持
不變,因為我們的機器每個節點都是雙cpu 的。
mpirun_rsh –np 4 –hostfile $PBS_NODEFILE /home/jz/helloworld
此例中-np 後的4 是並行數(2 × 2 = 4 個cpu ), –hostfile $PBS_NODEFILE 不需要改變。
/home/jz/helloworld 是你編譯好的可執行文件名,需修改。
對於每個你要運行的mpi 程序都需要這樣一個.pbs 配置文件
也就是說大家原來的操作是:mpirun…………
現在改成2 步走:1)寫個pbs 配置文件(比如xxx.pbs);2)向pbs 提交(qsub xxx.pbs)
實例2:運行非mpi 程序
有些用戶並不是自己編寫mpi 程序,同樣也可以用pbs 提交。
比如物理系運行程序時一般輸入的命令是 RunDMol3.sh TiFeCp2-pbe-dspp-m=1-opt ,那麽配置文件可以
這樣寫:
命令行:#vi job.pbs
編輯的內容:
#PBS -N physics_job
#PBS -o /home/physics/physics_job.out
#PBS -e /home/physics/physics_job.err
#PBS -l nodes=1:ppn=2
#PBS -r y
cd 目錄(你們原來直接在節點上運行時所在的目錄)
RunDMol3.sh TiFeCp2-pbe-dspp-m=1-opt
解釋:也就是說把原來在終端直接輸入的命令RunDMol3.sh TiFeCp2-pbe-dspp-m=1-opt 放到pbs 配置
文件中,因為你們只要一個節點,所以nodes=1,至於用哪個節點系統自動分配,你們肯定很關心是分配
了哪個節點給你們,那麽可以用qstat 命令查詢(比如qstat -n)。
(2) 提交作業示例
命令行:#qsub aaa.pbs
顯示結果:
(3) 作業狀態查詢示例
Qstat 後加不同參數可以查看不同的信息(各參數的意思,上面有詳細的說明,你們可以一個個試驗一
下,以後就知道查看哪些信息,需要哪些參數)
實例:
命令行:#qstat –a (查看作業的狀態)
顯示結果:
解釋:Job id 211 是給你提交的任務分配的任務號,S(任務狀態,R 表示正在運行,Q 表示正在排
隊等候調度)
8
命令行:#qstat –n (查看作業使用的節點)
顯示結果:
解釋:blade32 就是分給你這個任務的節點
命令行:#qstat –f 211 (查看有關作業運行具體信息)
顯示結果:
解釋:exec_host 顯示的是實際執行該任務的節點
I envy your work , regards for all the interesting articles .
Really? Maybe you can help me to do it!:)
Your awnser lifts the intelligence of the debate.
AFAICT you’ve covered all the bases with this ansewr!
Wholesale Low cost Handbags Will you be ok merely repost this on my site? I’ve to allow credit where it can be due. Have got a fantastic day!
Hey, that’s a clever way of tihkning about it.
An fascinating discussion might be worth comment. I believe you need to write on this subject, it may well certainly be a taboo topic but typically folks are not enough to dicuss on such topics. To a higher. Cheers
Thanks for the writeup. I surely agree with what you’re saying. I’ve been talking about this subject a great deal lately with my brother so hopefully this will get him to see my point of view. Fingers crossed!
I visited a great deal of site but I conceive this 1 holds something extra in it in it
I’d need to verify with you here. Which is not one thing I normally do! I take pleasure in reading a submit that will make individuals feel. Additionally, thanks for permitting me to remark!
I want to show my thanks to you just for rescuing me from such a predicament. Because of looking throughout the world wide web and coming across thoughts that were not helpful, I thought my entire life was nicely more than. Living without the approaches towards the issues you’ve solved as a result of your main guide is really a crucial case, as properly as the kind which may possibly have adversely damaged my career if I had not noticed your web page. Your actual skills and kindness in dealing with all the stuff was crucial. I don’t know what I would’ve done if I had not come upon such a step like this. I can at this time appear ahead to my future. Thanks so significantly for the impressive and effective help. I will not be reluctant to recommend your internet web sites to any individual who should receive guidelines on this problem.
Youre so right. Im there with you. Your weblog is surely worth a read if anyone comes throughout it. Im lucky I did because now Ive obtained a complete new view of this. I didnt realise that this issue was so important and so universal. You totally put it in perspective for me.
I’m honored to obtain a call from a friend as he identified the crucial tips shared on your web site. Browsing your weblog post is actually a real excellent experience. Numerous thanks for taking into consideration readers at all like me, and I wish you the most effective of achievements as being a specialist domain.
really good post, i undoubtedly love this internet site, keep on it
Thanks coming:)
I’m not that a lot of a internet reader to be honest but your blogs truly good, maintain it up! I’ll go ahead and bookmark your website to come back within the future. All the finest
Howdy! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My blog goes over a lot of the same subjects as yours and I feel we could greatly benefit from each other. If you are interested feel free to shoot me an e-mail. I look forward to hearing from you! Awesome blog by the way!
Thanks! you can find my e-mail adders on my blog introduction page
As soon as I observed this site I went on reddit to share some of the love with them.
It’s my pleasure to know that
Do you have a spam problem on this blog; I also am a blogger, and I was wondering your situation; we have developed some nice methods and we are looking to swap solutions with others, why not shoot me an email if interested.
OK, i will, if needed
Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Firefox. I’m not sure if this is a format issue or something to do with browser compatibility but I figured I’d post to let you know. The layout look great though! Hope you get the issue solved soon. Thanks
Hi there! My spouse and I often publish guest articles or blog posts for other website owners to help increase publicity to our work, as well as provide good articles to website owners. It’s a win win situation! If you’re interested feel free to e-mail me at: Kyle2942@gmail.com so we can discuss further. Many thanks!
Heya! I’m at work browsing your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the excellent work!
OK, kool ! That’s the effect what i expected!
Fidnnig this post has answered my prayers
A lot of thanks for each of your work on this web page. Debby loves carrying out investigations and it’s really simple to grasp why. All of us learn all regarding the dynamic mode you present informative secrets by means of your blog and as well as strongly encourage contribution from other individuals about this topic while my daughter is really becoming educated a great deal. Enjoy the remaining portion of the year. You are always carrying out a terrific job.
I would like to take the opportunity of saying thanks to you for that professional assistance I have usually enjoyed visiting your site. We’re looking forward to the commencement of my college research and the general preparing would never have been complete without coming to this site. If I could be of any help to others, I’d be glad to help by means of what I have gained from here.
I really like your writing style, great information, regards for posting :D. “In university they don’t tell you that the greater part of the law is learning to tolerate fools.” by Doris Lessing.
Hello.This article was extremely fascinating, particularly since I was searching for thoughts on this issue last Sunday.
I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz answer back as I’m looking to construct my own blog and would like to know where u got this from. appreciate it
No, Just finish it by myself! u can use google to get the help information, That’s easy!
I dugg some of you post as I thought they were extremely helpful very useful
Thanks
!
I’ve said that least 4482007 times. SCK was here
haha, i hope so !
Very interesting points you have noted , regards for posting . “Success is a journey, not a destination. The doing is often more important than the outcome.” by Arthur Ashe.
Yes, i totally agree with u
To follow up on the up-date of this topic on your blog and would like to let you know just how much I appreciated the time you took to put together this valuable post. Within the post, you really spoke on how to truly handle this thing with all comfort. It would be my pleasure to accumulate some more thoughts from your site and come up to offer some others what I learned from you. Thanks for your usual great effort.
Hello there, just became aware of your blog through Google, and found that it’s really informative. I am gonna watch out for brussels. I will appreciate if you continue this in future. Many people will be benefited from your writing. Cheers!
Thanks
Informed incredible gift item in crafting fantastic articles with regards to your blogging. Precisely what is remarkable what sort of easy but still crystal clear route to identify problems.
I see something genuinely interesting about your site so I saved to my bookmarks .
I’d perpetually want to be update on new content on this site, saved to bookmarks ! .
Some truly select blog posts on this web site , saved to fav.
I ponder to sort it out or otherwise would suggest yourself to this individual the writer. I’m sure you can get in good shape to publish truly good articles and reviews, but if you would probably accommodate the career? Please make sure to figure out.
I precisely wished to appreciate you all over again. I’m not certain the things that I could possibly have undertaken in the absence of the actual creative ideas revealed by you relating to this question. It became a very frightful crisis in my position, however , seeing the professional form you dealt with it took me to leap with delight. Now i’m grateful for your advice and thus hope that you really know what a powerful job you were carrying out teaching men and women all through a blog. Most probably you have never encountered any of us.
splendid concerns hundred per cent, only collected a particular brand contemporary representative. That which would the public encourage you with regards to your deliver to presented a few days prior to now? Your for sure?
I’m curious to find out what blog system you’re utilizing? I’m experiencing some minor security problems with my latest blog and I would like to find something more secure. Do you have any solutions?
I am always browsing online for articles that can assist me. Thx!
Outstanding post, I believe website owners should larn a lot from this website its rattling user friendly . “My father always told me, ‘Find a job you love and you’ll never have to work a day in your life.'” by Jim Fox.
I would like to take the ability of saying thanks to you for that professional advice I have constantly enjoyed going to your site. We are looking forward to the particular commencement of my university research and the overall groundwork would never have been complete without dropping by your web site. If I might be of any assistance to others, I’d be pleased to help through what I have learned from here.
Hey, you used to write magnificent, but the last several posts have been kinda boring… I miss your tremendous writings. Past few posts are just a little bit out of track! come on!”Partake of some of life’s sweet pleasures. And yes, get comfortable with yourself.” by Oprah Winfrey.
Absolutely composed written content, thanks for entropy. “You can do very little with faith, but you can do nothing without it.” by Samuel Butler.
I like this post, enjoyed this one thankyou for putting up.
Great post. I used to be checking constantly this weblog and I am impressed! Extremely useful info specifically the last part
I care for such info much. I was seeking this particular info for a long time. Thanks and best of luck.
Hi there, I found your website via Google whilst looking for a related topic, your web site came up, it appears great. I’ve bookmarked it in my google bookmarks.
I dugg some of you post as I thought they were extremely helpful very beneficial
Fantastic site. A lot of helpful information here. I’m sending it to some buddies ans additionally sharing in delicious. And certainly, thank you to your effort!
Hiya, I am really glad I’ve found this info. Today bloggers publish just about gossips and internet and this is actually irritating. A good blog with exciting content, that’s what I need. Thanks for keeping this site, I will be visiting it. Do you do newsletters? Can’t find it.
This is really fascinating, You are a very skilled blogger. I have joined your feed and stay up for seeking more of your magnificent post. Additionally, I have shared your site in my social networks!
I believe this web site has got some really great information for everyone : D.
We’re a group of volunteers and starting a new scheme in our community. Your web site provided us with valuable information to work on. You’ve done an impressive job and our whole community will be grateful to you.
Yeah bookmaking this wasn’t a speculative conclusion outstanding post!
Keep up the fantastic work, I read few blog posts on this website and I think that your website is very interesting and holds circles of superb info.
As I website possessor I think the content here is rattling good , appreciate it for your efforts.
I am very happy to read this. This is the kind of manual that needs to be given and not the accidental misinformation that’s at the other blogs. Appreciate your sharing this best doc.
Simply desire to say your article is as astonishing. The clearness in your post is simply great and i could assume you’re an expert on this subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the gratifying work.
This is just farex opinie great point to learn
I will right away grab your rss feed as I can not find your e-mail subscription link or e-newsletter service. Do you have any? Kindly permit me understand so that I may subscribe. Thanks.
Sweet internet site, super design, real clean and utilize pleasant.
I like this post, enjoyed this one regards for posting .
For hottest news you have to visit world-wide-web and on web I found this web page as a best web site for
hottest updates.