Pārlūkot izejas kodu

doc: Document the `initialize', `shutdown', and `wait' pragmas.

* doc/chapters/c-extensions.texi (Synchronization and Other Pragmas):
  New node.

* doc/chapters/basic-examples.texi (Extended C Source Code of Vector
  Scaling): Remove details about `initialize' and `shutdown'.
Ludovic Courtès 13 gadi atpakaļ
vecāks
revīzija
941e89e7a8
2 mainītis faili ar 28 papildinājumiem un 5 dzēšanām
  1. 2 5
      doc/chapters/basic-examples.texi
  2. 26 0
      doc/chapters/c-extensions.texi

+ 2 - 5
doc/chapters/basic-examples.texi

@@ -386,8 +386,7 @@ The @code{main} function above does several things:
 
 @itemize
 @item
-It initializes StarPU.  This has to be done explicitly, as it is
-undesirable to add implicit initialization code in user code.
+It initializes StarPU.
 
 @item
 It allocates @var{vector} in the heap; it will automatically be freed
@@ -412,9 +411,7 @@ It @dfn{waits} for the termination of the @code{vector_scal}
 asynchronous call.
 
 @item
-Finally, StarPU is shut down, giving it an opportunity to write
-profiling info to a file on disk, for instance (@pxref{Off-line,
-off-line performance feedback}).
+Finally, StarPU is shut down.
 
 @end itemize
 

+ 26 - 0
doc/chapters/c-extensions.texi

@@ -38,6 +38,7 @@ development and subject to change.
 
 @menu
 * Defining Tasks::              Defining StarPU tasks
+* Synchronization and Other Pragmas:: Synchronization, and more.
 * Registered Data Buffers::     Manipulating data buffers
 * Conditional Extensions::      Using C extensions only when available
 @end menu
@@ -202,6 +203,31 @@ StarPU-GCC code.  For a complete example, see the
 example}.
 
 
+@node Synchronization and Other Pragmas
+@section Initialization, Termination, and Synchronization
+
+The following pragmas allow user code to control StarPU's life time and
+to synchronize with tasks.
+
+@table @code
+
+@item #pragma starpu initialize
+Initialize StarPU.  This call is compulsory and is @emph{never} added
+implicitly.  One of the reasons this has to be done explicitly is that
+it provides greater control to user code over its resource usage.
+
+@item #pragma starpu shutdown
+Shut down StarPU, giving it an opportunity to write profiling info to a
+file on disk, for instance (@pxref{Off-line, off-line performance
+feedback}).
+
+@item #pragma starpu wait
+Wait for all task invocations to complete, as with
+@code{starpu_wait_for_all} (@pxref{Codelets and Tasks,
+starpu_wait_for_all}).
+
+@end table
+
 @node Registered Data Buffers
 @section Registered Data Buffers