From: Francesco L. <nic...@fa...> - 2012-11-05 11:35:49
|
Hi Yash, summarizing your intent, you want to parallelize the execution of one integration method, let's say Gear or Trapezoidal. If so, I have to agree with Stefano, you cannot do that in my opinion, because you are trying to parallelize something that is intrinsically serial. However, the integration method is calculated by NIintegrate under src/maths/ni and it uses some state vector, depending on how many time points in the past you want to track (DCtran uses at the most 4 time steps in the past because of Gear). Don't clone the CKT data structure, otherwise you will clone all the NGSPICE core. Regards, Fra Il giorno 05/nov/2012, alle ore 12:02, Stefano Perticaroli <spe...@gm...> ha scritto: > > > 2012/11/5 Yash Dosi <yas...@gm...> > Hey Stefano, > > Hi Yash, > Thanks for the reply. > But after reading your reply I think I started in the wrong direction. Let me rephrase my objective. My target is to modify numerical integration in ngspice using threads, also my primary goal is to just use threads in the Gear Method's implementation in ngspice. > I have already explained how I intend to introduce threads in this modification in my previous mail. It is something like forward pipelining. > > IMHO for Gear Methods you need at least three accepted time points in past to compute the next one. > > I mean, every consequent time step depends on the previous ones. The more higher order for integration to use, the longer time accuracy in the past you need. > > As I told you before, since the algorithm for time evolution is implicitly 'serial and heuristic' I think parallelization cannot be based on prediction in the general case. > > The only thing you can imagine is to test in a parallel way the efficiency of different integration methods. > > Regards. > Extending this to trapezoidal Method's implementation is desirable but not compulsory. > > I started with DCtran because I thought that was one of the places where Gear Method was used. > But I think that was not the correct place to start. > > Can you please now point me in the correct direction. > > On Nov 5, 2012 3:04 PM, "Stefano Perticaroli" <spe...@gm...> wrote: > > > 2012/11/5 Yash Dosi <yas...@gm...> > Hello People! > > Hi Yash, > > As a part of my project I am trying to modify the DCtran Analysis using threads. > This is my idea so far.. > > since I'm involved in the modifying of the DCtran for PSS Analysis I try to point out some considerations to your idea. > > > 1. Create a duplicate instance of ckt. > 2. Obtain an approximate solution of the current time point. (terminating the NIiter call early). > 3. Use this approximate solution to calculate a future time point using the duplicate instance. > 4. Check the convergence conditions and then accept or reject the computed solutions. > > In Transient Analysis there are two convergence conditions checked at any time step: the first one regards the DC solution needed to calculate their operating point, the second one regards the truncation error of integrator's time evolution. > > The NIiter is about the operating point, it is in fact called in CKTop.c (that in turn is called by DCop.c). > > When you terminate the NIter early, even if one of devices is solved into a different operating mode, the next time step (what you call 'future') is certainly wrong and it could also never converge. > > > > And this is my doubt: > Do I need to create a duplicate of the entire ckt structure. (Because it will only result in more memory usage and addition of redundant code which will slow the entire process down.)? > > The CKT structure contains a lot of things. You would need to consider the CKTmatrix only for solving operating points and integrating time evolution, however the CKTmatrix, as it is actually written in the code, requires a quite complete CKT structure. > > The duplication process of a CKT is not a simple task and Ngspice (and so Spice) was not properly developed for that. > > If you need some hints about parallelization you could ask to Francesco Lannutti, he worked on this subject. > > Regards. > > > > Also if I do not need to create a copy the entire ckt instance then which parts do i need to copy of how do I know which parts are required to be copied? > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Ngspice-devel mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-devel > > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Ngspice-devel mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-devel > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Ngspice-devel mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-devel > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d_______________________________________________ > Ngspice-devel mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-devel |