What happens to a running program when my computer switches to Hibernate?

113 ビュー (過去 30 日間)
Tim
Tim 2012 年 8 月 23 日
コメント済み: Sonima 2019 年 9 月 29 日
Hey,
the question is pretty simple...what happens to a running program when my computer switches to Hibernate or standby?
My problem is that a program I wrote takes some days to finish. But I have to carry my Laptop sometimes in these days so I wonder if I can close my Laptop so that he switches into Hibernate without completly stopping my program. Does it just continue running after that? I just want to be sure that nothing happens to the program.
I already tested it with a smaller program and it finished normally.
Thank for your help Tim

採用された回答

Jan
Jan 2012 年 8 月 23 日
In theory the hibernation should freeze the status of the disk, the memory and the processor status securely. In practize I'd never rely on this mechanism, if the results are important. There could be too many other reasons for problems and crashs.
I'd prefer a meachnism, which stores the intermediate values to disk and allows to resume from a certain step again. An advantage of this method is, that the changes in any parameters can be performed without the need to process the complete pipeline again.
  3 件のコメント
Krzysztof
Krzysztof 2013 年 12 月 21 日
Is there a way for MATLAB to tell the computer that it is working so that the computer does not hibernate just because there are no incoming events?
Benjamin Friedrich
Benjamin Friedrich 2018 年 1 月 18 日
編集済み: Benjamin Friedrich 2018 年 1 月 18 日
On a windows computer, you have can switch on "presentation mode" in "mobile settings" (the idea is that your computer does not hibernate while giving a powerpoint presentation). I use "presentation mode" whenever I let Matlab do a computation overnight.

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

その他の回答 (3 件)

Jason Ross
Jason Ross 2012 年 8 月 23 日
I largely agree with Jan. I've had the hiberation file get corrupted a number of times over the years, and losing a few days of work because of that wouldn't be great. I'd really not depend on it as a reliable mechanism and would design a method to pause computation before hibernating or sleeping the machine.
If you've got access to another machine (that stays up all the time) that you can run your work on, a better approach might be to run your program there, and use some remote access mechanism to to get to it and check on results. But even in that case, having intermediate check points you can resume from is a better approach, as any arbitrary system will need to be rebooted for one reason or another, and this could interrupt your calculations.
Running analysis for days also makes a program very difficult to debug and maintain since you have to wait days between iterations to know if your changes are "right".
You might want to also look into methods (refactoring, profiling your code, parallelizing, etc) that could decrease your run-time, too. Just because it takes days with the current implementation doesn't mean it always has to.

Tim
Tim 2012 年 8 月 24 日
Thank you for your quick anwers.
I will do as you say and break my program into pieces so that I can stop after one part is finished.
Jason, you are absolutly right...debugging is really difficult if I don't split the program...
Thank you Tim

Sonima
Sonima 2019 年 9 月 29 日
Hi!
Is it possible to hiberation Win 10 with a Matlab code?
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 9 月 29 日
system('powercfg /h on');
to configure hiberation being permitted. This only has to be done if you are not sure that hibernation is enabled.
system('shutdown/h /t 0');
for immediate hibernation.
Sonima
Sonima 2019 年 9 月 29 日
Thanks Walter, appritate it.

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by