testing
[gnucap-felix.git] / src / c_status.cc
blob296032a79d33c2da7f99ca7b48372c612a72c41c
1 /* -*- C++ -*-
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)
10 * any later version.
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
20 * 02110-1301, USA.
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"
29 #include "u_status.h"
30 #include "c_comand.h"
31 #include "globals.h"
32 /*--------------------------------------------------------------------------*/
33 namespace {
34 /*--------------------------------------------------------------------------*/
35 class CMD_STATUS : public CMD {
36 public:
37 void do_it(CS& cmd, CARD_LIST*)
39 IO::mstdout << "Gnucap System status\n";
41 string what;
42 cmd >> what;
43 trace1("status", what);
44 if(CKT_BASE* c = status_dispatcher[what]){ itested();
45 IO::mstdout << c->status();
46 return;
47 }else{
48 cmd.reset();
49 cmd >> what;
52 if (!cmd.umatch("n{otime} ")) {
53 ::status.compute_overhead();
54 IO::mstdout
55 << "command ------ last -- total\n"
56 << ::status.get
57 << ::status.op
58 << ::status.dc
59 << ::status.tran
60 << ::status.four
61 << ::status.ac
62 << "function ----- last -- total\n"
63 << ::status.set_up
64 << ::status.order
65 << "function ----- last -- total\n"
66 << ::status.advance
67 << ::status.queue
68 << ::status.evaluate
69 << ::status.load
70 << ::status.lud
71 << ::status.back
72 << ::status.review
73 << ::status.accept
74 << ::status.output
75 << ::status.overhead;
76 if (OPT::showall) {
77 IO::mstdout
78 << ::status.aux1
79 << ::status.aux2
80 << ::status.aux3;
82 IO::mstdout << ::status.total;
85 IO::mstdout
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]
91 << "\n";
92 for(DISPATCHER<CKT_BASE>::const_iterator
93 i = status_dispatcher.begin();
94 i != status_dispatcher.end();
95 ++i) {
96 CKT_BASE* c = i->second;
97 if (c) {
98 IO::mstdout << c->status();
99 }else{
102 IO::mstdout
103 << "nodes: user=" << _sim->_user_nodes
104 << ", subckt=" << _sim->_subckt_nodes
105 << ", model=" << _sim->_model_nodes
106 << ", total=" << _sim->_total_nodes
107 << "\n";
108 IO::mstdout.form("dctran density=%.1f%%, ac density=%.1f%%\n",
109 _sim->_aa.density()*100., _sim->_acx.density()*100.);
111 } p;
112 DISPATCHER<CMD>::INSTALL d(&command_dispatcher, "status", &p);
113 /*--------------------------------------------------------------------------*/
115 /*--------------------------------------------------------------------------*/
116 /*--------------------------------------------------------------------------*/
117 // vim:ts=8:sw=2:noet: