MDTest remove testdir if created by MDTest.

master
Julian M. Kunkel 2020-07-02 16:26:05 +01:00
parent fb9fa7cc9f
commit 4f7350dc6a
1 changed files with 6 additions and 0 deletions

View File

@ -1932,6 +1932,7 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
int last = 0;
int stride = 1;
int iterations = 1;
int created_root_dir = 0; // was the root directory existing or newly created
verbose = 0;
int no_barriers = 0;
@ -2189,6 +2190,7 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
if (backend->mkdir(testdirpath, DIRMODE, backend_options) != 0) {
FAIL("Unable to create test directory path %s", testdirpath);
}
created_root_dir = 1;
}
/* display disk usage */
@ -2295,6 +2297,10 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
}
}
if (created_root_dir && backend->rmdir(testdirpath, backend_options) != 0) {
FAIL("Unable to remote test directory path %s", testdirpath);
}
if(verification_error){
VERBOSE(0, -1, "\nERROR: verifying the data read! Take the performance values with care!\n");
}