NumThreads object renamed OMPThreads

这个提交包含在:
Craig Warren
2021-03-09 10:05:42 +00:00
父节点 2e66a2060a
当前提交 70e22b2ac3
共有 2 个文件被更改,包括 4 次插入7 次删除

查看文件

@@ -28,7 +28,7 @@ from .cmds_multiuse import (PMLCFS, AddDebyeDispersion, AddDrudeDispersion,
Material, Rx, RxArray, Snapshot, SoilPeplinski,
TransmissionLine, VoltageSource, Waveform)
from .cmds_singleuse import (Discretisation, Domain, ExcitationFile,
NumThreads, PMLCells, RxSteps, SrcSteps,
OMPThreads, PMLCells, RxSteps, SrcSteps,
TimeStepStabilityFactor, TimeWindow, Title)
from .gprMax import run as run
from .hash_cmds_file import user_libs_fn_to_scene_obj

查看文件

@@ -22,12 +22,9 @@ from pathlib import Path
import gprMax.config as config
import numpy as np
from colorama import Fore, Style, init
init()
from scipy import interpolate
from scipy.constants import c
from .utilities import round_value, set_omp_threads
from .utilities import set_omp_threads
from .waveforms import Waveform
logger = logging.getLogger(__name__)
@@ -206,7 +203,7 @@ class TimeWindow(UserObjectSingle):
logger.info(f'Time window: {G.timewindow:g} secs ({G.iterations} iterations)')
class NumThreads(UserObjectSingle):
class OMPThreads(UserObjectSingle):
"""Allows you to control how many OpenMP threads (usually the number of
physical CPU cores available) are used when running the model.
@@ -222,7 +219,7 @@ class NumThreads(UserObjectSingle):
try:
n = self.kwargs['n']
except KeyError:
logger.exception(self.__str__() + ' requires exactly one parameter to specify the number of threads to use')
logger.exception(self.__str__() + ' requires exactly one parameter to specify the number of CPU OpenMP threads to use')
raise
if n < 1:
logger.exception(self.__str__() + ' requires the value to be an integer not less than one')