Salome HOME
define SAT_ENABLE_PYTHON_PYMALLOC switch for Python >= 3.6
[tools/sat_salome.git] / products / patches / C3PO-v2.0.patch
1 diff --git a/sources/c3po/mpi/MPICollaborativeDataManager.py b/sources/c3po/mpi/MPICollaborativeDataManager.py
2 index 4d8a937..865839a 100755
3 --- a/sources/c3po/mpi/MPICollaborativeDataManager.py
4 +++ b/sources/c3po/mpi/MPICollaborativeDataManager.py
5 @@ -11,7 +11,10 @@
6  """ Contain the class MPICollaborativeDataManager. """
7  from __future__ import print_function, division
8  import math
9 -from mpi4py import MPI
10 +try:
11 +    from mpi4py import MPI
12 +except:
13 +    from openmpi.mpi4py import MPI
14  
15  from c3po.CollaborativeDataManager import CollaborativeDataManager
16  from c3po.mpi.MPIRemoteProcess import MPIRemoteProcess
17 diff --git a/sources/c3po/mpi/MPICoupler.py b/sources/c3po/mpi/MPICoupler.py
18 index 8f82edb..805cacf 100755
19 --- a/sources/c3po/mpi/MPICoupler.py
20 +++ b/sources/c3po/mpi/MPICoupler.py
21 @@ -10,7 +10,10 @@
22  
23  """ Contain the class MPICoupler. """
24  from __future__ import print_function, division
25 -from mpi4py import MPI
26 +try:
27 +    from mpi4py import MPI
28 +except:
29 +    from openmpi.mpi4py import MPI
30  
31  from c3po.Coupler import Coupler
32  from c3po.mpi.MPIRemoteProcess import MPIRemoteProcess
33 diff --git a/sources/c3po/mpi/MPIMasterDataManager.py b/sources/c3po/mpi/MPIMasterDataManager.py
34 index c72b87d..1af67aa 100755
35 --- a/sources/c3po/mpi/MPIMasterDataManager.py
36 +++ b/sources/c3po/mpi/MPIMasterDataManager.py
37 @@ -11,7 +11,10 @@
38  """ Contain the class MPIMasterDataManager. """
39  from __future__ import print_function, division
40  import math
41 -from mpi4py import MPI
42 +try:
43 +    from mpi4py import MPI
44 +except:
45 +    from openmpi.mpi4py import MPI
46  
47  from c3po.mpi.MPITag import MPITag
48  
49 diff --git a/sources/c3po/mpi/MPIMasterPhysicsDriver.py b/sources/c3po/mpi/MPIMasterPhysicsDriver.py
50 index d9c7da5..25a1b4c 100755
51 --- a/sources/c3po/mpi/MPIMasterPhysicsDriver.py
52 +++ b/sources/c3po/mpi/MPIMasterPhysicsDriver.py
53 @@ -10,7 +10,10 @@
54  
55  """ Contain the class MPIMasterPhysicsDriver. """
56  from __future__ import print_function, division
57 -from mpi4py import MPI
58 +try:
59 +    from mpi4py import MPI
60 +except:
61 +    from openmpi.mpi4py import MPI
62  
63  from c3po.PhysicsDriver import PhysicsDriver
64  from c3po.mpi.MPICollectiveProcess import MPICollectiveProcess
65 diff --git a/sources/c3po/mpi/MPIRecipient.py b/sources/c3po/mpi/MPIRecipient.py
66 index 3991c43..0948c4d 100755
67 --- a/sources/c3po/mpi/MPIRecipient.py
68 +++ b/sources/c3po/mpi/MPIRecipient.py
69 @@ -12,7 +12,10 @@
70  These classes recieve data from a remote process.
71  """
72  from __future__ import print_function, division
73 -from mpi4py import MPI
74 +try:
75 +    from mpi4py import MPI
76 +except:
77 +    from openmpi.mpi4py import MPI
78  import numpy
79  
80  import c3po.medcouplingCompat as mc
81 diff --git a/sources/c3po/mpi/MPISender.py b/sources/c3po/mpi/MPISender.py
82 index 8d3b418..234c343 100755
83 --- a/sources/c3po/mpi/MPISender.py
84 +++ b/sources/c3po/mpi/MPISender.py
85 @@ -14,7 +14,10 @@ These classes send data to another process.
86  from __future__ import print_function, division
87  import os
88  
89 -from mpi4py import MPI
90 +try:
91 +    from mpi4py import MPI
92 +except:
93 +    from openmpi.mpi4py import MPI
94  
95  import c3po.medcouplingCompat as mc
96  from c3po.mpi.MPITag import MPITag
97 diff --git a/sources/c3po/mpi/MPIWorker.py b/sources/c3po/mpi/MPIWorker.py
98 index 2d731eb..6553b83 100755
99 --- a/sources/c3po/mpi/MPIWorker.py
100 +++ b/sources/c3po/mpi/MPIWorker.py
101 @@ -10,7 +10,10 @@
102  
103  """ Contain the class MPIWorker. """
104  from __future__ import print_function, division
105 -from mpi4py import MPI
106 +try:
107 +    from mpi4py import MPI
108 +except:
109 +    from openmpi.mpi4py import MPI
110  
111  from c3po.mpi.MPITag import MPITag
112  from c3po.mpi.MPIRemoteProcess import MPIRemoteProcess
113 diff --git a/sources/c3po/physicsDrivers/ALCYONE2Driver.py b/sources/c3po/physicsDrivers/ALCYONE2Driver.py
114 index f9fc05c..b5a06e1 100755
115 --- a/sources/c3po/physicsDrivers/ALCYONE2Driver.py
116 +++ b/sources/c3po/physicsDrivers/ALCYONE2Driver.py
117 @@ -11,7 +11,10 @@
118  """ Contain the class ALCYONE2Driver. """
119  from __future__ import print_function, division
120  from ctypes import cdll
121 -import mpi4py.MPI as mpi
122 +try:
123 +    from mpi4py import MPI as mpi
124 +except:
125 +    from openmpi.mpi4py import MPI as mpi
126  
127  import pleiades
128  import pleiadesMPI
129 diff --git a/tests/Couplage_2_mailles_Dussaix/main_collaborative.py b/tests/Couplage_2_mailles_Dussaix/main_collaborative.py
130 index 5915e94..3cac2a2 100755
131 --- a/tests/Couplage_2_mailles_Dussaix/main_collaborative.py
132 +++ b/tests/Couplage_2_mailles_Dussaix/main_collaborative.py
133 @@ -1,6 +1,9 @@
134  # -*- coding: utf-8 -*-
135  from __future__ import print_function, division
136 -from mpi4py import MPI
137 +try:
138 +    from mpi4py import MPI
139 +except:
140 +    from openmpi.mpi4py import MPI
141  import unittest
142  
143  import c3po.medcouplingCompat as mc
144 diff --git a/tests/Couplage_2_mailles_Dussaix/main_master.py b/tests/Couplage_2_mailles_Dussaix/main_master.py
145 index 4256eb0..8dc75a9 100755
146 --- a/tests/Couplage_2_mailles_Dussaix/main_master.py
147 +++ b/tests/Couplage_2_mailles_Dussaix/main_master.py
148 @@ -1,6 +1,9 @@
149  # -*- coding: utf-8 -*-
150  from __future__ import print_function, division
151 -import mpi4py.MPI as mpi
152 +try:
153 +    from mpi4py import MPI as mpi
154 +except:
155 +    from openmpi.mpi4py import MPI as mpi
156  import unittest
157  
158  import c3po.medcouplingCompat as mc
159 diff --git a/tests/Couplage_2_mailles_Dussaix/main_sequential.py b/tests/Couplage_2_mailles_Dussaix/main_sequential.py
160 index 0774f80..fb6b7ec 100755
161 --- a/tests/Couplage_2_mailles_Dussaix/main_sequential.py
162 +++ b/tests/Couplage_2_mailles_Dussaix/main_sequential.py
163 @@ -1,6 +1,9 @@
164  # -*- coding: utf-8 -*-
165  from __future__ import print_function, division
166 -from mpi4py import MPI
167 +try:
168 +    from mpi4py import MPI
169 +except:
170 +    from openmpi.mpi4py import MPI
171  import unittest
172  
173  import c3po.medcouplingCompat as mc
174 diff --git a/tests/Couplage_2_mailles_Dussaix/main_workerNeutro.py b/tests/Couplage_2_mailles_Dussaix/main_workerNeutro.py
175 index 76a6489..13f5a74 100755
176 --- a/tests/Couplage_2_mailles_Dussaix/main_workerNeutro.py
177 +++ b/tests/Couplage_2_mailles_Dussaix/main_workerNeutro.py
178 @@ -1,6 +1,9 @@
179  # -*- coding: utf-8 -*-
180  from __future__ import print_function, division
181 -import mpi4py.MPI as mpi
182 +try:
183 +    from mpi4py import MPI as mpi
184 +except:
185 +    from openmpi.mpi4py import MPI as mpi
186  
187  from NeutroDriver import NeutroDriver
188  import c3po
189 diff --git a/tests/Couplage_2_mailles_Dussaix/main_workerThermo.py b/tests/Couplage_2_mailles_Dussaix/main_workerThermo.py
190 index e1de24d..1679228 100755
191 --- a/tests/Couplage_2_mailles_Dussaix/main_workerThermo.py
192 +++ b/tests/Couplage_2_mailles_Dussaix/main_workerThermo.py
193 @@ -1,6 +1,9 @@
194  # -*- coding: utf-8 -*-
195  from __future__ import print_function, division
196 -import mpi4py.MPI as mpi
197 +try:
198 +    from mpi4py import MPI as mpi
199 +except:
200 +    from openmpi.mpi4py import MPI as mpi
201  
202  from ThermoDriver import ThermoDriver
203  import c3po
204 diff --git a/tests/Listings/main_listings_collaboratif.py b/tests/Listings/main_listings_collaboratif.py
205 index 848c2b9..b5fd601 100755
206 --- a/tests/Listings/main_listings_collaboratif.py
207 +++ b/tests/Listings/main_listings_collaboratif.py
208 @@ -1,7 +1,10 @@
209  # -*- coding: utf-8 -*-
210  from __future__ import print_function
211  import sys
212 -from mpi4py import MPI
213 +try:
214 +    from mpi4py import MPI
215 +except:
216 +    from openmpi.mpi4py import MPI
217  import unittest
218  
219  import c3po