diff --git a/changelog-entries/214.md b/changelog-entries/214.md new file mode 100644 index 00000000..e7c3c601 --- /dev/null +++ b/changelog-entries/214.md @@ -0,0 +1 @@ +- Added configurable partitioning algorithm to mapping tester. diff --git a/examples/mapping_tester/setup-test.json b/examples/mapping_tester/setup-test.json index f5096680..e450b28b 100644 --- a/examples/mapping_tester/setup-test.json +++ b/examples/mapping_tester/setup-test.json @@ -1,6 +1,7 @@ { "general": { "function": "0.78 + cos(10*(x+y+z))", + "partitioning": "topology", "ranks": { "A": [ 2 diff --git a/tools/mapping-tester/preparemeshes.py b/tools/mapping-tester/preparemeshes.py index 978b6f4d..740cb89b 100755 --- a/tools/mapping-tester/preparemeshes.py +++ b/tools/mapping-tester/preparemeshes.py @@ -66,8 +66,7 @@ def prepareMainMesh( ) -def preparePartMesh(meshdir: pathlib.Path, name, p, force=False): - +def preparePartMesh(meshdir: pathlib.Path, name, p, force, algorithm): if p == 1: return @@ -91,7 +90,7 @@ def preparePartMesh(meshdir: pathlib.Path, name, p, force=False): "--mesh", mainMesh, "--algorithm", - "topology", + algorithm, "-o", partMesh, "--directory", @@ -111,6 +110,8 @@ def main(argv): print(f'Warning: outdir "{outdir}" already exisits.') meshdir = outdir / "meshes" function = setup["general"]["function"] + algorithm = setup["general"].get("partitioning", "meshfree") + print(f"Using partitioning algorithm {algorithm}") partitions = set( [int(rank) for pranks in setup["general"]["ranks"].values() for rank in pranks] @@ -129,7 +130,7 @@ def main(argv): prepareMainMesh(meshdir, name, file, function, args.force) for p in partitions: - preparePartMesh(meshdir, name, p, args.force) + preparePartMesh(meshdir, name, p, args.force, algorithm) return 0