![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
Class communicatorBoost , The Boost C++ Libraries BoostBook Documentation Subset , Reference
|
Параметры: |
|
communicator
public member functionsintrank()const;Определить ранг исполняющего процесса в коммуникаторе.
Эта рутина эквивалентнаMPI_Comm_rank
Возвращение: | Ранг процесса в коммуникаторе, который будет значением в [0, размер()] |
[[ |
Эта рутина эквивалентнаMPI_Comm_size
Возвращение: | Количество процессов в коммуникаторе. |
boost::mpi::groupgroup()const;
Эта рутина создает новую группу, членами которой являются процессы внутри этого коммуникатора. Это эквивалентно призывуMPI_Comm_group
Датаvalue
], [сверх], [MPI]. примечание:
Типы ? ? ? ? ? ? MPI:is_mpi_datatype<T>
Связьmpl::true_
,value
,get_mpi_datatype<T>()
.int
,float
,char
,double
и т.д.,int
,int
,int
,char
,double
и т.д. Полностью Сериализируемый тип, филе-рама, тип 100 МПИ, мишень
, патруль.is_mpi_datatype
Сериализируемые типы: Любой тип, который обеспечивает функциональность<serialize()
>, требуемую Boost. Библиотеку сериализации можно передавать и принимать.
Упакованные архивы и скелеты: Данные, которые были упакованы в<
или скелеты данных, которые были сохранены в<mpi::packed_oarchive
>
, могут быть переданы, но будут приняты как<mpi::packed_skeleton_oarchive
>
и<mpi::packed_iarchive
>
соответственно, чтобы позволить значениям (или скелетам) быть извлечены процессом назначения.mpi::packed_skeleton_iarchive
>
Содержание: Содержимое, связанное с ранее переданным скелетом, может передаваться<send
>и приниматься<recv
>. Процесс получения может принимать содержимое только в содержание значения, которое было построено с соответствующим скелетом.
Для типов, которые имеют отображения типа данных MPI (включая концентрацию типа), вызов этой процедуры приведет к одному вызову MPI_Send. Для данных переменной длины, например, сериализованных типов и упакованных архивов, через MPI_Send будут отправлены два сообщения: одно, содержащее длину данных, и второе, содержащее сами данные. Обратите внимание, что режим передачи данных переменной длины является деталью реализации, которая может быть изменена.
Параметры: | |
| Ранг удаленного процесса, на который будут отправлены данные. |
< | Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через< |
< | Значение, которое будет передано получателю. Тип< |
template<typename T> void send(int dest, int tag, const skeleton_proxy< T > & proxy) const;Send the skeleton of an object.
This routine executes a potentially blocking send with tag tag
to the process with rank dest
. It can be received by the destination process with a matching recv
call. This variation on send
will be used when a send of a skeleton is explicitly requested via code such as:
comm.send(dest, tag, skeleton(object));
The semantics of this routine are equivalent to that of sending a
storing the skeleton of the packed_skeleton_oarchive
object
.
Параметры: | |
| The rank of the remote process to which the skeleton will be sent. |
| The |
< | Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через< |
Если T
является типом данных MPI, ссылка на эту процедуру будет отображена на один вызов MPI_ Отправить, используя тип данных get_mpi_datatype<T>()
.
Параметры: |
|
Параметры:
dest
The process rank of the remote process to which the data will be sent.
n
The number of values stored in the array. The destination process must call receive with at least this many elements to correctly receive the message.
<tag
>
Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через<environment::max_tag()
>
values
The array of values that will be transmitted to the receiver. The type T
of these values must be mapped to an MPI data type.
void send(int dest, int tag) const;Send a message to another process without any data.
This routine executes a potentially blocking send of a message to another process. The message contains no extra data, and can therefore only be received by a matching call to recv()
.
Параметры: | |
| The process rank of the remote process to which the message will be sent. |
< | The tag that will be associated with this message. Tags may be any integer between zero and an implementation-defined upper limit. This limit is accessible via |
template<typename T> status recv(int source, int tag, T & value) const;Receive data from a remote process.
This routine blocks until it receives a message from the process source
with the given tag
. The type T
of the value
must be suitable for transmission over MPI, which includes serializable types, types that can be mapped to MPI data types (including most built-in C++ types), packed MPI archives, skeletons, and content associated with skeletons; see the documentation of send
for a complete description.
Параметры: |
| ||||||
Returns: | Information about the received message. |
template<typename T> status recv(int source, int tag, const skeleton_proxy< T > & proxy) const;Receive a skeleton from a remote process.
This routine blocks until it receives a message from the process source
with the given tag
containing a skeleton.
Параметры: |
| ||||||
Returns: | Information about the received message. |
template<typename T> status recv(int source, int tag, skeleton_proxy< T > & proxy) const;Receive a skeleton from a remote process.
This routine blocks until it receives a message from the process source
with the given tag
containing a skeleton.
Параметры: |
| ||||||
Returns: | Information about the received message. |
Параметры: |
| ||||||||
Возвращение: | Информация о полученном сообщении. | ||||||||
Throws: | std::range_error, если сообщение будет получено, содержит более n значений. |
Параметры:
| The number of values that can be stored into the |
| The process that will be sending data. This will either be a process rank within the communicator or the constant |
< | The tag that matches a particular kind of message sent by the source process. This may be any tag value permitted by |
| Will contain the values in the message after a successful receive. The type of these elements must match the type of the elements transmitted by the sender. |
Returns:
Information about the received message.
Throws:
n
values.status recv(int source, int tag) const;Receive a message from a remote process without any data.
This routine blocks until it receives a message from the process source
with the given tag
.
Параметры: |
| ||||
Returns: | Information about the received message. |
template<typenameT> statussendrecv(intdest,intstag,constT&sval,intsrc,intrtag, T&rval)const;Отправьте сообщение удаленному процессу и получите другое сообщение от другого процесса.
template<typename T> request isend(int dest, int tag, const T & value) const;Send a message to a remote process without blocking.
The isend
method is functionality identical to the send
method and transmits data in the same way, except that isend
will not block while waiting for the data to be transmitted. Instead, a request object will be immediately returned, allowing one to query the status of the communication or wait until it has completed.
Параметры: | |
| Ранг удаленного процесса, на который будут отправлены данные. |
< | Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через< |
< | The value that will be transmitted to the receiver. The type |
Returns:
a request
object that describes this communication.
Семантика этой рутины эквивалентна неблокирующему отправке
, хранящему скелет packed_skeleton_oarchive
object
.
Параметры: |
| ||||||
Возвращение: | a |
Параметры:
dest
The rank of the remote process to which the skeleton will be sent.
proxy
The
containing a reference to the object whose skeleton will be transmitted.skeleton_proxy
<tag
>
Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через<environment::max_tag()
>
Returns:
a request
object that describes this communication.
Параметры: |
| ||||||||
Возвращение: | a |
Параметры:
dest
The process rank of the remote process to which the data will be sent.
n
The number of values stored in the array. The destination process must call receive with at least this many elements to correctly receive the message.
<tag
>
Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через<environment::max_tag()
>
values
The array of values that will be transmitted to the receiver. The type T
of these values must be mapped to an MPI data type.
Returns:
a request
object that describes this communication.
request isend(int dest, int tag) const;Send a message to another process without any data without blocking.
This routine is functionally identical to the send
method for sends with no data, except that isend
will not block while waiting for the message to be transmitted. Instead, a request object will be immediately returned, allowing one to query the status of the communication or wait until it has completed.
Параметры: | |
| The process rank of the remote process to which the message will be sent. |
< | Тег, который будет связан с этим сообщением. Теги могут быть любым целым числом между нулем и определяемым реализацией верхним пределом. Этот предел доступен через< |
Returns:
a request
object that describes this communication.
template<typename T> request irecv(int source, int tag, T & value) const;Prepare to receive a message from a remote process.
The irecv
method is functionally identical to the recv
method and receive data in the same way, except that irecv
will not block while waiting for data to be transmitted. Instead, it immediately returns a request object that allows one to query the status of the receive or wait until it has completed.
Параметры: |
| ||||||
Returns: | a |
Параметры: |
| ||||||||
Возвращение: | a |
Параметры:
| The number of values that can be stored into the |
| The process that will be sending data. This will either be a process rank within the communicator or the constant |
< | The tag that matches a particular kind of message sent by the source process. This may be any tag value permitted by |
| Will contain the values in the message after a successful receive. The type of these elements must match the type of the elements transmitted by the sender. |
Returns:
a request
object that describes this communication.
Параметры: |
| ||||
Возвращение: | a |
Параметры:
| The process that will be sending the message. This will either be a process rank within the communicator or the constant |
< | The tag that matches a particular kind of message sent by the source process. This may be any tag value permitted by |
Returns:
a request
object that describes this communication.
Параметры: |
| ||||
Возвращение: | Возвращает информацию о первом сообщении, которое соответствует заданным критериям. |
Параметры:
| Determine if there is a message available from this rank. If |
< | Determine if there is a message available with the given tag. If |
Returns:
Returns information about the first message that matches the given criteria.
Параметры: |
| ||||
Возвращение: | Если доступно соответствующее сообщение, возвращает информацию об этом сообщении. В противном случае возвращается пустой |
Параметры:
| Determine if there is a message available from this rank. If |
< | Determine if there is a message available with the given tag. If |
Returns:
If a matching message is available, returns information about that message. Otherwise, returns an empty boost::optional
.
voidbarrier()const;>Подождите, пока все процессы внутри коммуникатора достигнут барьера.
Эта процедура представляет собой коллективную операцию, которая блокирует каждый процесс до тех пор, пока все процессы не вошли в него, а затем высвобождает все процессы «одновременно». Это эквивалентно<MPI_Barrier
>
operatorbool()const;>Определить, является ли данный коммуникатор действительным для связи.
Оценивает<true
>в булевом контексте, если этот коммуникатор действителен для связи, то есть не представляет MPI_COMM_NULL. В противном случае, оценивает<false
>.
operatorMPI_Comm()const;Доступ к MPI-коммуникатору, связанному с повышением. MPI коммуникатор.
Эта рутина позволяет имплицитное преобразование из Роста. MPI коммуникатор к MPI коммуникатор.
Возвращение: | Связанный MPI коммуникатор. |
Выделите коммуникатор на множественные, разрозненные коммуникаторы, каждый из которых основан на определенном цвете. Это коллективная операция, которая возвращает новый коммуникатор, который является подгруппой this
. Эта процедура функционально эквивалентна MPI_Comm_split
.
Параметры: |
| ||
Возвращение: | новый коммуникатор, содержащий все процессы в |
Параметры:
| The color of this process. All processes with the same |
Returns:
A new communicator containing all of the processes in this
that have the same color
.
Выделите коммуникатор на множественные, разрозненные коммуникаторы, каждый из которых основан на определенном цвете. Это коллективная операция, которая возвращает новый коммуникатор, который является подгруппой this
. Эта процедура функционально эквивалентна MPI_Comm_split
.
Параметры: |
| ||||
Возвращение: | новый коммуникатор, содержащий все процессы в |
Параметры:
| The color of this process. All processes with the same |
| A key value that will be used to determine the ordering of processes with the same color in the resulting communicator. If omitted, the rank of the processes in |
Returns:
A new communicator containing all of the processes in this
that have the same color
.
optional<intercommunicator>as_intercommunicator()const;
Определите, является ли коммуникатор фактически интеркоммуникатором, и, если да, верните этого интеркоммуникатора.
Возвращает: |
|
Определить,,
,
,
.
[ [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]] [ ] [ ] [ ] [ ]] [ ] [ ] [ ]] [ ] [ ] [ ]] [ ] [ ]] [ ] [ ]] [ ] [ ]] [ ] [ ] | an |
О абразив,
[ORIG_END] -->void abort(int errcode) const;
Abort all tasks in the group of this communicator.
Makes a "best attempt" to abort all of the tasks in the group of this communicator. Depending on the underlying MPI implementation, this may either abort the entire program (and possibly return errcode
to the environment) or only abort some processes, allowing the others to continue. Consult the documentation for your MPI implementation. This is equivalent to a call to MPI_Abort
Параметры: |
| ||
Returns: | Will not return. |
Статья Class communicator раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.
реклама |