大概应该是athread_get(RANK_MODE, src, dst, len, &reply, mask, stride, bsize)
比如athread_get(RANK_MODE, src, dst, 1024, &reply, 0xff, 0, 32)应该是: len=1024, mask=0xff, bsize=32
可以获取1024B数据,其中从核0获得0-32B, 256-288B, 512-544B, 768-800B, 从核1获得32-63B, 288-320B, 544-576B, 800-832B, 以此类推。
例子:
#ifdef MPE
#include <athread.h>
#include <stdio.h>
extern SLAVE_FUN(rank_mode)(double *);
int main(){
double data[128];
int i;
for (i = 0; i < 128; i ++){
data[i] = i;
}
athread_init();
athread_spawn(rank_mode, data);
athread_join();
athread_halt();
}
#endif
#ifdef CPE
#include <slave.h>
void rank_mode(double *data){
if (_ROW > 0) return;
double d_local[16];
volatile int reply;
athread_syn(ROW_SCOPE, 0xff);
if (_COL == 0){
reply = 0;
athread_get(RANK_MODE, data, d_local, 1024, &reply, 0xff, 0, 32);
while (reply != 1);
}
athread_syn(ROW_SCOPE, 0xff);
int i;
for (i = 0; i < 8; i ++){
athread_syn(ROW_SCOPE, 0xff);
if (_COL == i){
printf("%d:", _COL);
int j;
for (j = 0; j < 16; j ++){
printf("%f ", d_local[j]);
}
puts("");
}
}
}
#endif