ansys-pyensight-core 0.9.5__py3-none-any.whl → 0.9.7__py3-none-any.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 ansys-pyensight-core might be problematic. Click here for more details.

@@ -627,37 +627,30 @@ class DVS(dvs_base):
627
627
  start = end
628
628
  return parts
629
629
 
630
- def _disassemble_simba_connectivity(self, faces):
631
- i = 0
632
- vertices_per_face = []
633
- connectivity_1d = []
634
- indices = []
635
- while i < len(faces):
636
- indices.append(i)
637
- i += faces[i] + 1
638
- mask = numpy.zeros(faces.shape, dtype=bool)
639
- mask[indices] = True
640
- vertices_per_face = numpy.array(faces[mask])
641
- connectivity_1d = numpy.array(faces[~mask])
642
- connectivity_split = numpy.split(connectivity_1d, numpy.cumsum(vertices_per_face[:-1]))
643
- all_same = numpy.all(numpy.array(vertices_per_face) == vertices_per_face[0])
644
- return connectivity_split, vertices_per_face, all_same
645
-
646
- def send_connectivity(self, part_id, faces: Union[List, numpy.ndarray], ghost=False):
630
+ def send_connectivity(
631
+ self,
632
+ part_id,
633
+ offsets: Union[List, numpy.ndarray],
634
+ faces: Union[List, numpy.ndarray],
635
+ ghost=False,
636
+ ):
647
637
  """Send the connectivity data for the input part.
648
638
 
649
639
  The data will be used for building an element block in DVS.
650
640
  The connectivity array will be split among all the available ranks.
651
- The data are assumed in the following format:
641
+ The faces data are assumed in the following format:
652
642
  [n, i1, i2, ...in, m, j1, j2, ...jn, p, k1, k2, ...kp, ...]
653
- i.e. the first element declares how many vertices are available on the face,
654
- then the following elements will be the indices of the vertices for the specific
655
- face, and so on.
643
+ The offsets data instead:
644
+ [0, n, n+m, n+m+p ....]
645
+ The faces list indicates the IDs of the vertices of each face, in order.
646
+ The offsets lists indicates the index where to find a specific face.
656
647
 
657
648
  Parameters
658
649
  ----------
659
650
  part_id: int
660
651
  the part to define the connectivity for
652
+ offsets: List[int] or numpy array
653
+ the offsets values. The format is described above.
661
654
  faces: List[int] or numpy array
662
655
  the connectivity value. The format is described above.
663
656
  ghost: bool
@@ -671,10 +664,12 @@ class DVS(dvs_base):
671
664
  )
672
665
  if not isinstance(faces, numpy.ndarray):
673
666
  faces = numpy.array(faces)
674
- connectivity_split, vertices_per_face, all_same = self._disassemble_simba_connectivity(
675
- faces
676
- )
667
+ if not isinstance(offsets, numpy.ndarray):
668
+ offsets = numpy.array(offsets)
669
+ vertices_per_face = numpy.diff(offsets)
670
+ connectivity_split = numpy.split(faces, numpy.cumsum(vertices_per_face[:-1]))
677
671
  elem_type = self.ELEMTYPE_N_SIDED_POLYGON
672
+ all_same = numpy.all(numpy.array(vertices_per_face) == vertices_per_face[0])
678
673
  if all_same:
679
674
  num_vertices = vertices_per_face[0]
680
675
  _elem_type = self._elem_type_map.get(num_vertices)
@@ -34,6 +34,12 @@ if TYPE_CHECKING:
34
34
  # See: https://bugs.python.org/issue29288
35
35
  "".encode("idna")
36
36
 
37
+ # The user doesn't know "eth" and "ib" what they mean. Use more meaningful
38
+ # keywords.
39
+ INTERCONNECT_MAP = {"ethernet": "eth", "infiniband": "ib"}
40
+
41
+ MPI_TYPES = ["intel2018", "intel2021", "openmpi"]
42
+
37
43
 
38
44
  class Launcher:
39
45
  """Provides the EnSight ``Launcher`` base class.
@@ -63,6 +69,31 @@ class Launcher:
63
69
  are not supported.
64
70
  launch_web_ui : bool, optional
65
71
  Whether to launch the webUI from EnSight
