In distributed memory systems, arrays can be partitioned among local memories of processors. These partitioned arrays are called distributed arrays . Users can either partition arrays regularly, e.g. in block or cyclic, or specify irregular mapping of arrays to processors. The distributions of data arrays have significant impact on performance because they determine the patterns of communication between processors. It is frequently advantageous to partition arrays in appropriate irregular distributions. Chaos provides primitives to map arrays onto processors and uses translation tables to describe the distributions of distributed arrays.
Chaos also provides a set of primitives that carry out optimizations at runtime to reduce both the number of messages and the volume of interprocessor communication. The runtime primitives examine the data accesses made by each processor, calculate what off-processor data have to be fetched and where the data will be stored, and then generate communication schedules to specify the patterns of communication for exchanging data. Once the communication schedules are ready, efficient gather and scatter routines can be used to exchange data between processors.
typedef struct DsChunk { int *Proc,*Offset; } PAGE, *PAGEPTR; /* * structure for distributed translation table */ typedef struct DsTable { int pageSize; /* Size of a single page in the translation table */ int LastBlock; /* Remainder in the block distribution of pages */ int Replication; /* Number of blocks replicated in the processor */ int numPages; /* Total number of pages in the table */ int *Loffset; /* Buffer space for the storage of offsets */ int *Lproc; /* Buffer space for the storage of procs */ int nMyIndices; /* size of portion of translation table allocated to my indices */ float repFactor; /* Replication factor */ PAGEPTR *pageTable; /* Pointer to the chunks stored in the table */ } DSTABLE, *DSTABLEPTR; /* * Structure for regular translation, which does not need enumeration - this is only for simple regular distributions in CHAOS */ typedef struct regTable { int dist_type ; int data_size ; int block_size ; } REG_TABLE, *REGTABLEPTR ; /* * Structure for User Translation Table */ typedef struct trans_table { int type; DSTABLE *tabptr; REG_TABLE *regptr; } TTABLE, *TTABLEPTR;