Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Continuing execution after interrupting the computation?

118 views
Skip to first unread message

Ron Dotson

unread,
Jul 29, 2002, 12:01:41 AM7/29/02
to
Does anyone have any suggestions as to how to continue execution of a Maple
computation after interrupting it? In the Windows version of Maple, the only
way to interrupt execution is to click the STOP icon on the toolbar or to press
the Ctrl-C keys. There appears to be no way to simply pause execution, nor to
continue execution after interrupting it. I've checked the manuals and the help
menus, but there's no mention of resuming an interrupted computation.

Any ideas?

Thank you,

-- Ron Dotson


J. Barsuhn

unread,
Jul 29, 2002, 9:18:11 AM7/29/02
to
Dear Ron,

if you wish to interrupt a long computation in Maple under Windows,
click on the red STOP button in the menu bar. In some cases you may have
to do it repeatedly. If it has worked, you get the
Warning, computation interrupted
but you are still inside your worksheet. You may then modify the
statements that caused the too long computation and execute it anew.

On the other hand - if you left the worksheet, the values of all
variables are lost, so that you have to execute your (hopefully saved)
worksheet after opening from the beginning.

All the best Jurgen

--
-------------------
Prof. Dr. Jürgen Barsuhn
Fachhochschule Bielefeld
University of Applied Sciences
Fachbereich Elektrotechnik und Informationstechnik
Wilhelm-Bertelsmann-Str. 10
D-33602 Bielefeld

http://infmath.fh-bielefeld.de/
-----------


Davide Del Vento

unread,
Jul 29, 2002, 10:14:03 AM7/29/02
to
> but there's no mention of resuming an interrupted computation.
I think that there is no way to do that in maple itself.

> Any ideas?
You can use some OS features, like the CTRL-Z, bg or fg in unix.

Bye,
;David
Ph.D. at http://www.fis.uniroma3.it

Ron Dotson

unread,
Jul 29, 2002, 12:43:50 PM7/29/02
to
Thank you Professor Barsuhn, but the problem isn't interrupting the
computation - that part works Ok. It's just that the computation in my case can
take several days or more, and even though the interrupted worksheet is sitting
there with all the program variables intact and in their intermediate
condition, and I can even save the worksheet with everything that way, there
appears to be no way to *resume* the computation at the point it was
interrupted. I thought maybe there was some obvious way to do so that I had
just overlooked in the documentation, but apparently it now appears it's
something I should probably submit as a "new feature" request to Waterloo
Maple.

Alternatively, and this appears to be the best approach at present unless
someone else comes up with a better idea, is too write the program in such a
way that the initialization of variables doesn't automatically occur when the
program is started (ie; I could put the initialization portion of the code into
a separate procedure that I call "manually" from the keyboard the first time
only, prior to beginning execution of the main computational loop). That way,
it wouldn't matter whether the program was started from the "beginning" or not.
This is probably one of those things that more experienced Maple users get used
to doing and take for granted, but it's not my customary programming style - I
normally have intialization of variables take place "automatically" as the
first part of program execution.

Regards,

-- Ron Dotson


"J. Barsuhn" <jw.ba...@t-online.de> wrote in message
news:3D454093...@t-online.de...


> Dear Ron,
>
> if you wish to interrupt a long computation in Maple under Windows,
> click on the red STOP button in the menu bar.

> ...

J. Barsuhn

unread,
Jul 30, 2002, 7:16:46 PM7/30/02
to
Dear Ron,

if you have such long computation times, you probably should rewrite
your code so that you can save intermediate values of all the variables
you need, after reasonable sections of execution time. The code needs
also revision so that you can read the saved values of the variables
into your session and continue from there on. I don't see another
possibility. You should not rely on your system running for days or
weeks without occurence of a system error or a (short) interruption of
electricity.

For this purpose you may use the commands
save <sequence of variable names to be saved> ,<file name>
read <filename>

By specifying filenames with *other* extensions than .m you create an
ASCII file that you may inspect by any editor.

Of course you should save your worksheet *before* you execute it. But
remember that these files do not hold the values of the variables at the
moment of saving.

Ron Dotson

unread,
Aug 4, 2002, 5:41:41 AM8/4/02
to
Excellent suggestions Jurgen. I've learned to use the "save" command manually,
but hadn't thought of incorporating it into the running program to
automatically save variable values at selected intervals. I will definitely do
that.

In fact, it was my concern of a system error that prompted my desire to break
execution of the program, save the worksheet, and then resume execution where
it was interrupted. I do have an uninterruptible power supply, so I'm not too
concerned about power failures, but I AM concerned about system failures and
the need to reboot periodically (I use Windoze 2000 ;-). Your idea for saving
variables during program execution and restoring them when the program is
started, solves my problem and alleviates the need to resume program execution
where it was interrupted. Thank you very much.

I am in your debt,

-- Ron


Ron Dotson

unread,
Aug 4, 2002, 5:56:31 AM8/4/02
to
David,

Yes, things would be much easier if I used Unix or Linux since I would have
much more control over running processes than I have under Windows 2000.
Unfortunately, there is no method I know of for pausing a process in Windows,
much less for saving the program state to disk. In Windows, Ctrl-Z is "Undo."
Professor Barsuhn's suggestion alleviates the need to resume execution where
the program was interrupted however.

I do have Linux installed on my machine in a dual boot configuration, and try
it out from time to time in order to learn to use it to better advantage, but
Windows 2000 is still my primary OS as yet. I purchased the Windows version of
Maple, but perhaps I could get an additional license for Maple on Linux (or
OpenBSD Unix) for a minimal fee. Since both OS's are installed on the same
machine, I obviously wouldn't be able to run both of them at the same time, so
perhaps Waterloo-Maple would give me a good price on a Unix/Linux license.

Thank you for your suggestion,

-- Ron


"Davide Del Vento" <dav...@astromeccanica.it> wrote in message
news:bd5bcc07.02072...@posting.google.com...

Thomas Richard

unread,
Aug 5, 2002, 12:08:48 PM8/5/02
to
"Ron Dotson" <ne...@spamex.com> wrote:

You can get close to that: highlight the "rest" of your code with the
mouse, then select Edit / Execute / Selection.
Of course, this does not help in loops and similar constructs...

--
Thomas Richard
Maple Support
Scientific Computers GmbH
http://www.scientific.de

0 new messages