libxmp/libxmpf in Omni Compiler
1.3.4
|
|
size_t | xmp_coarray_malloc_bytes () |
|
size_t | xmp_coarray_allocated_bytes () |
|
size_t | xmp_coarray_garbage_bytes () |
|
CoarrayInfo_t * | XMPCO_malloc_coarray (char **addr, int count, size_t element, ResourceSet_t *rset) |
|
CoarrayInfo_t * | XMPCO_regmem_coarray (void *var, int count, size_t element, ResourceSet_t *rset) |
|
CoarrayInfo_t * | XMPCO_malloc_staticCoarray (char **addr, int count, size_t element, int namelen, char *name) |
| have a share of memory in the pool (if not larger than threshold) or allocate individually (if larger than threshold) out: return : pointer to descriptor CoarrayInfo_t addr : address of the coarray object to be allocated in: count : count of elements element: element size namelen: character length of name (for debugging) name : name of the coarray (for debugging) More...
|
|
CoarrayInfo_t * | XMPCO_regmem_staticCoarray (void *var, int count, size_t element, int namelen, char *name) |
| Similar to _alloc_static_coarray() except that the coarray is allocated not by the runtime but by the Fortran system. More...
|
|
void | XMPCO_free_coarray (CoarrayInfo_t *cinfo) |
|
void | XMPCO_deregmem_coarray (CoarrayInfo_t *cinfo) |
|
void | XMPCO_malloc_pool () |
|
void | XMPCO_count_size (int count, size_t element) |
|
MPI_Comm | _XMPCO_get_comm_fromCoarrayInfo (CoarrayInfo_t *cinfo) |
|
void | XMPCO_prolog (ResourceSet_t **rsetp, int namelen, char *name) |
|
void | XMPCO_epilog (ResourceSet_t **rsetp) |
|
CoarrayInfo_t * | XMPCO_find_descptr (char *addr, int namelen, char *name) |
| generate and return a descriptor for a coarray DUMMY ARGUMENT More...
|
|
void | _XMPCO_set_corank (CoarrayInfo_t *cp, int corank) |
|
void | _XMPCO_set_codim_withBounds (CoarrayInfo_t *cp, int dim, int lb, int ub) |
|
void | _XMPCO_set_codim_withSize (CoarrayInfo_t *cp, int dim, int lb, int size) |
|
void | _XMPCO_set_varname (CoarrayInfo_t *cp, int namelen, char *name) |
|
CoarrayInfo_t * | _XMPCO_set_nodes (CoarrayInfo_t *cinfo, _XMP_nodes_t *nodes) |
|
char * | _XMPCO_get_nameOfCoarray (CoarrayInfo_t *cinfo) |
|
char * | _XMPCO_get_baseAddrOfCoarray (CoarrayInfo_t *cinfo) |
|
size_t | _XMPCO_get_sizeOfCoarray (CoarrayInfo_t *cinfo) |
|
size_t | _XMPCO_get_offsetInCoarray (CoarrayInfo_t *cinfo, char *addr) |
|
void * | _XMPCO_get_descForMemoryChunk (CoarrayInfo_t *cinfo) |
|
char * | _XMPCO_get_orgAddrOfMemoryChunk (CoarrayInfo_t *cinfo) |
|
size_t | _XMPCO_get_sizeOfMemoryChunk (CoarrayInfo_t *cinfo) |
|
size_t | _XMPCO_get_offsetInMemoryChunk (CoarrayInfo_t *cinfo, char *addr) |
|
BOOL | _XMPCO_isAddrInMemoryChunk (char *localAddr, CoarrayInfo_t *cinfo) |
|
void * | _XMPCO_get_infoOfCtrlData (char **baseAddr, size_t *offset, char **name) |
|
void * | _XMPCO_get_infoOfLocalBuf (char **baseAddr, size_t *offset, char **name) |
|
void * | _XMPCO_get_desc_fromLocalAddr (char *localAddr, char **orgAddr, size_t *offset, char **name) |
|
int | _XMPCO_nowInTask () |
|
void | _XMPCO_checkIfInTask (char *msgopt) |
|
◆ _XMPCO_checkIfInTask()
void _XMPCO_checkIfInTask |
( |
char * |
msgopt | ) |
|
1429 "cannot use %s in any task construct\n", msgopt);
◆ _XMPCO_get_baseAddrOfCoarray()
◆ _XMPCO_get_comm_fromCoarrayInfo()
MPI_Comm _XMPCO_get_comm_fromCoarrayInfo |
( |
CoarrayInfo_t * |
cinfo | ) |
|
530 return MPI_COMM_NULL;
535 return MPI_COMM_NULL;
537 return *(MPI_Comm*)(nodes->
comm);
◆ _XMPCO_get_desc_fromLocalAddr()
void* _XMPCO_get_desc_fromLocalAddr |
( |
char * |
localAddr, |
|
|
char ** |
orgAddr, |
|
|
size_t * |
offset, |
|
|
char ** |
name |
|
) |
| |
787 MemoryChunk_t* chunk = _findMemoryChunkInSortedChunkTable(localAddr);
791 *name =
"(not found)";
796 *offset = localAddr - *orgAddr;
◆ _XMPCO_get_descForMemoryChunk()
◆ _XMPCO_get_infoOfCtrlData()
void* _XMPCO_get_infoOfCtrlData |
( |
char ** |
baseAddr, |
|
|
size_t * |
offset, |
|
|
char ** |
name |
|
) |
| |
762 char *orgAddr = chunk->
orgAddr;
764 *baseAddr = _cinfo_ctrlData->
baseAddr;
765 *offset = orgAddr - *baseAddr;
766 *name = _cinfo_ctrlData->
name;
◆ _XMPCO_get_infoOfLocalBuf()
void* _XMPCO_get_infoOfLocalBuf |
( |
char ** |
baseAddr, |
|
|
size_t * |
offset, |
|
|
char ** |
name |
|
) |
| |
773 char *orgAddr = chunk->
orgAddr;
775 *baseAddr = _cinfo_localBuf->
baseAddr;
776 *offset = orgAddr - *baseAddr;
777 *name = _cinfo_localBuf->
name;
◆ _XMPCO_get_nameOfCoarray()
◆ _XMPCO_get_offsetInCoarray()
size_t _XMPCO_get_offsetInCoarray |
( |
CoarrayInfo_t * |
cinfo, |
|
|
char * |
addr |
|
) |
| |
718 size_t offset = addr - cinfo->
baseAddr;
◆ _XMPCO_get_offsetInMemoryChunk()
size_t _XMPCO_get_offsetInMemoryChunk |
( |
CoarrayInfo_t * |
cinfo, |
|
|
char * |
addr |
|
) |
| |
743 size_t offset = addr - orgAddr;
◆ _XMPCO_get_orgAddrOfMemoryChunk()
◆ _XMPCO_get_sizeOfCoarray()
◆ _XMPCO_get_sizeOfMemoryChunk()
◆ _XMPCO_isAddrInMemoryChunk()
751 size_t offset = localAddr - orgAddr;
752 BOOL result = (offset < size);
◆ _XMPCO_nowInTask()
◆ _XMPCO_set_codim_withBounds()
void _XMPCO_set_codim_withBounds |
( |
CoarrayInfo_t * |
cp, |
|
|
int |
dim, |
|
|
int |
lb, |
|
|
int |
ub |
|
) |
| |
620 int i, count, n_images, size;
622 if (0 <= dim && dim < cp->corank - 1) {
630 else if (dim == cp->
corank - 1) {
634 for (i = 0, count = 1; i < cp->
corank - 1; i++)
641 _XMPCO_fatal(
"spedified dim (%d) is too large or less than zero.\n", dim);
◆ _XMPCO_set_codim_withSize()
void _XMPCO_set_codim_withSize |
( |
CoarrayInfo_t * |
cp, |
|
|
int |
dim, |
|
|
int |
lb, |
|
|
int |
size |
|
) |
| |
647 int i, count, n_images, ub;
649 if (0 <= dim && dim < cp->corank - 1) {
657 else if (dim == cp->
corank - 1) {
661 for (i = 0, count = 1; i < cp->
corank - 1; i++)
668 _XMPCO_fatal(
"Spedified dim (%d) is too large or less than zero.\n", dim);
◆ _XMPCO_set_corank()
609 cp->
lcobound = (
int*)_MALLOC(
sizeof(
int) * corank);
610 cp->
ucobound = (
int*)_MALLOC(
sizeof(
int) * corank);
611 cp->
cosize = (
int*)_MALLOC(
sizeof(
int) * corank);
614 _dispCoarrayInfo(cp), cp->
corank);
◆ _XMPCO_set_nodes()
685 cinfo->
nodes = nodes;
690 cinfo1->
nodes = nodes;
◆ _XMPCO_set_varname()
void _XMPCO_set_varname |
( |
CoarrayInfo_t * |
cp, |
|
|
int |
namelen, |
|
|
char * |
name |
|
) |
| |
675 cp->
name = _xmp_strndup(name, namelen);
677 _dispCoarrayInfo(cp));
◆ xmp_coarray_allocated_bytes()
size_t xmp_coarray_allocated_bytes |
( |
| ) |
|
121 chunk = chunkp->
chunk;
122 size1 = size + chunk->
nbytes;
124 _XMPCO_fatal(
"More than %llu-bytes of memory required for static coarrays\n",
131 size -= _cinfo_ctrlData->
size + _cinfo_localBuf->
size;
◆ xmp_coarray_garbage_bytes()
size_t xmp_coarray_garbage_bytes |
( |
| ) |
|
145 chunk = chunkp->
chunk;
◆ xmp_coarray_malloc_bytes()
size_t xmp_coarray_malloc_bytes |
( |
| ) |
|
◆ XMPCO_count_size()
void XMPCO_count_size |
( |
int |
count, |
|
|
size_t |
element |
|
) |
| |
508 size_t thisSize = count * element;
513 " pooling threshold :%10u bytes\n"
514 " data size :%10u bytes\n",
519 pool_totalSize += mallocSize;
521 " %u bytes, totally %u bytes\n",
522 mallocSize, pool_totalSize);
◆ XMPCO_deregmem_coarray()
382 _dispMemoryChunk(chunk));
385 _unlinkCoarrayInfo(cinfo);
386 _freeCoarrayInfo(cinfo);
390 _unlinkMemoryChunk(chunk);
◆ XMPCO_epilog()
556 (*rsetp)->name, *rsetp);
558 _freeResourceSet(*rsetp);
◆ XMPCO_find_descptr()
CoarrayInfo_t* XMPCO_find_descptr |
( |
char * |
addr, |
|
|
int |
namelen, |
|
|
char * |
name |
|
) |
| |
generate and return a descriptor for a coarray DUMMY ARGUMENT
- find the memory chunk that contains the coarray data object,
- generate coarrayInfo for the coarray dummy argument and link it to the memory chunk, and
- return coarrayInfo as descPtr
579 "(varname=\'%.*s\')\n",
586 myChunk = _findMemoryChunkInSortedChunkTable(addr);
588 if (myChunk != NULL) {
590 _dispMemoryChunk(myChunk));
592 _addCoarrayInfo(myChunk, cinfo);
◆ XMPCO_free_coarray()
359 _dispMemoryChunk(chunk));
362 _unlinkCoarrayInfo(cinfo);
363 _freeCoarrayInfo(cinfo);
367 _unlinkMemoryChunk(chunk);
369 _garbageCollectMallocHistory();
◆ XMPCO_malloc_coarray()
162 size_t nbytes = count * element;
169 _dispMemoryChunk(chunk));
172 _addMemoryChunkInResourceSet(rset, chunk);
175 _dispMemoryChunk(chunk), rset);
181 _addCoarrayInfo(chunk, cinfo);
◆ XMPCO_malloc_pool()
void XMPCO_malloc_pool |
( |
| ) |
|
457 size_t ctrlDataSize =
sizeof(int) * 8;
461 " system-defined local buffer :%10u bytes\n"
462 " system-defined control data :%10u bytes\n"
463 " user-defined coarays :%10u bytes\n",
464 localBufSize, ctrlDataSize, pool_totalSize);
466 pool_totalSize += localBufSize + ctrlDataSize;
469 _initMallocHistory();
472 _initSortedChunkTable();
475 pool_chunk = _mallocMemoryChunk(1, pool_totalSize);
476 pool_currentAddr = pool_chunk->
orgAddr;
479 _cinfo_localBuf = _getShareOfStaticCoarray(localBufSize);
480 _cinfo_localBuf->
name =
"(localBuf)";
481 _setSimpleCoshapeToCoarrayInfo(_cinfo_localBuf);
484 _cinfo_ctrlData = _getShareOfStaticCoarray(ctrlDataSize);
485 _cinfo_ctrlData->
name =
"(ctrlData)";
486 _setSimpleCoshapeToCoarrayInfo(_cinfo_ctrlData);
◆ XMPCO_malloc_staticCoarray()
CoarrayInfo_t* XMPCO_malloc_staticCoarray |
( |
char ** |
addr, |
|
|
int |
count, |
|
|
size_t |
element, |
|
|
int |
namelen, |
|
|
char * |
name |
|
) |
| |
have a share of memory in the pool (if not larger than threshold) or allocate individually (if larger than threshold) out: return : pointer to descriptor CoarrayInfo_t addr : address of the coarray object to be allocated in: count : count of elements element: element size namelen: character length of name (for debugging) name : name of the coarray (for debugging)
224 size_t nbytes = count * element;
228 " count=%d, element=%d, nbytes=%u\n",
229 namelen, name, count, element, nbytes);
233 cinfo = _allocLargeStaticCoarray(nbytes);
237 cinfo = _getShareOfStaticCoarray(nbytesRU);
239 cinfo->
name = _xmp_strndup(name, namelen);
◆ XMPCO_prolog()
void XMPCO_prolog |
( |
ResourceSet_t ** |
rsetp, |
|
|
int |
namelen, |
|
|
char * |
name |
|
) |
| |
543 *rsetp = _newResourceSet(name, namelen);
546 (*rsetp)->name, *rsetp);
◆ XMPCO_regmem_coarray()
192 size_t nbytes = count * element;
199 _dispMemoryChunk(chunk));
204 _addCoarrayInfo(chunk, cinfo);
◆ XMPCO_regmem_staticCoarray()
CoarrayInfo_t* XMPCO_regmem_staticCoarray |
( |
void * |
var, |
|
|
int |
count, |
|
|
size_t |
element, |
|
|
int |
namelen, |
|
|
char * |
name |
|
) |
| |
Similar to _alloc_static_coarray() except that the coarray is allocated not by the runtime but by the Fortran system.
out: return : pointer to descriptor CoarrayInfo_t in: var : pointer to the coarray count : count of elements element : element size name : name of the coarray (for debugging) namelen : character length of name (for debugging)
263 " count=%d, element=%ud\n",
264 namelen, name, count, element);
269 _XMPCO_fatal(
"boundary violation detected for coarray \'%.*s\'\n"
274 size_t nbytes = count * element;
280 cinfo = _regmemStaticCoarray(var, nbytes);
282 cinfo->
name = _xmp_strndup(name, namelen);
◆ _mallocStack
struct { ... } _mallocStack |
◆ head
◆ tail
#define ROUND_UP_MALLOC(n)
Definition: xmpco_internal.h:21
size_t nbytes
Definition: _xmpco_alloc.h:82
MemoryChunk_t * chunk
Definition: _xmpco_alloc.h:114
int corank
Definition: _xmpco_alloc.h:99
CoarrayInfo_t * headCoarray
Definition: _xmpco_alloc.h:84
char * baseAddr
Definition: _xmpco_alloc.h:97
void _XMPCO_debugPrint(char *format,...)
Definition: xmpco_msg.c:20
size_t size
Definition: _xmpco_alloc.h:98
BOOL isGarbage
Definition: _xmpco_alloc.h:80
void * desc
Definition: _xmpco_alloc.h:83
#define forallMemoryChunkOrder(cp)
Definition: _xmpco_alloc.h:16
char * name
Definition: _xmpco_alloc.h:96
#define MALLOC_UNIT
Definition: xmpco_params.h:38
int _XMPCO_get_initialNumImages(void)
Definition: xmpco_lib.c:133
void XMPCO_sync_all_auto(void)
Definition: xmpco_sync.c:34
int * cosize
Definition: _xmpco_alloc.h:102
#define BOOL
Definition: xmpco_internal.h:14
#define DIV_CEILING(m, n)
Definition: _xmpco_alloc.h:14
_XMP_nodes_t * nodes
Definition: _xmpco_alloc.h:103
char * orgAddr
Definition: _xmpco_alloc.h:81
#define IsEmptyMemoryChunk(chk)
Definition: _xmpco_alloc.h:51
void _XMPCO_fatal(char *format,...)
Definition: xmpco_msg.c:4
structure for each malloc/free call Every memory chunk is linked both:
Definition: _xmpco_alloc.h:76
_XMP_comm_t * comm
Definition: xmp_data_struct.h:53
int _XMPCO_get_currentNumImages(void)
Definition: xmpco_lib.c:143
MEMORY MANAGEMENT STRUCTURE-II (for dynamic ALLOCATE/DEALLOCATE stmts.
Definition: _xmpco_alloc.h:111
char * _XMPCO_get_orgAddrOfMemoryChunk(CoarrayInfo_t *cinfo)
Definition: xmpco_alloc.c:730
size_t _XMPCO_get_localBufSize(void)
Definition: xmpco_params.c:84
int _XMPCO_nowInTask()
Definition: xmpco_alloc.c:1420
Definition: xmp_data_struct.h:40
CoarrayInfo_t * next
Definition: _xmpco_alloc.h:94
structure for each coarray variable One or more coarrays can be linked from a single memory chunk and...
Definition: _xmpco_alloc.h:92
MemoryChunk_t * parent
Definition: _xmpco_alloc.h:95
size_t _XMPCO_get_sizeOfMemoryChunk(CoarrayInfo_t *cinfo)
Definition: xmpco_alloc.c:735
int * lcobound
Definition: _xmpco_alloc.h:100
int * ucobound
Definition: _xmpco_alloc.h:101
unsigned _XMPCO_get_poolThreshold(void)
Definition: xmpco_params.c:83