フィルターのクリア

Command window output of still running task

1 回表示 (過去 30 日間)
Pieter van den Berg
Pieter van den Berg 2011 年 9 月 2 日
コメント済み: Thomas Ibbotson 2014 年 5 月 28 日
Hello,
does anyone whether there is a way to get the command window output of a task while it is still running?
If not, is there another built-in way of monitoring running tasks (besides the state?)?
Thanks,
Pieter

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 2 日
Start the session from another process, using OS-level pipe() to communicate with it. Unfortunately MATLAB does not flush its buffer at any particular time.
If you need graphics, you might have to read the output using screen capture techniques.
There is no mechanism within MATLAB to do what you would like (unfortunately.)
  2 件のコメント
Pieter van den Berg
Pieter van den Berg 2011 年 9 月 2 日
That is unfortunate... thanks for the info.
Mustafa
Mustafa 2011 年 9 月 2 日
I just posted a question and i thought this is somewhat relevant to my question. I will appreciate any help
"Is it possible to check the whole history of a program which has let say i=20000 iteration. I have tried to debug the code but everything works fine till i=200 but i can't go till 20000.
The thing is when the program finishes, i can only see last couple of hundred iterations.
Is there anyway,i can check the whole program iteration(other than debugging)"
Cheers.

サインインしてコメントする。

その他の回答 (2 件)

Thomas Ibbotson
Thomas Ibbotson 2012 年 9 月 12 日
Hi Pieter,
Starting in R2012b it is now possible to get the diary output of a task while it is still running. See http://www.mathworks.com/help/distcomp/release-notes.html.
Cheers, Tom
  2 件のコメント
Xinyi Shen
Xinyi Shen 2014 年 5 月 27 日
nobody explains how to use it. Therefore, there's still no way of doing so.
Thomas Ibbotson
Thomas Ibbotson 2014 年 5 月 28 日
Here are some examples of how you might do this:
If you are using a batch job to run your task, then you can use the diary() function passing in the job while it is still running e.g.
job = batch('myScript');
diary(job)
If you are using jobs and tasks, you must set the CaptureDiary flag on the task to true, and then query the Diary property of the task e.g.
myCluster = parcluster;
job = createJob(myCluster);
task = createTask(job, @myFunction, 0, {}, 'CaptureDiary', true);
submit(job);
task.Diary

サインインしてコメントする。


Pieter van den Berg
Pieter van den Berg 2011 年 9 月 9 日
A hack that worked very well for me is to overload the built-in disp function with something that writes the output of the built-in disp to a logfile.

カテゴリ

Help Center および File ExchangeQueue Management and Job Information についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by