Xin and xout can be any intrinsic Fortran data type: integer, real, double precision, complex, logical or, character. Both must be arrays.
|
[ccm_host:~/ccm/source]% ccm_alltoall_x1
i= 0 xout= 1 2 2 3 3 3
i= 1 xout= 0 1 1 2 2 2 3 3 3 3
i= 2 xout= 0 0 1 1 1 2 2 2 2 3 3 3 3 3
i= 3 xout= 0 0 0 1 1 1 1 2 2 2 2 2 3 3 3 3 3 3
[ccm_host:~/ccm/source] %
The call to ccm_init initializes the communication package. Space is allocated for the counts arrays, to_send and to_get. Each task sets the number of values it is going to send. These values are exchanged with the ccm_alltoall. Space is allocated for xin and xout. The values are exchanged with the ccm_alltoallv and finally printed. Ccm_close is called to close the package. |
|
[ccm_host:~/ccm/source]% ccm_alltoall_x1
i= 0 xout= 10.0 0.0 11.0 0.0 12.0 0.0 13.0 0.0
i= 1 xout= 10.0 0.0 11.0 0.0 12.0 0.0 13.0 0.0
i= 2 xout= 10.0 0.0 11.0 0.0 12.0 0.0 13.0 0.0
i= 3 xout= 10.0 0.0 11.0 0.0 12.0 0.0 13.0 0.0
[ccm_host:~/ccm/source] %
The call to ccm_init initializes the communication package. The count and offset arrays are allocated. Each task will send and receive a single value to/from the other tasks. Send_off is set to the running total of the to_send array. On the receive side, the values will be stored with a space between them. Thus, get_off values are incremented by 2. Ccm_alltoallv is called to tranfer the values and they are printed. Note the space (0.0) between the received values. The call to ccm_close closes the communication package. |