Limit CPU in python interface

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
dom11990
Posts: 18
Joined: Mon 10 Jun 2019, 10:16

Limit CPU in python interface

Post by dom11990 » Sun 22 Aug 2021, 07:11

Hello,

I'm using the python interface and I would like to limit the cpu / thread count otherwise my 64 core machine simulates at about 8MC/s. Is there a way to do this in the python API?

cheers
dominik

dom11990
Posts: 18
Joined: Mon 10 Jun 2019, 10:16

Re: Limit CPU in python interface

Post by dom11990 » Sun 22 Aug 2021, 07:13

Found it:

Code: Select all

def Run(self, sim_path, cleanup=False, setup_only=False, debug_pec=False, verbose=None, **kw):
        """ Run(sim_path, cleanup=False, setup_only=False, verbose=None)
        Run the openEMS FDTD simulation.
        :param sim_path: str -- path to run in and create result data
        :param cleanup: bool -- remove exisiting sim_path to cleanup old results
        :param setup_only: bool -- only perform FDTD setup, do not run simulation
        :param verbose: int -- set the openEMS verbosity level 0..3
        Additional keyword parameter:
        :param numThreads: int -- set the number of threads (default 0 --> max)
        """

Post Reply