Commit 19a183b8 authored by sfritschi's avatar sfritschi
Browse files

Minor changes

parent d92d6005
......@@ -216,7 +216,7 @@ def __petsc_pressure_system(pore_dict: Dict[Pore,int], A: Dict, b: Dict, \
try:
from wrapper import solve_py
except ImportError:
if rank == 0:
if rank == root:
print("Missing dynamic C library; Run 'make all' first")
comm.Abort(1)
......
......@@ -4,7 +4,7 @@ include ${PETSC_DIR}/lib/petsc/conf/rules
# Linking flags needed in setup.py
export PETSC_LIB
.PHONY: all, run, test, cleanup
.PHONY: all, run, test, submit, cleanup
all: setup.py
python3 $< build_ext -i
......@@ -15,6 +15,9 @@ run:
test:
mpirun -n 4 python3 test.py
submit:
bsub -n 48 -W 00:05 -R fullnode mpirun -n 24 --report-bindings python3 test.py
cleanup:
rm -rf build/
rm -f *.so
......
......@@ -18,7 +18,7 @@ except ImportError:
def main():
np.random.seed(42)
n = 10
n = 50
"""
data = [1.0, 6.0, 3.0, -1.0, 5.0, 6.0, 7.0]
row = [0, 1, 1, 2, 3, 4, 5]
......@@ -42,7 +42,7 @@ def main():
tol = 1.e-20
maxiter = 1e4
x = solve_py(A, b, tol, maxiter)
x = solve_py(A, b, tol, maxiter, n)
if (rank == 0):
print("#nnz: %d" % A.data.shape[0])
......
......@@ -23,6 +23,7 @@ if shutil.which(mpi) == None:
sys.exit(1)
compile_args = []
compile_args += ["-O3"] # Release
compile_args += ["-std=c99"] # For variable declarations in loop
compile_args += os.popen(mpi + " --showme:compile").read().strip().split(" ")
compile_args += ["-I" + PETSC_DIR + "/include"]
......
#!/bin/bash
bsub -n 48 -W 00:05 -R fullnode mpirun -n 24 --report-bindings python3 test.py
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment