Versions
FLUKA: 4-5.1
Flair: 3.4-5.2
Good afternoon,
I’m having trouble trying to perform CAD file conversion into an unstructured mesh by using the Python script FLUKA_mesh_fix.py. In particular, the following RunTimeError is returned (I installed Gmsh and MeshLib version 3.0.2.183):
user-be@macbe17169 geom_mesh_utils % python FLUKA_mesh_fix.py stellarator/Stellarator_Wendelstein.3mf
Reading from: stellarator/Stellarator_Wendelstein.3mf
Meshing without healing, errors to be identified…
Using OFF for meshlib conversion
Bounding box center for the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x10ebf9a70>
Min. corner of the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x10ebf9a70>
Max. corner of the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x10ebf9a70>
Bounding box dimensions: <meshlib.mrmeshpy.Vector3f object at 0x10ebf9a70>
Mesh 1 has 764 nodes
Info : Reading ‘stellarator/tmp.off’…
Info : Done reading ‘stellarator/tmp.off’
Backup created at mesh_log.txt_20251126_161520.bkp
Reading from: stellarator/Stellarator_Wendelstein.3mf
Meshing without healing, errors to be identified…
Using OFF for meshlib conversion
Bounding box center for the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x117e3fc70>
Min. corner of the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x117e3fc70>
Max. corner of the full initial mesh: <meshlib.mrmeshpy.Vector3f object at 0x117e3fc70>
Bounding box dimensions: <meshlib.mrmeshpy.Vector3f object at 0x117e3fc70>
Mesh 1 has 764 nodes
Info : Reading ‘stellarator/tmp.off’…
Info : Done reading ‘stellarator/tmp.off’
Traceback (most recent call last):
File “”, line 1, in
from multiprocessing.spawn import spawn_main; spawn_main**(tracker_fd=8, pipe_handle=19)**
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 122, in spawn_main
exitcode = _main(fd, parent_sentinel)
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 131, in _main
prepare**(preparation_data)**
~~~~~~~^^^^^^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 246, in prepare
_fixup_main_from_path**(data[‘init_main_from_path’])**
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 297, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
run_name=“_mp_main_”)
File “”, line 287, in run_path
File “”, line 98, in _run_module_code
File “”, line 88, in _run_code
File “/Users/user-be/Downloads/input/geom_mesh_utils/FLUKA_mesh_fix.py”, line 516, in
file_path=process_meshes_with_error_handling(args)
File “/Users/user-be/Downloads/input/geom_mesh_utils/FLUKA_mesh_fix.py”, line 446, in process_meshes_with_error_handling
to_heal = detect_mesh_errors(to_heal)
File “/Users/user-be/Downloads/input/geom_mesh_utils/FLUKA_mesh_fix.py”, line 266, in detect_mesh_errors
with multiprocessing.Pool**(processes=1)** as pool:
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/context.py”, line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/pool.py”, line 215, in _init_
self._repopulate_pool**()**
~~~~~~~~~~~~~~~~~~~~~^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/pool.py”, line 306, in _repopulate_pool
return self._repopulate_pool_static**(self._ctx, self.Process,**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
self._processes,
^^^^^^^^^^^^^^^^
…<3 lines>…
self._maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^
self._wrap_exception)
^^^^^^^^^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/pool.py”, line 329, in _repopulate_pool_static
w.start**()**
~~~~~~~^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/process.py”, line 121, in start
self._popen = self._Popen**(self)**
~~~~~~~~~~~^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/context.py”, line 289, in _Popen
return Popen(process_obj)
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/popen_spawn_posix.py”, line 32, in _init_
super()._init_(process_obj)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/popen_fork.py”, line 20, in _init_
self._launch**(process_obj)**
~~~~~~~~~~~~^^^^^^^^^^^^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/popen_spawn_posix.py”, line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 164, in get_preparation_data
_check_not_importing_main**()**
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py”, line 140, in _check_not_importing_main
raise RuntimeError(‘’’
…<16 lines>…
‘’')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if _name_ == ‘_main_’:
freeze_support()
…
The “freeze_support()” line can be omitted if the program
is not going to be frozen to produce an executable.
To fix this issue, refer to the “Safe importing of main module”
section in https://docs.python.org/3/library/multiprocessing.htmlInput files
Do you have any suggestion to fix it?
Thank you in advance
FLUKA_mesh_fix.py (17.6 KB)