Menu

#72 Parallel Simulation

v1.0 (example)
open
None
5
2024-11-14
2024-11-09
No

Hi h_vogt,
I would like to ask for the possibility of doing simulation in parallel using ngspice.
Regards,
Carlos

Discussion

  • Holger Vogt

    Holger Vogt - 2024-11-09

    Please define what you mean by "parallel simulation".

     
    • Carlos Martin Cañal

      Hi again,
      what I want to say with parallel simulation" is if there is a way to cut
      the circuit in some parts and simulate each part in a ngspice process.
      Carlos

       

      Last edit: Holger Vogt 2024-11-09
  • Holger Vogt

    Holger Vogt - 2024-11-09

    Some time ago I have made a small study on parallel simulation with ngspice shared libraries, see https://ngspice.sourceforge.io/parallel.html .

    This would require a lot of work (concept and programming of a calling program). Concepts for circuit patitioning and simulation synchronization would be the major tasks to get this up and running..

     
    • Carlos Martin Cañal

      Hi,
      i am trying your code, but in this moment I am working in Linux and I have
      some problems to compile the project because some Windows functions are used
      Could you change the code to compile in linux?
      Thanks in advance
      Carlos

       

      Last edit: Holger Vogt 2024-11-10
      • Holger Vogt

        Holger Vogt - 2024-11-10

        Replace sharedngspice.h with the current version (https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/src/include/ngspice/sharedspice.h)

        Compile shared ngspice (see script compile_linux_shared.sh)

        Copy libngspice.so to libngspice2.so and libngspice3.so

        Go to the dir containing main.c.

        Try running
        gcc main.c -m64 -Wall -s -lpthread -ldl -o ./bin/Release/ng_sync

         

        Last edit: Holger Vogt 2024-11-10
        • Carlos Martin Cañal

          Ok!, I've got to compile and execute it. I don't have to copy any library
          .so to compile.
          Thanks
          Carlos

           

          Last edit: Holger Vogt 2024-11-11
          • Holger Vogt

            Holger Vogt - 2024-11-10

            But you will need libngspice.so to run it!

            Please don't reply with copying the old text contents. If you look at https://sourceforge.net/p/ngspice/support-requests/72/, that is annoying.

             
  • Francesco Lannutti

    Hi all,
    parallelizing in this way is called FastSPICE, while NGSPICE is a pure SPICE simulator.

    Thank you,
    Fra

     
  • Carlos Martin Cañal

    Regarding to copy text, I answer to you by gmail, and the text is copied automatically.
    And I could run the program because previously, I installed the shared library.
    So the problem is fixed.
    Thanks,
    Carlos

     

    Last edit: Carlos Martin Cañal 2024-11-11
  • Holger Vogt

    Holger Vogt - 2024-11-11

    Regarding to copy text, I answer to you by gmail, and the text is copied automatically.

    Then please delete it manually before sending a reply.

    I would be interested in hearing about your new insights when dealing with parallel simulation.

     
  • Carlos Martin Cañal

    Ok, I will take it into account .
    Regarding the parallel simulation, I will develop it slowly because I can't dedicate it much time,
    but I will inform you about my progress.
    Carlos

     
  • Carlos Martin Cañal

    One question, to show the .raw output file from simulation, what program could I use to show them?

     
  • Holger Vogt

    Holger Vogt - 2024-11-11

    Use ngspice, with the 'load' command.

     
  • Carlos Martin Cañal

    Ok, now I have another problem: 'Can't open viewport for graphics'. I've revised the library and they are installed. I've installed using the 'compile_linux_dist.sh' script

     
  • Carlos Martin Cañal

    Solved! I've reinstalled the ngspice

     
  • Carlos Martin Cañal

    I've been thinking about in the parallel simulation, and I have a doubt, as you carried out the parallelization, you can send voltage or current, but not both. The idea would be to parallelize the solver, since each subpart of the whole circuit shares currents and voltages in the common nodes each other and they should be solved together. Your solution can be used in firstly stage of the design but no for more serious simulations. In this case, the solver should be parallelized.
    Carlos

     

    Last edit: Carlos Martin Cañal 2024-11-12
  • Carlos Martin Cañal

    I was thinking about that, I found a library called MUMPS: MUltifrontal Massively Parallel sparse direct Solver, I dont't know if it is useful, but it could be taken a look to check it.
    Regards,
    Carlos

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.