Skip to content
This repository was archived by the owner on Feb 24, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,22 +1254,34 @@ static void PrintRemoveTiming(double start, double finish, int rep)
static void RemoveFile(char *testFileName, int filePerProc, IOR_param_t * test)
{
int tmpRankOffset;
char *strippedFileName;

/* consider a file with a ROMIO prefix: ufs:/path/to/file
* posix routines do not understand 'ufs:/path/to/file'; need
* '/path/to/file' instead. */
strippedFileName = strchr(testFileName, ':');
if (strippedFileName > testFileName + 1)
strippedFileName = strippedFileName + 1;
else
/* no prefix, so leave it alone */
strippedFileName = testFileName;

if (filePerProc) {
/* in random tasks, delete own file */
if (test->reorderTasksRandom == TRUE) {
tmpRankOffset = rankOffset;
rankOffset = 0;
GetTestFileName(testFileName, test);
}
if (access(testFileName, F_OK) == 0) {
if (access(strippedFileName, F_OK) == 0) {
backend->delete(testFileName, test);
}
if (test->reorderTasksRandom == TRUE) {
rankOffset = tmpRankOffset;
GetTestFileName(testFileName, test);
}
} else {
if ((rank == 0) && (access(testFileName, F_OK) == 0)) {
if ((rank == 0) && (access(strippedFileName, F_OK) == 0)) {
backend->delete(testFileName, test);
}
}
Expand Down