Add MPI capability for Xyce threading.

This commit is contained in:
mrg 2021-05-14 11:45:37 -07:00
parent 507ad9f33d
commit 7534610cdd
2 changed files with 19 additions and 0 deletions

View File

@ -33,6 +33,12 @@ if not OPTS.analytical_delay:
else:
(OPTS.spice_name, OPTS.spice_exe) = get_tool("spice", ["Xyce", "ngspice", "ngspice.exe", "hspice", "xa"])
if OPTS.spice_name == "Xyce":
(OPTS.mpi_name, OPTS.mpi_exe) = get_tool("mpi", ["mpirun"])
else:
OPTS.mpi_name = None
OPTS.mpi_exe = ""
# set the input dir for spice files if using ngspice
if OPTS.spice_name == "ngspice":
os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp)

View File

@ -358,6 +358,19 @@ class stimuli():
temp_stim,
OPTS.openram_temp)
valid_retcode=0
elif OPTS.spice_name == "Xyce":
if OPTS.num_sim_threads > 1 and OPTS.mpi_name:
mpi_cmd = "{0} -np {1}".format(OPTS.mpi_exe,
OPTS.num_sim_threads)
else:
mpi_cmd = ""
cmd = "{0} {1} -o {3}timing.lis {2}".format(mpi_cmd,
OPTS.spice_exe,
temp_stim,
OPTS.openram_temp)
valid_retcode=0
else:
# ngspice 27+ supports threading with "set num_threads=4" in the stimulus file or a .spiceinit
# Measurements can't be made with a raw file set in ngspice