Overview
Comment: | SIGINT (C-c C-c) now causes simulation data to be dumped to MTT.core. SIGQUIT (C-c C-\) as for SIGINT, then raises default SIGQUIT. SIGFPE as for SIGINT, then raises default SIGABRT. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/merging-ode2odes-exe | trunk |
Files: | files | file ages | folders |
SHA3-256: |
25ab7dc08c6133c0fdc00d2622efd8d3 |
User & Date: | geraint@users.sourceforge.net on 2001-03-12 03:59:30 |
Other Links: | branch diff | manifest | tags |
Context
2001-03-12
| ||
23:16:37 | Minor improvements to signal handling (.exe). check-in: 80f6f8264a user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk | |
03:59:30 |
SIGINT (C-c C-c) now causes simulation data to be dumped to MTT.core. SIGQUIT (C-c C-\) as for SIGINT, then raises default SIGQUIT. SIGFPE as for SIGINT, then raises default SIGABRT. check-in: 25ab7dc08c user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk | |
2001-03-09
| ||
04:01:20 | \ escapes newline. check-in: 95669d2bb6 user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk | |
Changes
Modified mttroot/mtt/bin/trans/make_ode2odes from [5dd9cf654b] to [af63f110b7].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.51.2.2 2001/03/02 00:45:21 geraint ## Separated Euler and Implicit methods in .cc code and dependencies. ## ## Revision 1.51.2.1 2001/03/01 05:05:53 geraint ## Minor revisions. ## ## Revision 1.51 2001/02/19 06:33:19 geraint | > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.51.2.3 2001/03/07 04:06:55 geraint ## Irix: catch SIGFPE and write data before aborting (.exe). ## GNU/Linux: nada. ## ## Revision 1.51.2.2 2001/03/02 00:45:21 geraint ## Separated Euler and Implicit methods in .cc code and dependencies. ## ## Revision 1.51.2.1 2001/03/01 05:05:53 geraint ## Minor revisions. ## ## Revision 1.51 2001/02/19 06:33:19 geraint |
︙ | ︙ | |||
300 301 302 303 304 305 306 307 308 309 310 311 312 313 | #endif #include "${sys}_def.h" #include "${sys}_sympar.h" #ifdef STANDALONE #include <csignal> extern ColumnVector F${sys}_input ( ColumnVector &x, ColumnVector &y, const double &t, ColumnVector &par); | > | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | #endif #include "${sys}_def.h" #include "${sys}_sympar.h" #ifdef STANDALONE #include <csignal> #include <fstream> extern ColumnVector F${sys}_input ( ColumnVector &x, ColumnVector &y, const double &t, ColumnVector &par); |
︙ | ︙ | |||
594 595 596 597 598 599 600 | cat <<EOF >> $filename inline void mtt_write (const double &t, ColumnVector &x, ColumnVector &y, const int &nrows, | | > | | | | < < < < < < | > > > > > > > > > > > > > > > > > > | > > > > > > > > > > | > > > > > | | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | cat <<EOF >> $filename inline void mtt_write (const double &t, ColumnVector &x, ColumnVector &y, const int &nrows, const bool dump_data = false, ostream &file = cout) { static Matrix data; static int row; if (dump_data) { Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1); save_ascii_data_for_plotting (file, written_data, "MTT_data"); } const int nx = x.length (), ny = y.length (); register int col = 0; if (0 == row) data = Matrix (nrows, 1+ny+1+nx, 0.0); data.elem (row, col) = t; for (register int i = 0; i < ny; i++) data.elem (row, ++col) = y.elem (i); data.elem (row, ++col) = t; for (register int i = 0; i < nx; i++) data.elem (row, ++col) = x.elem (i); row++; if (nrows == row) { #ifdef STANDALONE save_ascii_data_for_plotting (file, data, "MTT_data"); // cout << data << endl; #else // ! STANDALONE set_global_value ("MTT_data", data); #endif } } #ifdef STANDALONE void dump_data (ostream &file) { ColumnVector null (0.0); mtt_write (0.0, null, null, 0, true, file); } void handle_signal (int signum) { // handle some signals to ensure data is written. psignal (signum, "# Writing data to MTT.core"); ofstream corefile ("MTT.core"); dump_data (corefile); switch (signum) { case SIGFPE: // Intel chips do not raise SIGFPE for DIVZERO :-( raise (SIGABRT); break; case SIGINT: cerr << "# Continuing." << endl; break; case SIGQUIT: cerr << "# Quitting." << endl; signal (SIGQUIT, SIG_DFL); raise (SIGQUIT); break; default: cerr << "# Warning: make_ode2odes needs updating!" << endl; signal (signum, SIG_DFL); raise (signum); break; } } void set_signal_handlers (void) { signal (SIGFPE, handle_signal); signal (SIGINT, handle_signal); signal (SIGQUIT, handle_signal); } int main (void) { set_signal_handlers (); #else DEFUN_DLD (${sys}_ode2odes, args, , "Octave ode2odes representation of system with $method integration method Usage: ${sys}_ode2odes (x, par, simpar) ") { static octave_value_list retval; |
︙ | ︙ |