Skip to content

Commit bb03dc7

Browse files
committed
2 parents f0f757b + dd20cb1 commit bb03dc7

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ To install simply do a `pip install plot3d`
66

77
> [Link to documentation](https://nasa.github.io/Plot3D_utilities/_build/html/)
88
9+
## Metis
10+
Metis is used to group the blocks to be evaluated. So say you have 1000 blocks and 8 CPU. The blocks are split up and sent to the CPU or GPU. The split is done with weighting to block size and connectivity this way each processor is evaluating similar number of nodes. Plot3D Library will work without metis but metis functionality wont be available.
11+
12+
### Ubuntu
13+
Metis needs to be installed and configured as part of your METIS_DLL or LD_LIBRARY path
14+
15+
1. Download Metis http://glaros.dtc.umn.edu/gkhome/metis/metis/download
16+
2. Follow the compiling instructions
17+
18+
Add to your profile for Ubuntu
19+
```bash
20+
# metis
21+
export PATH="/home/[username]/metis:$PATH"
22+
export LD_LIBRARY_PATH="/home/[username]/metis:$LD_LIBRARY_PATH"
23+
```
24+
### Mac
25+
For Mac. install homebrew and do `brew install metis` then add this to your ~/.zprofile
26+
```bash
27+
# Metis
28+
export METIS_DLL=/opt/homebrew/Cellar/metis/5.1.0/lib/libmetis.dylib
29+
```
30+
31+
3. Install metis python library `pip install metis`
32+
933
# Tutorials
1034
[Reading Writing and Viewing Plot3D files](https://colab.research.google.com/github/nasa/Plot3D_utilities/blob/main/colab/Plot3D_SplitBlocksExample.ipynb)
1135

python/examples/metis-block-graph/readme.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ Metis needs to be installed and configured as part of your METIS_DLL or LD_LIBRA
66
1. Download Metis http://glaros.dtc.umn.edu/gkhome/metis/metis/download
77
2. Follow the compiling instructions
88

9-
Add to your profile
9+
Add to your profile for Ubuntu
1010
```bash
1111
# metis
1212
export PATH="/home/[username]/metis:$PATH"
1313
export LD_LIBRARY_PATH="/home/[username]/metis:$LD_LIBRARY_PATH"
1414
```
1515

16+
For Mac. install homebrew and do `brew install metis` then add this to your ~/.zprofile
17+
```bash
18+
# Metis
19+
PATH=/Users/[username]/.cargo/bin:$PATH
20+
export PATH="/Users/[username]/.local/share/solana/install/active_release/bin:$PATH"
21+
```
22+
1623
3. Install metis python library `pip install metis`
1724

1825
Now you are ready to run the test code.

python/plot3d/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from __future__ import absolute_import
2+
from importlib import import_module
3+
import os, warnings
4+
15
from .block import Block, reduce_blocks
26
from .blockfunctions import rotate_block,get_outer_bounds,block_connection_matrix
37
from .connectivity import find_matching_blocks, get_face_intersection, connectivity_fast, face_matches_to_dict
@@ -10,4 +14,11 @@
1014
from .point_match import point_match
1115
from .split_block import split_blocks, Direction
1216
from .listfunctions import unique_pairs
13-
from .graph import block_to_graph,get_face_vertex_indices,get_starting_vertex,add_connectivity_to_graph, block_connectivity_to_graph
17+
18+
# Try importing metis
19+
if os.getenv('METIS_DLL') is not None:
20+
if import_module('metis') is not None:
21+
import metis
22+
from .graph import block_to_graph,get_face_vertex_indices,get_starting_vertex,add_connectivity_to_graph, block_connectivity_to_graph
23+
else:
24+
print("METIS_DLL is not set. metis may not be configured. plot3D will function without metis")

0 commit comments

Comments
 (0)