PyFemtet 0.3.1__tar.gz → 0.3.2__tar.gz
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.
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/PKG-INFO +1 -1
- pyfemtet-0.3.2/pyfemtet/__init__.py +1 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/dispatch_extensions.py +15 -8
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyproject.toml +1 -1
- pyfemtet-0.3.1/pyfemtet/__init__.py +0 -1
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/LICENSE +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/README.md +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/NX_ex01/NX_ex01.femprj +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/NX_ex01/NX_ex01.prt +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/NX_ex01/NX_ex01.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/gau_ex08_parametric.femprj +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/gau_ex08_parametric.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/her_ex40_parametric.femprj +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/her_ex40_parametric.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/wat_ex14_parallel_parametric.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/wat_ex14_parametric.femprj +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/FemtetPJTSample/wat_ex14_parametric.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/_old/_SW_Femtet.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/core.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/_FemtetWithNX/update_model.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/__init__.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/_optimizer.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/base.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/interface.py +0 -0
- {pyfemtet-0.3.1 → pyfemtet-0.3.2}/pyfemtet/opt/monitor.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.2"
|
|
@@ -23,7 +23,7 @@ logger = logging.getLogger('dispatch_log')
|
|
|
23
23
|
handler = logging.StreamHandler()
|
|
24
24
|
handler.setFormatter(logging.Formatter('[%(process)d] %(message)s'))
|
|
25
25
|
logger.addHandler(handler)
|
|
26
|
-
|
|
26
|
+
logger.setLevel(logging.INFO)
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
DISPATCH_TIMEOUT = 60
|
|
@@ -285,13 +285,12 @@ def _block_other_femtets(
|
|
|
285
285
|
start = time()
|
|
286
286
|
while True:
|
|
287
287
|
if connection_flags[-1]:
|
|
288
|
-
|
|
288
|
+
logger.debug(f'{_log_prefix()}Main process seems to connect target Femtet. Exit immediately.')
|
|
289
|
+
return 1
|
|
289
290
|
if time()-start > timeout_main_wait_for_us:
|
|
290
291
|
logger.error(f'{_log_prefix()}Timed out while waiting for the main process.')
|
|
291
292
|
return -1
|
|
292
293
|
sleep(1)
|
|
293
|
-
logger.debug(f'{_log_prefix()}Main process seems to connect target Femtet. Exit immediately.')
|
|
294
|
-
return 1
|
|
295
294
|
|
|
296
295
|
|
|
297
296
|
def dispatch_specific_femtet(pid, timeout=DISPATCH_TIMEOUT) -> Tuple[IFemtet, int]:
|
|
@@ -323,7 +322,7 @@ def dispatch_specific_femtet(pid, timeout=DISPATCH_TIMEOUT) -> Tuple[IFemtet, in
|
|
|
323
322
|
return dispatch_specific_femtet_core(pid, timeout) # for logger, out of except.
|
|
324
323
|
|
|
325
324
|
|
|
326
|
-
def dispatch_specific_femtet_core(pid, timeout=
|
|
325
|
+
def dispatch_specific_femtet_core(pid, timeout=DISPATCH_TIMEOUT) -> Tuple[IFemtet, int]:
|
|
327
326
|
"""Connect Femtet whose process id is specified.
|
|
328
327
|
|
|
329
328
|
Warnings:
|
|
@@ -394,6 +393,7 @@ def dispatch_specific_femtet_core(pid, timeout=10) -> Tuple[IFemtet, int]:
|
|
|
394
393
|
|
|
395
394
|
# 子プロセスの準備
|
|
396
395
|
# with Manager() as manager:
|
|
396
|
+
start = time()
|
|
397
397
|
from multiprocessing.managers import SyncManager
|
|
398
398
|
m = SyncManager(ctx=_NestableSpawnContext())
|
|
399
399
|
m.start()
|
|
@@ -423,11 +423,18 @@ def dispatch_specific_femtet_core(pid, timeout=10) -> Tuple[IFemtet, int]:
|
|
|
423
423
|
processes.append(p)
|
|
424
424
|
|
|
425
425
|
# 子プロセスの Dispatch 完了を待つ
|
|
426
|
-
start = time()
|
|
427
426
|
while True:
|
|
428
427
|
if all(connection_flags[:-1]):
|
|
429
428
|
break
|
|
430
|
-
if time()-start >
|
|
429
|
+
if time()-start > timeout:
|
|
430
|
+
# 子プロセスを終了する
|
|
431
|
+
for p in processes:
|
|
432
|
+
p.terminate()
|
|
433
|
+
p.join()
|
|
434
|
+
try:
|
|
435
|
+
lock_inter_subproc.release()
|
|
436
|
+
except RuntimeError:
|
|
437
|
+
pass
|
|
431
438
|
raise FemtetConnectionTimeoutError(f'Connect trial with specific Femtet (pid = {pid}) is timed out in {timeout} sec')
|
|
432
439
|
sleep(1)
|
|
433
440
|
|
|
@@ -458,5 +465,5 @@ def dispatch_specific_femtet_core(pid, timeout=10) -> Tuple[IFemtet, int]:
|
|
|
458
465
|
|
|
459
466
|
|
|
460
467
|
if __name__ == '__main__':
|
|
461
|
-
_Femtet, _my_pid = launch_and_dispatch_femtet()
|
|
468
|
+
_Femtet, _my_pid = launch_and_dispatch_femtet(5)
|
|
462
469
|
# _Femtet, _my_pid = dispatch_specific_femtet(pid=26124)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyfemtet"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2" # ignored by versioning plugin
|
|
4
4
|
description = "Design parameter optimization using Femtet."
|
|
5
5
|
authors = ["kazuma.naito <kazuma.naito@murata.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|