{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MPI decomposition calculator\n", "For calculating decompositions equal to whole nodes" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "i: 1 3 5 7 7 9 9 11 13 15 17 19 19 21 21 23 25 27 29 31 31 33 35 37 39 39 41 41\n", "j: 31 21 19 9 41 7 39 29 27 17 15 5 37 3 35 25 23 13 11 1 33 31 21 19 9 41 7 39\n", "n: 1 2 3 2 9 2 11 10 11 8 8 3 22 2 23 18 18 11 10 1 32 32 23 22 11 50 9 50" ] } ], "source": [ "cores_per_node = 32\n", "xios_cores = 1\n", "\n", "i = np.arange(1, 42)\n", "j = np.arange(1, 42)\n", "n = (np.prod(np.meshgrid(i, j), axis=0) + xios_cores) / cores_per_node\n", "ii, jj = np.nonzero(np.mod(n, 1) == 0)\n", "print('i:', end='')\n", "for I in i[ii]:\n", " print(f'{I:4d}', end='')\n", "print('\\nj:', end='')\n", "for J in j[jj]:\n", " print(f'{J:4d}', end='')\n", "print('\\nn:', end='')\n", "for N in n[ii, jj]:\n", " print(f'{N:4.0f}', end='')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.3" } }, "nbformat": 4, "nbformat_minor": 2 }