2 * Copyright (C) 2001 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 *------------------------------------------------------------------
22 * Displays the status of the system. Makes all the calculations associated
23 * with allocating memory but does not actually allocate it, unless necessary
24 * to make the rest of the calculations.
26 * If "allocate" is changed, this must also be changed.
28 #include "u_sim_data.h"
32 /*--------------------------------------------------------------------------*/
34 /*--------------------------------------------------------------------------*/
35 class CMD_STATUS
: public CMD
{
37 void do_it(CS
& cmd
, CARD_LIST
*)
39 IO::mstdout
<< "Gnucap System status\n";
43 trace1("status", what
);
44 if(CKT_BASE
* c
= status_dispatcher
[what
]){ itested();
45 IO::mstdout
<< c
->status();
52 if (!cmd
.umatch("n{otime} ")) {
53 ::status
.compute_overhead();
55 << "command ------ last -- total\n"
62 << "function ----- last -- total\n"
65 << "function ----- last -- total\n"
82 IO::mstdout
<< ::status
.total
;
86 << "iterations: op=" << _sim
->_iter
[s_OP
]
87 << ", dc=" << _sim
->_iter
[s_DC
]
88 << ", tran=" << _sim
->_iter
[s_TRAN
]
89 << ", fourier=" << _sim
->_iter
[s_FOURIER
]
90 << ", total=" << _sim
->_iter
[iTOTAL
]
92 for(DISPATCHER
<CKT_BASE
>::const_iterator
93 i
= status_dispatcher
.begin();
94 i
!= status_dispatcher
.end();
96 CKT_BASE
* c
= i
->second
;
98 IO::mstdout
<< c
->status();
103 << "nodes: user=" << _sim
->_user_nodes
104 << ", subckt=" << _sim
->_subckt_nodes
105 << ", model=" << _sim
->_model_nodes
106 << ", total=" << _sim
->_total_nodes
108 IO::mstdout
.form("dctran density=%.1f%%, ac density=%.1f%%\n",
109 _sim
->_aa
.density()*100., _sim
->_acx
.density()*100.);
112 DISPATCHER
<CMD
>::INSTALL
d(&command_dispatcher
, "status", &p
);
113 /*--------------------------------------------------------------------------*/
115 /*--------------------------------------------------------------------------*/
116 /*--------------------------------------------------------------------------*/
117 // vim:ts=8:sw=2:noet: