Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add try_put_and_wait documentation #1514

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kboyarinov
Copy link
Contributor

Description

Add reference page about Flow Graph try_put_and_wait feature

Fixes # - issue number(s) if exists

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
doc/main/reference/try_put_and_wait.rst Outdated Show resolved Hide resolved
***********

This feature adds a new ``try_put_and_wait`` interface to the receiving nodes in the Flow Graph.
This function allows to wait until completion of single message, submitted to ``try_put_and_wait`` as an input by the Flow Graph in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest, "This function puts a message as an input into a Flow Graph and then waits until all work related to that input is complete."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a second sentence, "try_put_and_wait may reduce latency compared to calling graph::wait_for_all since graph::wait_for_all waits for all work, including work unrelated to the input message, to complete."

Copy link
Contributor

@vossmjp vossmjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wording for "indefinite waiting" should be used consistently. So maybe double check that don't match that language are intentional, for example check for "blocking" and "infinite waiting".

***********

This feature adds a new ``try_put_and_wait`` interface to the receiving nodes in the Flow Graph.
This function allows to wait until completion of single message, submitted to ``try_put_and_wait`` as an input by the Flow Graph in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a second sentence, "try_put_and_wait may reduce latency compared to calling graph::wait_for_all since graph::wait_for_all waits for all work, including work unrelated to the input message, to complete."

``node.try_put_and_wait(msg)`` performs ``node.try_put(msg)`` on the node and waits until the work on ``msg`` is completed.
Therefore, the following conditions are true:

* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result
* Any task initiated by any node in the Flow Graph that involves working with ``msg`` or any other intermediate result


* Any task initiated by any node in the Flow Graph that involves on working with ``msg`` or any other intermediate result
computed from ``msg`` is completed.
* Any intermediate result computed from ``msg`` is retrieved from any buffer in the graph.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Any intermediate result computed from ``msg`` is retrieved from any buffer in the graph.
* No intermediate results computed from ``msg`` remain in any buffers in the graph.

.. caution::

To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result
would not be retrieved by the Flow Graph.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
would not be retrieved by the Flow Graph.
will not be automatically consumed by the Flow Graph.


.. caution::

To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To prevent ``try_put_and_wait`` calls from infinite blocking, avoid using buffering nodes at the end of the Flow Graph since the final result
To prevent ``try_put_and_wait`` calls from infinite waiting, avoid using buffering nodes at the end of the Flow Graph since the final result

});
}

Each iteration of ``parallel_for`` submits a part of work into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each iteration of ``parallel_for`` submits a part of work into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is
Each iteration of ``parallel_for`` submits an input into the Flow Graph. After returning from ``try_put_and_wait(input)``, it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants