\doxysection{neighborhood\+\_\+communicator.\+hpp}
\hypertarget{neighborhood__communicator_8hpp_source}{}\label{neighborhood__communicator_8hpp_source}\index{ginkgo/core/distributed/neighborhood\_communicator.hpp@{ginkgo/core/distributed/neighborhood\_communicator.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2025\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_NEIGHBORHOOD\_COMMUNICATOR\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_NEIGHBORHOOD\_COMMUNICATOR\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ginkgo/config.hpp>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#if\ GINKGO\_BUILD\_MPI}}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/mpi.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/distributed/collective\_communicator.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/distributed/index\_map.hpp>}}
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00021\ \textcolor{keyword}{namespace\ }experimental\ \{}
\DoxyCodeLine{00022\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1experimental_1_1mpi}{mpi}}\ \{}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00033\ \textcolor{keyword}{class\ }NeighborhoodCommunicator\ final\ :\ \textcolor{keyword}{public}\ CollectiveCommunicator\ \{}
\DoxyCodeLine{00034\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00035\ \ \ \ \ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1CollectiveCommunicator_a94f644ab6d92ef607f82de7092a56056}{CollectiveCommunicator::i\_all\_to\_all\_v}};}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00037\ \ \ \ \ NeighborhoodCommunicator(\textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ other)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \ \ \ \ NeighborhoodCommunicator(NeighborhoodCommunicator\&\&\ other);}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \ \ \ \ NeighborhoodCommunicator\&\ operator=(\textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ other)\ =}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ NeighborhoodCommunicator\&\ operator=(NeighborhoodCommunicator\&\&\ other);}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_abceacf78b77f063265ce1ca6f4c87d70}{NeighborhoodCommunicator}}(\doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1communicator}{communicator}}\ base);}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00066\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LocalIndexType,\ \textcolor{keyword}{typename}\ GlobalIndexType>}
\DoxyCodeLine{00067\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_ae826c5c548fb5d1fcb19bf6b77b5ba58}{NeighborhoodCommunicator}}(}
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1communicator}{communicator}}\ base,}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1index__map}{distributed::index\_map<LocalIndexType,\ GlobalIndexType>}}\&\ imap);}
\DoxyCodeLine{00070\ }
\DoxyCodeLine{00071\ \ \ \ \ std::unique\_ptr<CollectiveCommunicator>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_a9e913ad4689b21012cafadf34285d8f8}{create\_with\_same\_type}}(}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1communicator}{communicator}}\ base,\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1CollectiveCommunicator_a4eb0fac1710fca957997116855df756e}{index\_map\_ptr}}\ imap)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00080\ \ \ \ \ [[nodiscard]]\ std::unique\_ptr<CollectiveCommunicator>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_a1eb56683a480814379ee120f844ddacb}{create\_inverse}}()}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00083\ \ \ \ \ [[nodiscard]]\ \doxymbox{\hyperlink{namespacegko_1_1experimental_1_1mpi_a13b7760affb031fee59d385754eaaffb}{comm\_index\_type}}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_a885ed4e93933ee39d85537ab202dba76}{get\_recv\_size}}()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \ \ \ \ [[nodiscard]]\ \doxymbox{\hyperlink{namespacegko_1_1experimental_1_1mpi_a13b7760affb031fee59d385754eaaffb}{comm\_index\_type}}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_ad032c76b8a0aecc5f0113efab3326a39}{get\_send\_size}}()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00096\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_a2c534e7fb686124160b394575ec4c371}{operator==}}(\textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ a,}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ b);}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00104\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1NeighborhoodCommunicator_a2c33ce8d89ada56083ca90749b27ca3b}{operator!=}}(\textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ a,}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ NeighborhoodCommunicator\&\ b);}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00114\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1request}{request}}\ i\_all\_to\_all\_v\_impl(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ send\_buffer,\ MPI\_Datatype\ send\_type,}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}*\ recv\_buffer,}
\DoxyCodeLine{00117\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MPI\_Datatype\ recv\_type)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00119\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00120\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1mpi_1_1communicator}{communicator}}\ comm\_;}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ \ \ \ \ std::vector<comm\_index\_type>\ send\_sizes\_;}
\DoxyCodeLine{00123\ \ \ \ \ std::vector<comm\_index\_type>\ send\_offsets\_;}
\DoxyCodeLine{00124\ \ \ \ \ std::vector<comm\_index\_type>\ recv\_sizes\_;}
\DoxyCodeLine{00125\ \ \ \ \ std::vector<comm\_index\_type>\ recv\_offsets\_;}
\DoxyCodeLine{00126\ \};}
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00129\ \}\ \ \textcolor{comment}{//\ namespace\ mpi}}
\DoxyCodeLine{00130\ \}\ \ \textcolor{comment}{//\ namespace\ experimental}}
\DoxyCodeLine{00131\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00132\ }
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00134\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00135\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_NEIGHBORHOOD\_COMMUNICATOR\_HPP\_}}

\end{DoxyCode}
