From: Dietmar W. <die...@ar...> - 2012-11-19 13:17:35
|
Yash, wrt. BE your comment is not absolute correct: You can use .option maxord=1 to switch trapez to BE. (See also niiter.c.) But not testet so much! Dietmar ----- Original Nachricht ---- Von: Yash Dosi <yas...@gm...> An: "Ngspice developers mailing list." <ngs...@li...> Datum: 19.11.2012 08:13 Betreff: Re: [Ngspice-devel] Thread in DCtran > Hey Francesco, > Extremely sorry for the late reply. But I have terribly busy lately. > But I believe our ngspice versions are different. I have ngspice-24. > And in the end of DCtran.c there is no call to CKTerr routine. > Also ngspice-24 does not have BE implementation also. It just has Trap & > Gear. > > Another thing after studying the data-dependency for the ckt structure I > think creating another duplicate instance is the only solution. So I have > started working in that direction. > Please do correct me if I am wrong. > > On Mon, Nov 5, 2012 at 6:40 PM, Francesco Lannutti > <nic...@fa...>wrote: > > > Hi Yash, > > standing to the article they predict the next time point using FE method, > > because it's explicit, but I have to say it's not accurate. > > In SPICE and NGSPICE too, the time point is handled like this: > > 1) At the end of DCtran.c you will find a call to CKTterr routine. > > 2) This is a wrapper on the DEVtrunc routines that compute the local > > truncation error performed by every model serially, calling the CKTtrunc > > routine. > > 3) This step adjusts the proposed time step. > > 4) Goto next point. > > > > Without this check you cannot proceed along a verified time step path. In > > the paper it seems they compute some time points assuming the correctness > > of the prediction through FE. Only after that, they control the > correctness > > using one of inter-thread communication, that will require something like > a > > critical section or atomic routines. > > IMHO this is not the correct way to proceed to have a huge parallelism. > > > > BTW, to achieve the same results you have to touch: > > 1) The end part of the DCtran.c , changing the way to check the next time > > step correctness ; > > 2) The NIiter.c , in which the Newton-Raphson Cycle is coded, in order to > > handle the inter-thread communication in the NR Cycle ; > > 3) The NIinteg.c , in which the Integration Methods are coded, in order > to > > add the FE Method, because NGSPICE only has BE, Trapezoidal and Gear > method. > > > > This as starting point. > > Think about the option to start from the GIT master branch? > > > > Good luck with that ! :) > > > > Fra > > > > > > Il giorno 05/nov/2012, alle ore 13:36, Yash Dosi <yas...@gm...> ha > > scritto: > > > > Hi Francesco & Stefano, > > I don't think this is completely impossible. > > Some work related to parallelizing Gear Method is already done. Have > a > > look at this: > > http://dl.acm.org/citation.cfm?id=1391531 > > For a start I can just try to implement this in ngspice. > > > > By the way, thanks for warning me about the cloning ckt. > > Can this be done? > > If yes how or some direction in which I can proceed? > > > > On Mon, Nov 5, 2012 at 5:05 PM, Francesco Lannutti > <nic...@fa... > > > wrote: > > > >> 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 > >> > >> > >> > >> > >> > ---------------------------------------------------------------------------- > -- > >> 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 > > > > > > > -------------------------------- > > ---------------------------------------------------------------------------- > -- > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > > -------------------------------- > > _______________________________________________ > Ngspice-devel mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-devel > |