Doc: src comments for getOffsetArray functions

master
Enno Zickler 2018-02-28 18:50:30 +01:00
parent 6267203147
commit 16c8ef6a23
1 changed files with 25 additions and 1 deletions

View File

@ -2431,6 +2431,13 @@ static void ValidateTests(IOR_param_t * test)
}
}
/**
* Returns a precomputed array of IOR_offset_t for the inner benchmark loop.
* They are sequential and the last element is set to -1 as end marker.
* @param test IOR_param_t for getting transferSize, blocksize and SegmentCount
* @param pretendRank int pretended Rank for shifting the offsest corectly
* @return IOR_offset_t
*/
static IOR_offset_t *GetOffsetArraySequential(IOR_param_t * test,
int pretendRank)
{
@ -2466,6 +2473,21 @@ static IOR_offset_t *GetOffsetArraySequential(IOR_param_t * test,
return (offsetArray);
}
/**
* Returns a precomputed array of IOR_offsett_t for the inner benchmark loop.
* They get created sequentially and mixed up in the end. The last array element
* is set to -1 as end marker.
* It should be noted that as the seeds get synchronised across all processes
* every process computes the same random order if used with filePerProc.
* For a shared file all transfers get randomly assigned to ranks. The processes
* can also have differen't numbers of transfers. This might lead to a bigger
* diversion in accesse as it dose with filePerProc. This is expected but
* should be mined.
* @param test IOR_param_t for getting transferSize, blocksize and SegmentCount
* @param pretendRank int pretended Rank for shifting the offsest corectly
* @return IOR_offset_t
* @return
*/
static IOR_offset_t *GetOffsetArrayRandom(IOR_param_t * test, int pretendRank,
int access)
{
@ -2492,6 +2514,8 @@ static IOR_offset_t *GetOffsetArrayRandom(IOR_param_t * test, int pretendRank,
/* count needed offsets (pass 1) */
for (i = 0; i < fileSize; i += test->transferSize) {
if (test->filePerProc == FALSE) {
// this counts which process get how many transferes in
// a shared file
if ((random() % test->numTasks) == pretendRank) {
offsets++;
}
@ -2514,7 +2538,7 @@ static IOR_offset_t *GetOffsetArrayRandom(IOR_param_t * test, int pretendRank,
}
} else {
/* fill with offsets (pass 2) */
srandom(seed); /* need same seed */
srandom(seed); /* need same seed to get same transfers as counted in the beginning*/
for (i = 0; i < fileSize; i += test->transferSize) {
if ((random() % test->numTasks) == pretendRank) {
offsetArray[offsetCnt] = i;