trunk/src/emu/netlist/analog/nld_ms_gauss_seidel.h
| r243150 | r243151 | |
| 21 | 21 | , m_lp_fact(0) |
| 22 | 22 | , m_gs_fail(0) |
| 23 | 23 | , m_gs_total(0) |
| 24 | | {} |
| 24 | { |
| 25 | const char *p = osd_getenv("NETLIST_STATS"); |
| 26 | if (p != NULL) |
| 27 | m_log_stats = (bool) atoi(p); |
| 28 | else |
| 29 | m_log_stats = false; |
| 30 | } |
| 25 | 31 | |
| 26 | 32 | virtual ~netlist_matrix_solver_gauss_seidel_t() {} |
| 27 | 33 | |
| r243150 | r243151 | |
| 35 | 41 | nl_double m_lp_fact; |
| 36 | 42 | int m_gs_fail; |
| 37 | 43 | int m_gs_total; |
| 44 | bool m_log_stats; |
| 38 | 45 | |
| 39 | 46 | }; |
| 40 | 47 | |
| r243150 | r243151 | |
| 45 | 52 | template <int m_N, int _storage_N> |
| 46 | 53 | void netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::log_stats() |
| 47 | 54 | { |
| 48 | | #if 1 |
| 49 | | if (this->m_stat_calculations == 0) |
| 50 | | return; |
| 51 | | printf("==============================================\n"); |
| 52 | | printf("Solver %s\n", this->name().cstr()); |
| 53 | | printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); |
| 54 | | printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); |
| 55 | | printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); |
| 56 | | printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); |
| 57 | | printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", |
| 58 | | this->m_stat_calculations, |
| 59 | | this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), |
| 60 | | this->m_gs_fail, |
| 61 | | 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, |
| 62 | | (double) this->m_gs_total / (double) this->m_stat_calculations); |
| 63 | | #endif |
| 55 | if (this->m_stat_calculations != 0 && m_log_stats) |
| 56 | { |
| 57 | printf("==============================================\n"); |
| 58 | printf("Solver %s\n", this->name().cstr()); |
| 59 | printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); |
| 60 | printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); |
| 61 | printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); |
| 62 | printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); |
| 63 | printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", |
| 64 | this->m_stat_calculations, |
| 65 | this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), |
| 66 | this->m_gs_fail, |
| 67 | 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, |
| 68 | (double) this->m_gs_total / (double) this->m_stat_calculations); |
| 69 | } |
| 64 | 70 | } |
| 65 | 71 | |
| 66 | 72 | template <int m_N, int _storage_N> |
trunk/src/osd/modules/sync/work_osd.c
| r243150 | r243151 | |
| 173 | 173 | osd_work_queue *queue; |
| 174 | 174 | int osdthreadnum = 0; |
| 175 | 175 | int allocthreadnum; |
| 176 | | char *osdworkqueuemaxthreads = osd_getenv(ENV_WORKQUEUEMAXTHREADS); |
| 176 | const char *osdworkqueuemaxthreads = osd_getenv(ENV_WORKQUEUEMAXTHREADS); |
| 177 | 177 | |
| 178 | 178 | // allocate a new queue |
| 179 | 179 | queue = (osd_work_queue *)osd_malloc(sizeof(*queue)); |
| r243150 | r243151 | |
| 612 | 612 | } |
| 613 | 613 | else |
| 614 | 614 | { |
| 615 | | char *procsoverride; |
| 616 | 615 | int numprocs = 0; |
| 617 | 616 | |
| 618 | 617 | // if the OSDPROCESSORS environment variable is set, use that value if valid |
| 619 | 618 | // note that we permit more than the real number of processors for testing |
| 620 | | procsoverride = osd_getenv(ENV_PROCESSORS); |
| 619 | const char *procsoverride = osd_getenv(ENV_PROCESSORS); |
| 621 | 620 | if (procsoverride != NULL && sscanf(procsoverride, "%d", &numprocs) == 1 && numprocs > 0) |
| 622 | 621 | return MIN(4 * physprocs, numprocs); |
| 623 | 622 | |
trunk/src/osd/osdcore.h
| r243150 | r243151 | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | /*----------------------------------------------------------------------------- |
| 199 | osd_getenv: return pointer to environment variable |
| 200 | |
| 201 | Parameters: |
| 202 | |
| 203 | name - name of environment variable |
| 204 | |
| 205 | Return value: |
| 206 | |
| 207 | pointer to value |
| 208 | -----------------------------------------------------------------------------*/ |
| 209 | const char *osd_getenv(const char *name); |
| 210 | |
| 211 | |
| 212 | /*----------------------------------------------------------------------------- |
| 199 | 213 | osd_get_physical_drive_geometry: if the given path points to a physical |
| 200 | 214 | drive, return the geometry of that drive |
| 201 | 215 | |