欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
科學(xué)網(wǎng)

轉自:http://hi.baidu.com/imheaventian/item/04a27e14aa941c24f7625cef


后臺運行matlab腳本文件的方法:nohup


實(shí)現功能:
1. 字符環(huán)境下運行matlab.
2.字符環(huán)境下運行matlab腳本文件,腳本文件無(wú)圖像的屏幕輸出。
3.腳本文件需長(cháng)時(shí)間運行,運行結果輸出到文件。matlab的標準重定向到另一個(gè)文件。 
4.客戶(hù)端退出登陸后,matlab保持運行 ,直到腳本程序結束或錯誤退出時(shí),matlab程序才退出。

實(shí)現方法:采用nohup命令。

具體實(shí)現過(guò)程:

使用命令:
nohup /usr/matlab/bin/matlab   <fill.m> fill.out & 
就可以了,fill.m表示你的文件名. fill.out代表你的輸出轉到fill.out文件中。比如,matlab中的命令sin(1:10),結果應該輸出到command window中的,但是現在轉到了fill.out文件中

例如:我在/home/jsh/yangting/文件夾下有個(gè)test2.m文件

那么,當matlab在/home/jsh/yangting/文件夾下打開(kāi)時(shí),

命令為

nohup matlab <test2.m> fill.out &

注意:在nohup運行成功后,不能直接點(diǎn)擊關(guān)閉按鈕,而應該按下任意鍵,恢復到輸入狀態(tài),然后按exit命令退出。

使用命令:
nohup matlab -nojvm -nodisplay -nosplash -nodesktop < matlabscript.m 1>running.log 2>running.err & 

nohup matlab -nojvm -nodisplay -nosplash < matlabscript.m 1>running.log 2>running.err & 
或:
nohup matlab -nojvm -nodisplay < matlabscript.m 1>running.log 2>running.err & 

其中:
matlabscript.m是將要運行的腳本文件,存在于服務(wù)器上;
running.log是matlab標準屏幕輸出的重定向文件,將建立于服務(wù)器上;
running.err是matlab運行時(shí)的錯誤重定向文件,將建立于服務(wù)器上。

===================================
另外補充:
(1)如果你想中斷正在運行的matlab請使用
              kill -9 進(jìn)程號 
         或 fg %n Ctrl+C 
(2)如果你想在字符環(huán)境的matlab中運行腳本,請使用
              run 腳本文件名(不含.m擴展名) 
(3)如果你想用ssh運行有X界面的matlab,登陸時(shí)請使用
             ssh 主機名 -l 用戶(hù)名 -X

Running Matlab Remotely (Under Linux)

Usually, it is most effective and convenient to run Matlab locally, in particular for interactive work, but there are a number of reasons why you might want to run Matlab remotely across a network. For instance, your local machine may not have Matlab installed at all, or your local machine may not have sufficient memory for your task. In these cases, you can consider accessing another computer by remote login and running Matlab there. This concept only makes sense under Unix/Linux on the remote machine; Windows or Macintosh do not allow for remote access (as far as I know). Hence, for any new windows to be opened, also your local system needs to be Unix/Linux. However, the performance of such remote windows may be so slow that you will want to avoid them anyway and rather run Matlab purely inside your login shell; naturally, this precludes any graphical output and restricts this use to numerical tasks only.

So, we want to start Matlab (i) without its desktop and (ii) without any graphics (including the splash screen); this can be accomplished by saying matlab -nodisplay . You could also use matlab -nodisplay -nojvm , which additionally does not start the JVM. In both cases, attempts to open plot and similar windows might be simply ignored or attempts to open the documentation windows might result in various error messages.

