|
[ccm_host:~/ccm/source]% ccm_scatterv_x1
i= 0 xout=
i= 2 xout= bc
i= 1 xout= a
i= 3 xout= def
[ccm_host:~/ccm/source] %
The call to ccm_init initializes the communication package. Task 0 allocates and fills the to_send array, that is, how many values will be send to each task. Each task is told how many values to expect by scattering this array into to_get. Space is allocated for the output. On task 0 will fill the array xin with characters. The characters are scattered with ccm_scatterv and each task prints what it has received. Ccm_close is called to close the package. |
|
[ccm_host:~/ccm/source]% ccm_scatterv_x2
send array is: abcdefghijklmnop
i= 0 xout= mnop
i= 2 xout= efgh
i= 3 xout= abcd
i= 1 xout= ijkl
[ccm_host:~/ccm/source] %
The call to ccm_init initializes the communication package. The count and offset arrays are allocated. Each task will receive 4 values. Task 0 fills an array with 16 characters. The program scatters values in reverse order by filling the offset array as shown. Task 3 gets characters from the beginning of the array and task 0 from the end. The program sends the values using ccm_scatterv. They are printed with task 3 writing the beginning of the alphabet. The call to ccm_close closes the communication package. |