00001 #include <string.h>
00002 #include <stdio.h>
00003
00004 #include <moc.h>
00005 #include <internal/imoc.h>
00006
00007 #ifdef __SPU__
00008 #include <spu/moc_datatype_spu.h>
00009 #include <internal/spu/imoc_core_spu.h>
00010 #include <internal/spu/imoc_dma_spu.h>
00011 #include <internal/imoc_macros.h>
00012 #else
00013 #include <ppu/moc_datatype_ppu.h>
00014 #include <internal/ppu/imoc_core_ppu.h>
00015 #include <internal/ppu/imoc_dma_ppu.h>
00016 #include <internal/ppu/imoc_macros_ppu.h>
00017 #endif
00018
00019 int MOC_Send(void* buf, int count, MOC_Datatype datatype, int dest, int tag,
00020 MOC_Comm comm)
00021 {
00022 int bytecount;
00023
00024 if (((datatype & 0xF0) >> 4) == 0)
00025 bytecount = count;
00026 else
00027 bytecount = count * (((datatype & 0xF0) >> 4) * 2);
00028
00029 if (bytecount <= MOC_SEND_TRESHOLD)
00030 return MOC_Bsend(buf, count, datatype, dest, tag, comm);
00031 else
00032 return MOC_Ssend(buf, count, datatype, dest, tag, comm);
00033
00034 return 0;
00035 }
00036