diff --git a/doc/user/chapters/using.org b/doc/user/chapters/using.org index 490a90268ad41b174f30af60e20cfc0ae2caed55..72fe8616ce086ffbb172743c0eb7f3533249238b 100644 --- a/doc/user/chapters/using.org +++ b/doc/user/chapters/using.org @@ -687,34 +687,34 @@ In this program we use the tile data layout from PLASMA so that the call #+begin_example - CHAMELEON_Desc_Create_User(&descA, NULL, ChamRealDouble, - NB, NB, NB*NB, N, N, - 0, 0, N, N, - GRID_P, GRID_Q, - chameleon_getaddr_ccrb, - chameleon_getblkldd_ccrb, - chameleon_getrankof_2d, NULL); + CHAMELEON_Desc_Create(&descA, NULL, ChamRealDouble, + NB, NB, NB*NB, N, N, + 0, 0, N, N, + GRID_P, GRID_Q); #+end_example is equivalent to the following call - #+begin_example - CHAMELEON_Desc_Create(&descA, NULL, ChamRealDouble, - NB, NB, NB*NB, N, N, - 0, 0, N, N, - GRID_P, GRID_Q); + CHAMELEON_Desc_Create_User(&descA, NULL, ChamRealDouble, + NB, NB, NB*NB, N, N, + 0, 0, N, N, + GRID_P, GRID_Q, + chameleon_getaddr_ccrb, + chameleon_getblkldd_ccrb, + chameleon_getrankof_2d, NULL); #+end_example - functions *chameleon_getaddr_ccrb*, *chameleon_getblkldd_ccrb*, - *chameleon_getrankof_2d* being used in *Desc_Create*. It is interesting - to notice that the code is almost the same as Step5. The only - additional information to give is the way tiles are distributed - through the third function given to *CHAMELEON_Desc_Create_User*. - Here, because we have made experiments only with a 2-D - block-cyclic distribution, we have parameters P and Q in the - interface of *Desc_Create* but they have sense only for 2-D - block-cyclic distribution and then using *chameleon_getrankof_2d* - function. Of course it could be used with other distributions, - being no more the parameters of a 2-D block-cyclic grid but of - another distribution. + functions *chameleon_getaddr_ccrb*, *chameleon_getblkldd_ccrb*, *chameleon_getrankof_2d* being used in *Desc_Create*. It + is interesting to notice that the code is almost the same as Step5. The only additional information to give is the + way tiles are distributed through the third function given to *CHAMELEON_Desc_Create_User*. Here, because we have + made experiments only with a 2-D block-cyclic distribution, we have parameters P and Q in the interface of + *Desc_Create* but they have sense only for 2-D block-cyclic distribution and then using *chameleon_getrankof_2d* + function. Of course it could be used with other distributions, being no more the parameters of a 2-D block-cyclic + grid but of another distribution. And the last parameter ~void* get_rankof_arg~ of CHAMELEON_Desc_Create_User can be + used to get custom data in the *get_rankof* function. + + This example shows also that the user can initialize Chameleon with a custom MPI communicator. By default Chameleon + is initialized for using *MPI_COMM_WORLD*. This feature can be tested with ~--scom=1~ (Chameleon will operate only on + even MPI ranks). Notice the use of *CHAMELEON_InitParComm( NCPU, NGPU, 1, comm );* to initialize Chameleon with the + custom communicator. **** Step7 @@ -733,23 +733,20 @@ that the function used to fill the tiles is provided by the user, and therefore this approach is much more flexible. - The new function to understand is *CHAMELEON_dbuild_Tile*, e.g. + The new function to understand is *CHAMELEON_map_Tile*, e.g. #+begin_example - struct data_pl data_A={(double)N, 51, N}; - CHAMELEON_dbuild_Tile(ChamUpperLower, descA, (void*)&data_A, - Cham_build_callback_plgsy); + struct data_pl data_A={(double)N, 51}; + CHAMELEON_map_Tile(ChamW, ChamUpperLower, descA, Cham_map_plgsy, (void*)&data_A); #+end_example - The idea here is to let Chameleon fill the matrix data in a - task-based fashion (parallel) by using a function given by the - user. First, the user should define if all the blocks must be - entirelly filled or just the upper/lower part with, /e.g./ - ChamUpperLower. We still relies on the same structure - *CHAM_desc_t* which must be initialized with the proper - parameters, by calling for example *CHAMELEON_Desc_Create*. Then, an - opaque pointer is used to let the user give some extra data used - by his function. The last parameter is the pointer to the user's - function. + The idea here is to let Chameleon fill the matrix data in a task-based fashion (parallel) by using a function given + by the user. First, the user has to give the access mode to the matrix between: *ChamR, *ChamW*, *ChamRW* depending on + the kind of operations the callback function needs to do on the tiles. In our example here we fill the matrix with + random values for the first time so that we use the access mode *ChamW*. Second, the user should define if all the + blocks must be entirelly filled or just the upper/lower part with, /e.g./ ChamUpperLower. We still relies on the + same structure *CHAM_desc_t* which must be initialized with the proper parameters, by calling for example + *CHAMELEON_Desc_Create*. Then comes the pointer to the user's function. And finally the last parameter is an opaque + pointer is used to let the user give some extra data used by his function. *** Using custom data distributions :PROPERTIES: diff --git a/example/lapack_to_chameleon/step6.c b/example/lapack_to_chameleon/step6.c index 721ce14b323ea86eca7c025c779aca6ccce00a2d..633e9a64d1f17770a7d4e4aeef2f9fe954f7c0a5 100644 --- a/example/lapack_to_chameleon/step6.c +++ b/example/lapack_to_chameleon/step6.c @@ -28,7 +28,9 @@ * The data distribution used here is 2D block cyclic, see for example * http://www.netlib.org/scalapack/slug/node75.html for explanation. * The user can enter the parameters of the distribution grid at execution with - * --p= and --q= + * --p=. This example shows also that the user can initialize Chameleon with a + * custom MPI communicator (default is MPI_COMM_WORLD), try this feature with + * --scom=1 (Chameleon will operate only on even MPI ranks). */ int main(int argc, char *argv[]) { size_t N; // matrix order