Commit 0ee27438 authored by Davis King's avatar Davis King

clarified the BSP spec

parent c495350d
...@@ -35,6 +35,13 @@ namespace dlib ...@@ -35,6 +35,13 @@ namespace dlib
calls to bsp_listen() and one call to bsp_connect(). The call to calls to bsp_listen() and one call to bsp_connect(). The call to
bsp_connect() then initiates the computation on all nodes. bsp_connect() then initiates the computation on all nodes.
Finally, note that there is no explicit barrier synchronization function
you call at the end of step 3. Instead, you can simply call a method such
as try_receive() until it returns false. That is, the bsp_context's
receive methods incorporate a barrier synchronization that happens once all
the BSP nodes are blocked on receive calls and there are no more messages
in flight.
THREAD SAFETY THREAD SAFETY
This object is not thread-safe. In particular, you should only ever have This object is not thread-safe. In particular, you should only ever have
...@@ -124,6 +131,10 @@ namespace dlib ...@@ -124,6 +131,10 @@ namespace dlib
to process by any node and there is no possibility of more being to process by any node and there is no possibility of more being
generated until control is returned to the callers of receive generated until control is returned to the callers of receive
methods. methods.
- When one BSP node's receive method returns because of the above
conditions then all of them will also return. That is, it is NOT the
case that just a subset of BSP nodes unblock. Moreover, they all
unblock at the same time.
throws throws
- dlib::socket_error: - dlib::socket_error:
This exception is thrown if some error occurs which prevents us from This exception is thrown if some error occurs which prevents us from
...@@ -185,6 +196,10 @@ namespace dlib ...@@ -185,6 +196,10 @@ namespace dlib
to process by any node and there is no possibility of more being to process by any node and there is no possibility of more being
generated until control is returned to the callers of receive generated until control is returned to the callers of receive
methods. methods.
- When one BSP node's receive method returns because of the above
conditions then all of them will also return. That is, it is NOT the
case that just a subset of BSP nodes unblock. Moreover, they all
unblock at the same time.
throws throws
- dlib::socket_error: - dlib::socket_error:
This exception is thrown if some error occurs which prevents us from This exception is thrown if some error occurs which prevents us from
...@@ -227,14 +242,19 @@ namespace dlib ...@@ -227,14 +242,19 @@ namespace dlib
); );
/*! /*!
ensures ensures
- Wait for the following to all be true. - Waits for the following to all be true:
- All other nodes are blocked on calls to receive() or have terminated. - All other nodes were blocked on calls to receive(), try_receive(), or
have terminated.
- There are not any messages in flight between any nodes. - There are not any messages in flight between any nodes.
- That is, if all the nodes had continued to block on receive() then - That is, if all the nodes had continued to block on receive methods
they all would have blocked forever. Therefore, this function only then they all would have blocked forever. Therefore, this function
returns once there are no more messages to process by any node and only returns once there are no more messages to process by any node
there is no possibility of more being generated until control is and there is no possibility of more being generated until control is
returned to the callers of receive(). returned to the callers of receive methods.
- When one BSP node's receive method returns because of the above
conditions then all of them will also return. That is, it is NOT the
case that just a subset of BSP nodes unblock. Moreover, they all unblock
at the same time.
throws throws
- dlib::socket_error: - dlib::socket_error:
This exception is thrown if some error occurs which prevents us from This exception is thrown if some error occurs which prevents us from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment