{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# \n",
"\n",
"# CustomTopology\n",
"\n",
"`CustomTopology()`\n",
"\n",
"The CustomTopology class provides a mechanism to describe parametric\n",
"domain decompositions. It allows users to specify how the dimensions of\n",
"a domain are decomposed into chunks based on certain parameters.\n",
"\n",
"## Examples\n",
"\n",
"For example, letâ€™s consider a domain with three distributed dimensions:\n",
"x, y, and z, and an MPI communicator with N processes. Here are a few\n",
"examples of CustomTopology:\n",
"\n",
"With N known, say N=4: \\* `(1, 1, 4)`: the z Dimension is decomposed\n",
"into 4 chunks \\* `(2, 1, 2)`: the x Dimension is decomposed into 2\n",
"chunks and the z Dimension is decomposed into 2 chunks\n",
"\n",
"With N unknown: \\* `(1, '*', 1)`: the wildcard `'*'` indicates that the\n",
"runtime should decompose the y Dimension into N chunks \\*\n",
"`('*', '*', 1)`: the wildcard `'*'` indicates that the runtime should\n",
"decompose both the x and y Dimensions in `nstars` factors of N,\n",
"prioritizing the outermost dimension\n",
"\n",
"Assuming that the number of ranks `N` cannot evenly be decomposed to the\n",
"requested stars=6 we decompose as evenly as possible by prioritising the\n",
"outermost dimension\n",
"\n",
"For N=3 \\* `('*', '*', 1)` gives: (3, 1, 1) \\* `('*', 1, '*')` gives:\n",
"(3, 1, 1) \\* `(1, '*', '*')` gives: (1, 3, 1)\n",
"\n",
"For N=6 \\* `('*', '*', 1)` gives: (3, 2, 1) \\* `('*', 1, '*')` gives:\n",
"(3, 1, 2) \\* `(1, '*', '*')` gives: (1, 3, 2)\n",
"\n",
"For N=8 \\* `('*', '*', '*')` gives: (2, 2, 2) \\* `('*', '*', 1)` gives:\n",
"(4, 2, 1) \\* `('*', 1, '*')` gives: (4, 1, 2) \\* `(1, '*', '*')` gives:\n",
"(1, 4, 2)\n",
"\n",
"## Notes\n",
"\n",
"Users should not directly use the CustomTopology class. It is\n",
"instantiated by the Devito runtime based on user input."
],
"id": "48028ad3-687e-47dc-9cb4-a96791e45375"
}
],
"nbformat": 4,
"nbformat_minor": 5,
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
}
}