The above is the most restrictive way in which to start Matlab. If in fact your local machine is Linux, you could use matlab -nodesktop -nosplash , which (i) does not start the desktop and (ii) suppresses the splash screen (the small window with Matlab's logo and version number that usually pops up briefly). But this way of starting Matlab does start the JVM and you have access to the HelpBrowser as well as to plot windows, if you later so desire (and are willing to wait for those to open, which might take a while depending on your network connection).

Running Matlab in the Background (Under Linux)

The idea of running a job in the background means that a software runs without any user interaction and additionally does not block your login shell. As remote access, this makes only sense under Unix/Linux. It applies both on your local machine, but might be particularly useful on a remote login; as in the previous section, this will be most useful for purely numerical (i.e., non-graphical) jobs.

nohup \matlab -nojvm -nodisplay < driver.m >& driver.log &

Here, the backslash in \matlab circumvents any possible alias you might have for Matlab (just to be on the safe side) and the options -nojvm -nodisplay suppress the starting of the JVM (and the startup of the desktop) and the opening of any windows. The final ampersand ("&") actually puts the command into the background, i.e., gives you the command-line prompt in your shell back. Aside from entering any usual commands now, you could in particular log out, without hanging or killing your job, because of the standard Unix/Linux command nohup before the call to Matlab. The file driver.m that must be present in the current directory is a Matlab script file (not: function file) that lists the commands to be executed by your job; if your job is actually performed by a function, this script file can simply be a single line that calls your function.

For the remaining elements in the command-line above, I am assuming you are using the csh or tcsh shell; in other shells, the redirections may be slightly different. The "< " redirects stdin (namely from file driver.m) into Matlab. For the background run not to hang, there must not be any screen output, so the ">& " redirects both stdout and stderr to the file driver.log ; this file must not exist initially. Again, the redirection commands may be different in other shells and slight variations are possible (such as overwriting an existing log file).

無(wú)論是linux unix,用 nohup sh 'full command line' 都可以啟動(dòng)程序并讓程序在后臺運行,獨立于終端。

由于nohup啟動(dòng)的時(shí)候不會(huì )有圖形界面,如果是matlab,建議不要用圖形界面選項,執行什么命令預先寫(xiě)在m文件里面,如: 

nohup sh 'matlab -nodesktop < /data/user/myCommand.m'

這里的<是輸入換向,因為nohup會(huì )忽略終端的輸入。 

要注意,如果是ssh上去的,千萬(wàn)不要直接關(guān)窗口,而一定要用exit命令和主機解除關(guān)系。

用不用"&"在linux里面不重要。在linux里面,還有更加簡(jiǎn)便的方法。并且還有圖形界面

1)可以用screen命令,一般的2.6.12以上的內核都支持。
screen matlab &
這個(gè)時(shí)候,可以繼續用matlab,退出終端用exit就可以了。
如果沒(méi)有 &??梢缘浇K端,按ctrl-a 掛起,用命令bg將matlab轉到后臺,注意,這個(gè)時(shí)候不要忘記最重要的一步,千萬(wàn)人按一鍵或多按一個(gè)回車(chē),然后用exit。要不然,一旦你結束sreen,matlab也就結束了。

2)基于2.6.18以上內核
起先自己一直這么用的,所以也就沒(méi)有上心。以為linux原本就可以獨立終端運行。剛才有看了一下,發(fā)現是2.6.16以后的新功能,就是2.6.18以后更加完善了。就是VM機制。當然,需要多核計算機支持。
一個(gè)終端在缺省時(shí)將試圖用VM運行你的程序。ssh name@server以后,可以直接在linux主機上打開(kāi)matlab,然后可以看到圖形界面,你可以完成你要得工作,需要等待的時(shí)候。在終端,按 ctrl-z回到終端命令行,用bg命令置于后臺。然后,用exit退出終端。這個(gè)時(shí)候,你會(huì )發(fā)現matlab還在你的電腦上運行。不過(guò)這個(gè)只是圖形界 面。并且沒(méi)有實(shí)質(zhì)性的作用。就是x winserver在你的電腦上的一個(gè) VM界面而已。

另外一點(diǎn),你的tty輸出將存在主機的你的目錄下。matlab的屏幕輸出就看不見(jiàn)了。所以,務(wù)必將結果用標準輸出,寫(xiě)入文件。

3)matlab server. 這個(gè)針對性比較強,你的電腦需要安裝matlabserver支持相關(guān)的工具箱,然后可以讓server上的其他電腦替你完成你的運算。server的特 殊命令集在工具箱里都有定義,一般的運算和你在本地沒(méi)有區別。關(guān)于server的問(wèn)題,如果感興趣很高興再討論。


本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
盤(pán)點(diǎn)逼格高又實(shí)用的Linux高級命令
Linux 定時(shí)任務(wù)調度(crontab),太實(shí)用了!
讓我帶你玩轉”Linux“
Linux后臺運行 nohup & > /dev/null
[譯]后臺執行UNIX/Linux命令和腳本的五種方法
如何編譯Python使之成為可執行程序?
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久