amalgam-lang 10.2.0__py3-none-win_amd64.whl → 10.2.1__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of amalgam-lang might be problematic. Click here for more details.

amalgam/api.py CHANGED
@@ -63,7 +63,7 @@ class Amalgam:
63
63
  appropriate library bundled with the package.
64
64
 
65
65
  append_trace_file : bool, default False
66
- If True, new content will be appended to a tracefile if the file
66
+ If True, new content will be appended to a trace file if the file
67
67
  already exists rather than creating a new file.
68
68
 
69
69
  execution_trace_dir : Union[str, None], default None
@@ -87,12 +87,12 @@ class Amalgam:
87
87
  it within library_path. If neither are available, -mt (multi-threaded)
88
88
  will be used.
89
89
 
90
- max_num_threads : int, default 0
90
+ max_num_threads : int or None, default None
91
91
  If a multithreaded Amalgam binary is used, sets the maximum number
92
92
  of threads to the value specified. If 0, will use the number of
93
- visible logical cores.
93
+ visible logical cores. Default None will not attempt to set this value.
94
94
 
95
- sbf_datastore_enabled : bool, default False
95
+ sbf_datastore_enabled : bool or None, default None
96
96
  If true, sbf tree structures are enabled.
97
97
 
98
98
  trace : bool, optional
@@ -118,8 +118,8 @@ class Amalgam:
118
118
  execution_trace_file: str = "execution.trace",
119
119
  gc_interval: Optional[int] = None,
120
120
  library_postfix: Optional[str] = None,
121
- max_num_threads: int = 0,
122
- sbf_datastore_enabled: bool = True,
121
+ max_num_threads: Optional[int] = None,
122
+ sbf_datastore_enabled: Optional[bool] = None,
123
123
  trace: Optional[bool] = None,
124
124
  **kwargs
125
125
  ):
@@ -168,8 +168,10 @@ class Amalgam:
168
168
  _logger.debug(f"Loading amalgam library: {self.library_path}")
169
169
  _logger.debug(f"SBF_DATASTORE enabled: {sbf_datastore_enabled}")
170
170
  self.amlg = cdll.LoadLibrary(str(self.library_path))
171
- self.set_amlg_flags(sbf_datastore_enabled)
172
- self.set_max_num_threads(max_num_threads)
171
+ if sbf_datastore_enabled is not None:
172
+ self.set_amlg_flags(sbf_datastore_enabled)
173
+ if max_num_threads is not None:
174
+ self.set_max_num_threads(max_num_threads)
173
175
  self.gc_interval = gc_interval
174
176
  self.op_count = 0
175
177
  self.load_command_log_entry = None
@@ -378,6 +380,22 @@ class Amalgam:
378
380
  self.amlg.SetSBFDataStoreEnabled.restype = c_void_p
379
381
  self.amlg.SetSBFDataStoreEnabled(sbf_datastore_enabled)
380
382
 
383
+ def get_max_num_threads(self) -> None:
384
+ """
385
+ Get the maximum number of threads currently set.
386
+
387
+ Returns
388
+ -------
389
+ int
390
+ The maximum number of threads that Amalgam is configured to use.
391
+ """
392
+ self.amlg.GetMaxNumThreads.restype = c_size_t
393
+ self._log_execution("GET_MAX_NUM_THREADS")
394
+ result = self.amlg.GetMaxNumThreads()
395
+ self._log_reply(result)
396
+
397
+ return result
398
+
381
399
  def set_max_num_threads(self, max_num_threads: int = 0) -> None:
382
400
  """
383
401
  Set the maximum number of threads.
@@ -393,7 +411,10 @@ class Amalgam:
393
411
  """
394
412
  self.amlg.SetMaxNumThreads.argtype = [c_size_t]
395
413
  self.amlg.SetMaxNumThreads.restype = c_void_p
396
- self.amlg.SetMaxNumThreads(max_num_threads)
414
+
415
+ self._log_execution(f"SET_MAX_NUM_THREADS {max_num_threads}")
416
+ result = self.amlg.SetMaxNumThreads(max_num_threads)
417
+ self._log_reply(result)
397
418
 
398
419
  def reset_trace(self, file: str) -> None:
399
420
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: amalgam-lang
3
- Version: 10.2.0
3
+ Version: 10.2.1
4
4
  Summary: A direct interface with Amalgam compiled DLL or so.
5
5
  Author: Howso Incorporated
6
6
  Author-email: support@howso.com
@@ -1,13 +1,13 @@
1
1
  amalgam/__init__.py,sha256=oHu7Zr4eGDUqj93pLwz8t7gLa8lpAx6Q-xbGiJ3nJx0,18
2
- amalgam/api.py,sha256=jNrmNzRdkKTym8B0QHLA-nDUFbCtjwimgDX9Uub5rUI,40993
2
+ amalgam/api.py,sha256=QA6DergDlzIXBMqX3IXXFCf2aH2pq4idzE-M-kllMSQ,41743
3
3
  amalgam/lib/version.json,sha256=I_6PbMYKAwRLF1eNCDaVtpxy54r414bsEWcZC36PrFc,250
4
4
  amalgam/lib/windows/amd64/amalgam-mt-noavx.dll,sha256=xcG_tSRwnkcf5x57UKWF9vYsYLhxvu4kxN4wYmzd_7g,2670592
5
5
  amalgam/lib/windows/amd64/amalgam-mt.dll,sha256=ID1IN22gaP6y1RxHAftQLUtx0x689Q1oSnOkuZa9CmA,2598400
6
6
  amalgam/lib/windows/amd64/amalgam-omp.dll,sha256=LLc8E8HCVJtksmTBgXxUgg4xcIs9l7JKNUJuKHGi1wo,2526720
7
7
  amalgam/lib/windows/amd64/amalgam-st.dll,sha256=5y_Sna1820cbUyGj1ilvS1cFGX169IwSFPT_dFlRcdk,2508288
8
8
  amalgam/lib/windows/amd64/docs/version.json,sha256=VYLKilIYan9EUOptRNi-HzezZkWMwBiASseQD-RxzbQ,27
9
- amalgam_lang-10.2.0.dist-info/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
10
- amalgam_lang-10.2.0.dist-info/METADATA,sha256=YXYeOy5BoIhpYwfET-aHc0JWKE5eOrtrCZZINN1w-VE,43353
11
- amalgam_lang-10.2.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
- amalgam_lang-10.2.0.dist-info/top_level.txt,sha256=rmPHU144SyaB25u5-FAQyECAQnJ39NvuJEcKXMRcdBo,8
13
- amalgam_lang-10.2.0.dist-info/RECORD,,
9
+ amalgam_lang-10.2.1.dist-info/LICENSE.txt,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
10
+ amalgam_lang-10.2.1.dist-info/METADATA,sha256=MWn9LneRaOZlC_m358JmAJ3JolujGk5d46rwwZsIEXI,43353
11
+ amalgam_lang-10.2.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
+ amalgam_lang-10.2.1.dist-info/top_level.txt,sha256=rmPHU144SyaB25u5-FAQyECAQnJ39NvuJEcKXMRcdBo,8
13
+ amalgam_lang-10.2.1.dist-info/RECORD,,