MDTest updated for AIORI changes.

master
Julian M. Kunkel 2020-05-30 18:30:26 +01:00
parent 1890aaaeb0
commit aa9e2ad815
1 changed files with 32 additions and 31 deletions

View File

@ -166,6 +166,7 @@ static uid_t uid;
/* Use the POSIX backend by default */
static const ior_aiori_t *backend;
static void * backend_options;
static IOR_param_t param;
@ -276,7 +277,7 @@ static void phase_end(){
if(! backend->sync){
FAIL("Error, backend does not provide the sync method, but you requested to use sync.\n");
}
backend->sync(& param);
backend->sync(backend_options);
}
if (barriers) {
@ -318,11 +319,11 @@ static void create_remove_dirs (const char *path, bool create, uint64_t itemNum)
VERBOSE(3,5,"create_remove_items_helper (dirs %s): curr_item is '%s'", operation, curr_item);
if (create) {
if (backend->mkdir(curr_item, DIRMODE, &param) == -1) {
if (backend->mkdir(curr_item, DIRMODE, backend_options) == -1) {
FAIL("unable to create directory %s", curr_item);
}
} else {
if (backend->rmdir(curr_item, &param) == -1) {
if (backend->rmdir(curr_item, backend_options) == -1) {
FAIL("unable to remove directory %s", curr_item);
}
}
@ -339,7 +340,7 @@ static void remove_file (const char *path, uint64_t itemNum) {
sprintf(curr_item, "%s/file.%s"LLU"", path, rm_name, itemNum);
VERBOSE(3,5,"create_remove_items_helper (non-dirs remove): curr_item is '%s'", curr_item);
if (!(shared_file && rank != 0)) {
backend->delete (curr_item, &param);
backend->delete (curr_item, backend_options);
}
}
@ -367,7 +368,7 @@ static void create_file (const char *path, uint64_t itemNum) {
} else if (collective_creates) {
VERBOSE(3,5,"create_remove_items_helper (collective): open..." );
aiori_fh = backend->open (curr_item, IOR_WRONLY | IOR_CREAT, &param);
aiori_fh = backend->open (curr_item, IOR_WRONLY | IOR_CREAT, backend_options);
if (NULL == aiori_fh)
FAIL("unable to open file %s", curr_item);
@ -378,7 +379,7 @@ static void create_file (const char *path, uint64_t itemNum) {
param.filePerProc = !shared_file;
VERBOSE(3,5,"create_remove_items_helper (non-collective, shared): open..." );
aiori_fh = backend->create (curr_item, IOR_WRONLY | IOR_CREAT, &param.backend_options);
aiori_fh = backend->create (curr_item, IOR_WRONLY | IOR_CREAT, backend_options);
if (NULL == aiori_fh)
FAIL("unable to create file %s", curr_item);
}
@ -392,13 +393,13 @@ static void create_file (const char *path, uint64_t itemNum) {
*/
param.offset = 0;
param.fsyncPerWrite = sync_file;
if ( write_bytes != (size_t) backend->xfer (WRITE, aiori_fh, (IOR_size_t *) write_buffer, write_bytes, &param)) {
if ( write_bytes != (size_t) backend->xfer (WRITE, aiori_fh, (IOR_size_t *) write_buffer, write_bytes, backend_options)) {
FAIL("unable to write file %s", curr_item);
}
}
VERBOSE(3,5,"create_remove_items_helper: close..." );
backend->close (aiori_fh, &param);
backend->close (aiori_fh, backend_options);
}
/* helper for creating/removing items */
@ -445,15 +446,15 @@ void collective_helper(const int dirs, const int create, const char* path, uint6
void *aiori_fh;
//create files
aiori_fh = backend->create (curr_item, IOR_WRONLY | IOR_CREAT, &param);
aiori_fh = backend->create (curr_item, IOR_WRONLY | IOR_CREAT, backend_options);
if (NULL == aiori_fh) {
FAIL("unable to create file %s", curr_item);
}
backend->close (aiori_fh, &param);
backend->close (aiori_fh, backend_options);
} else if (!(shared_file && rank != 0)) {
//remove files
backend->delete (curr_item, &param);
backend->delete (curr_item, backend_options);
}
if(CHECK_STONE_WALL(progress)){
progress->items_done = i + 1;
@ -610,7 +611,7 @@ void mdtest_stat(const int random, const int dirs, const long dir_iter, const ch
/* below temp used to be hiername */
VERBOSE(3,5,"mdtest_stat %4s: %s", (dirs ? "dir" : "file"), item);
if (-1 == backend->stat (item, &buf, &param)) {
if (-1 == backend->stat (item, &buf, backend_options)) {
FAIL("unable to stat %s %s", dirs ? "directory" : "file", item);
}
}
@ -707,7 +708,7 @@ void mdtest_read(int random, int dirs, const long dir_iter, char *path) {
VERBOSE(3,5,"mdtest_read file: %s", item);
/* open file for reading */
aiori_fh = backend->open (item, O_RDONLY, &param);
aiori_fh = backend->open (item, O_RDONLY, backend_options);
if (NULL == aiori_fh) {
FAIL("unable to open file %s", item);
}
@ -715,7 +716,7 @@ void mdtest_read(int random, int dirs, const long dir_iter, char *path) {
/* read file */
if (read_bytes > 0) {
read_buffer[0] = 42; /* use a random value to ensure that the read_buffer is now different from the expected buffer and read isn't sometimes NOOP */
if (read_bytes != (size_t) backend->xfer (READ, aiori_fh, (IOR_size_t *) read_buffer, read_bytes, &param)) {
if (read_bytes != (size_t) backend->xfer (READ, aiori_fh, (IOR_size_t *) read_buffer, read_bytes, backend_options)) {
FAIL("unable to read file %s", item);
}
if(verify_read){
@ -727,7 +728,7 @@ void mdtest_read(int random, int dirs, const long dir_iter, char *path) {
}
/* close file */
backend->close (aiori_fh, &param);
backend->close (aiori_fh, backend_options);
}
}
@ -1482,7 +1483,7 @@ void show_file_system_size(char *file_system) {
VERBOSE(1,-1,"Entering show_file_system_size on %s", file_system );
ret = backend->statfs (file_system, &stat_buf, &param);
ret = backend->statfs (file_system, &stat_buf, backend_options);
if (0 != ret) {
FAIL("unable to stat file system %s", file_system);
}
@ -1546,9 +1547,6 @@ void display_freespace(char *testdirpath)
strcpy(dirpath, ".");
}
if (param.api && strcasecmp(param.api, "DFS") == 0)
return;
VERBOSE(3,5,"Before show_file_system_size, dirpath is '%s'", dirpath );
show_file_system_size(dirpath);
VERBOSE(3,5, "After show_file_system_size, dirpath is '%s'\n", dirpath );
@ -1570,7 +1568,7 @@ void create_remove_directory_tree(int create,
if (create) {
VERBOSE(2,5,"Making directory '%s'", dir);
if (-1 == backend->mkdir (dir, DIRMODE, &param)) {
if (-1 == backend->mkdir (dir, DIRMODE, backend_options)) {
fprintf(out_logfile, "error could not create directory '%s'\n", dir);
}
#ifdef HAVE_LUSTRE_LUSTREAPI
@ -1588,7 +1586,7 @@ void create_remove_directory_tree(int create,
if (!create) {
VERBOSE(2,5,"Remove directory '%s'", dir);
if (-1 == backend->rmdir(dir, &param)) {
if (-1 == backend->rmdir(dir, backend_options)) {
FAIL("Unable to remove directory %s", dir);
}
}
@ -1604,7 +1602,7 @@ void create_remove_directory_tree(int create,
if (create) {
VERBOSE(2,5,"Making directory '%s'", temp_path);
if (-1 == backend->mkdir(temp_path, DIRMODE, &param)) {
if (-1 == backend->mkdir(temp_path, DIRMODE, backend_options)) {
FAIL("Unable to create directory %s", temp_path);
}
}
@ -1615,7 +1613,7 @@ void create_remove_directory_tree(int create,
if (!create) {
VERBOSE(2,5,"Remove directory '%s'", temp_path);
if (-1 == backend->rmdir(temp_path, &param)) {
if (-1 == backend->rmdir(temp_path, backend_options)) {
FAIL("Unable to remove directory %s", temp_path);
}
}
@ -1644,8 +1642,8 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t
prep_testdir(j, dir_iter);
VERBOSE(2,5,"main (for j loop): making testdir, '%s'", testdir );
if ((rank < path_count) && backend->access(testdir, F_OK, &param) != 0) {
if (backend->mkdir(testdir, DIRMODE, &param) != 0) {
if ((rank < path_count) && backend->access(testdir, F_OK, backend_options) != 0) {
if (backend->mkdir(testdir, DIRMODE, backend_options) != 0) {
FAIL("Unable to create test directory %s", testdir);
}
#ifdef HAVE_LUSTRE_LUSTREAPI
@ -1825,9 +1823,9 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t
for (int dir_iter = 0; dir_iter < directory_loops; dir_iter ++){
prep_testdir(j, dir_iter);
if ((rank < path_count) && backend->access(testdir, F_OK, &param) == 0) {
if ((rank < path_count) && backend->access(testdir, F_OK, backend_options) == 0) {
//if (( rank == 0 ) && access(testdir, F_OK) == 0) {
if (backend->rmdir(testdir, &param) == -1) {
if (backend->rmdir(testdir, backend_options) == -1) {
FAIL("unable to remove directory %s", testdir);
}
}
@ -1956,6 +1954,7 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
options_all_t * global_options = airoi_create_all_module_options(options);
option_parse(argc, argv, global_options);
updateParsedOptions(& param, global_options);
backend_options = param.backend_options;
free(global_options->modules);
free(global_options);
@ -1964,8 +1963,9 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
MPI_Comm_rank(testComm, &rank);
MPI_Comm_size(testComm, &size);
if (backend->initialize)
backend->initialize(param.backend_options);
if (backend->initialize){
backend->initialize(backend_options);
}
pid = getpid();
uid = getuid();
@ -2256,8 +2256,9 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
free(rand_array);
}
if (backend->finalize)
backend->finalize(param.backend_options);
if (backend->finalize){
backend->finalize(backend_options);
}
return summary_table;
}