72
+ use_mpi: str, optional
73
+ If set, EnSight will be launched with the MPI type selected. The valid
74
+ values depend on the EnSight version to be used. The user can see
75
+ the specific list starting the EnSight Launcher manually and specifying the options
76
+ to launch EnSight in parallel and MPI. Here are reported the values for releases
77
+ 2024R2 and 2025R1.
78
+
79
+ =================== =========================================
80
+ Release Valid MPI Types
81
+ =================== =========================================
82
+ 2024R2 intel2021, intel2018, openmpi
83
+ 2025R1 intel2021, intel2018, openmpi
84
+ =================== =========================================
85
+
86
+ The remote nodes must be Linux nodes.
87
+ This option is valid only if a LocalLauncher is used.
88
+ interconnet: str, optional
89
+ If set, EnSight will be launched with the MPI Interconnect selected. Valid values
90
+ are "ethernet", "infiniband". It requires use_mpi to be set.
91
+ If use_mpi is set and interconnect is not, "ethernet" will be used.
92
+ This option is valid only if a LocalLauncher is used.
93
+ server_hosts: List[str], optional
94
+ A list of hostnames where the server processes should be spawned on when MPI is selected.
95
+ If use_mpi is set and server_hosts not, it will default to "localhost".
96
+ This option is valid only if a LocalLauncher is used.
66
97
  """
67
98
 
68
99
  def __init__(
@@ -73,10 +104,26 @@ class Launcher:
73
104
  enable_rest_api: bool = False,
74
105
  additional_command_line_options: Optional[List] = None,
75
106
  launch_webui: bool = False,
107
+ use_mpi: Optional[str] = None,
108
+ interconnect: Optional[str] = None,
109
+ server_hosts: Optional[List[str]] = None,
76
110
  ) -> None:
77
111
  self._timeout = timeout
78
112
  self._use_egl_param_val: bool = use_egl
79
113
  self._use_sos = use_sos
114
+ self._use_mpi = use_mpi
115
+ self._interconnect = interconnect
116
+ if self._use_mpi and self._use_mpi not in MPI_TYPES:
117
+ raise RuntimeError(f"{self._use_mpi} is not a valid MPI option.")
118
+ if self._use_mpi and not self._interconnect:
119
+ self._interconnect = "ethernet"
120
+ if self._interconnect:
121
+ if self._interconnect not in list(INTERCONNECT_MAP.values()):
122
+ raise RuntimeError(f"{self._interconnect} is not a valid MPI interconnect option.")
123
+ self._interconnect = INTERCONNECT_MAP.get(self._interconnect)
124
+ self._server_hosts = server_hosts
125
+ if self._use_mpi and not self._server_hosts:
126
+ self._server_hosts = ["localhost"]
80
127
  self._enable_rest_api = enable_rest_api
81
128
 
82
129
  self._sessions: List[Session] = []
@@ -218,8 +218,16 @@ class LocalLauncher(Launcher):
218
218
  cmd.append("-egl")
219
219
  if self._use_sos:
220
220
  cmd.append("-sos")
221
- cmd.append("-nservers")
222
- cmd.append(str(int(self._use_sos)))
221
+ if not self._use_mpi:
222
+ cmd.append("-nservers")
223
+ cmd.append(str(int(self._use_sos)))
224
+ else:
225
+ cmd.append(f"--np={int(self._use_sos)+1}")
226
+ cmd.append(f"--mpi={self._use_mpi}")
227
+ cmd.append(f"--ic={self._interconnect}")
228
+ hosts = ",".join(self._server_hosts)
229
+ cmd.append(f"--cnf={hosts}")
230
+
223
231
  # cmd.append("-minimize_console")
224
232
  logging.debug(f"Starting EnSight with : {cmd}\n")
225
233
  self._ensight_pid = subprocess.Popen(cmd, **popen_common).pid
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-pyensight-core
3
- Version: 0.9.5
3
+ Version: 0.9.7
4
4
  Summary: A python wrapper for Ansys EnSight
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -26,7 +26,6 @@ Requires-Dist: pypng>=0.0.20
26
26
  Requires-Dist: psutil>=5.9.2
27
27
  Requires-Dist: usd-core>=24.8
28
28
  Requires-Dist: pygltflib>=1.16.2
29
- Requires-Dist: grpcio>=1.51.1,<1.67.1
30
29
  Requires-Dist: build>=0.10.0 ; extra == "dev"
31
30
  Requires-Dist: bump2version>=1.0.1 ; extra == "dev"
32
31
  Requires-Dist: ipdb>=0.9.4 ; extra == "dev"
@@ -2,16 +2,16 @@ ansys/pyensight/core/__init__.py,sha256=BCfpDonS2OZRM2O6wjcyOYhLSgdy9hMQRl6G-_9B
2
2
  ansys/pyensight/core/common.py,sha256=f28uGaJhpSmOE1i6MwzqFH0_jKpIByglM2plB2K4Hdk,7574
3
3
  ansys/pyensight/core/deep_pixel_view.html,sha256=6u4mGOuzJiPze8N8pIKJsEGPv5y6-zb38m9IfrarATE,3510
4
4
  ansys/pyensight/core/dockerlauncher.py,sha256=Fgl9FhCNHEAvRthXed5Mo0iXjh_gj3TRxnaq6amWMMI,28443
5
- ansys/pyensight/core/dvs.py,sha256=iPVs4ugVSlxVvhhh8Dx6mxjNHZLdivlCU7TlX_WpmLc,31545
5
+ ansys/pyensight/core/dvs.py,sha256=xL2LeJ9uja3mFBuU8vsE26O_NFgaR9uhDvxZKAHGGvg,31284
6
6
  ansys/pyensight/core/enscontext.py,sha256=GSKkjZt1QEPyHEQ59EEBgKGMik9vjCdR9coR4uX7fEw,12141
7
7
  ansys/pyensight/core/enshell_grpc.py,sha256=-OxSdFI_p3DmQnqh1jT_a_aSh_w-EUD2IaWGKxrnyjI,17122
8
8
  ansys/pyensight/core/ensight_grpc.py,sha256=IitEgMzBJTyTgQff0sXPvGkVnC2E9qRKw-HXCF-mVvA,29713
9
9
  ansys/pyensight/core/ensobj.py,sha256=uDtM2KHcAwd4hu5pcUYWbSD729ApHGIvuqZhEq8PxTI,18558
10
10
  ansys/pyensight/core/launch_ensight.py,sha256=iZJM6GdpzGRDLzrv1V2QZ5veIOpNSB5xPpJUFY7rBuo,10254
11
- ansys/pyensight/core/launcher.py,sha256=ymwfixwoHO7_c4qOetqccQbZjGT1HjeA7jwPi2JxlmE,10585
11
+ ansys/pyensight/core/launcher.py,sha256=OFwQKQ5kqQWM8Qqr3VgSLoVML6DexdmWLauei5mncYI,13121
12
12
  ansys/pyensight/core/libuserd.py,sha256=YKXY1aaaTBT2uwcyhPEW-f93KLtCYQNMJXTlBsenWDI,75459
13
13
  ansys/pyensight/core/listobj.py,sha256=Trw87IxIMXtmUd1DzywRmMzORU704AG4scX4fqYmO6M,9340
14
- ansys/pyensight/core/locallauncher.py,sha256=ot05X0vj-xDqNSx-2A_RDBBuN9Fyk2dONjkkD9gtVyM,16264
14
+ ansys/pyensight/core/locallauncher.py,sha256=4y3KXkwBOFJOD1rzzh1UsTSViYGsFU9jvm7bk3mBAiA,16620
15
15
  ansys/pyensight/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  ansys/pyensight/core/renderable.py,sha256=KidVTVCZ4hKYq54pP9KoJ8OCxeWBXNUJYyKSwMZ2Sls,36362
17
17
  ansys/pyensight/core/session.py,sha256=AGLLWfiqlQJnLvu_CqXZM4Fyno1AxBl_f5g3HHw8hlM,73649
@@ -31,7 +31,7 @@ ansys/pyensight/core/utils/support.py,sha256=QI3z9ex7zJxjFbkCPba9DWqWgPFIThORqr0
31
31
  ansys/pyensight/core/utils/variables.py,sha256=ZUiJdDIeRcowrnLXaJQqGwA0RbrfXhc1s4o4v9A4PiY,95133
32
32
  ansys/pyensight/core/utils/views.py,sha256=ZKhJ6vMT7Rdd4bwJ0egMYTV7-D7Q7I19fF2_j_CMQ0o,12489
33
33
  ansys/pyensight/core/utils/resources/Materials/000_sky.exr,sha256=xAR1gFd2uxPZDnvgfegdhEhRaqKtZldQDiR_-1rHKO0,8819933
34
- ansys_pyensight_core-0.9.5.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
35
- ansys_pyensight_core-0.9.5.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
36
- ansys_pyensight_core-0.9.5.dist-info/METADATA,sha256=AVTrmAfDheh-3ahRh3QLY-VDcjHEDF7dVXjTtJcVdNY,12151
37
- ansys_pyensight_core-0.9.5.dist-info/RECORD,,
34
+ ansys_pyensight_core-0.9.7.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
35
+ ansys_pyensight_core-0.9.7.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
36
+ ansys_pyensight_core-0.9.7.dist-info/METADATA,sha256=ZVWsSNqWEZFh6efAILatHtFxRXh2_a5uWTo7JTxmxYg,12113
37
+ ansys_pyensight_core-0.9.7.dist-info/RECORD,,