Delete patch_distributed.py
Browse files- patch_distributed.py +0 -34
patch_distributed.py
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
# Patch the distributed.py file to work without mpi4py
|
3 |
-
|
4 |
-
import os
|
5 |
-
|
6 |
-
distributed_path = os.path.join('utils', 'distributed.py')
|
7 |
-
|
8 |
-
if os.path.exists(distributed_path):
|
9 |
-
with open(distributed_path, 'r') as f:
|
10 |
-
content = f.read()
|
11 |
-
|
12 |
-
# Replace the mpi4py import with a dummy implementation
|
13 |
-
patched_content = content.replace(
|
14 |
-
"from mpi4py import MPI",
|
15 |
-
"""try:
|
16 |
-
from mpi4py import MPI
|
17 |
-
except ImportError:
|
18 |
-
# Dummy MPI implementation
|
19 |
-
class MPI:
|
20 |
-
class COMM_WORLD:
|
21 |
-
@staticmethod
|
22 |
-
def Get_rank():
|
23 |
-
return 0
|
24 |
-
@staticmethod
|
25 |
-
def Get_size():
|
26 |
-
return 1"""
|
27 |
-
)
|
28 |
-
|
29 |
-
with open(distributed_path, 'w') as f:
|
30 |
-
f.write(patched_content)
|
31 |
-
|
32 |
-
print(f"Successfully patched {distributed_path} to work without mpi4py")
|
33 |
-
else:
|
34 |
-
print(f"Error: {distributed_path} not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|