mdtest: Enable IME native interface

This patch makes mdtest allow IME native interface.
It also defines a generic way to enable mdtest with each
backend.
master
Jean-Yves VET 2019-02-11 14:49:14 +01:00
parent c6abf85378
commit 110153cf3a
7 changed files with 59 additions and 38 deletions

View File

@ -138,22 +138,23 @@ static int DUMMY_stat (const char *path, struct stat *buf, IOR_param_t * param){
} }
ior_aiori_t dummy_aiori = { ior_aiori_t dummy_aiori = {
"DUMMY", .name = "DUMMY",
NULL, .name_legacy = NULL,
DUMMY_Create, .create = DUMMY_Create,
DUMMY_Open, .open = DUMMY_Open,
DUMMY_Xfer, .xfer = DUMMY_Xfer,
DUMMY_Close, .close = DUMMY_Close,
DUMMY_Delete, .delete = DUMMY_Delete,
DUMMY_getVersion, .get_version = DUMMY_getVersion,
DUMMY_Fsync, .fsync = DUMMY_Fsync,
DUMMY_GetFileSize, .get_file_size = DUMMY_GetFileSize,
DUMMY_statfs, .statfs = DUMMY_statfs,
DUMMY_mkdir, .mkdir = DUMMY_mkdir,
DUMMY_rmdir, .rmdir = DUMMY_rmdir,
DUMMY_access, .access = DUMMY_access,
DUMMY_stat, .stat = DUMMY_stat,
NULL, .initialize = NULL,
NULL, .finalize = NULL,
DUMMY_options .get_options = DUMMY_options,
.enable_mdtest = true,
}; };

View File

@ -79,6 +79,7 @@ ior_aiori_t ime_aiori = {
.stat = IME_Stat, .stat = IME_Stat,
.initialize = IME_Initialize, .initialize = IME_Initialize,
.finalize = IME_Finalize, .finalize = IME_Finalize,
.enable_mdtest = true,
}; };
/***************************** F U N C T I O N S ******************************/ /***************************** F U N C T I O N S ******************************/

View File

@ -90,6 +90,7 @@ ior_aiori_t posix_aiori = {
.rmdir = aiori_posix_rmdir, .rmdir = aiori_posix_rmdir,
.access = aiori_posix_access, .access = aiori_posix_access,
.stat = aiori_posix_stat, .stat = aiori_posix_stat,
.enable_mdtest = true,
}; };
/***************************** F U N C T I O N S ******************************/ /***************************** F U N C T I O N S ******************************/

View File

@ -92,17 +92,32 @@ void airoi_parse_options(int argc, char ** argv, option_help * global_options){
free(opt.modules); free(opt.modules);
} }
void aiori_supported_apis(char * APIs, char * APIs_legacy){ void aiori_supported_apis(char * APIs, char * APIs_legacy, enum bench_type type)
ior_aiori_t **tmp = available_aiori; {
if(*tmp != NULL){ ior_aiori_t **tmp = available_aiori;
APIs += sprintf(APIs, "%s", (*tmp)->name); char delimiter = ' ';
tmp++;
for (; *tmp != NULL; ++tmp) { while (*tmp != NULL)
APIs += sprintf(APIs, "|%s", (*tmp)->name); {
if ((*tmp)->name_legacy != NULL) if ((type == MDTEST) && !(*tmp)->enable_mdtest)
APIs_legacy += sprintf(APIs_legacy, "|%s", (*tmp)->name_legacy); {
} tmp++;
} continue;
}
if (delimiter == ' ')
{
APIs += sprintf(APIs, "%s", (*tmp)->name);
delimiter = '|';
}
else
APIs += sprintf(APIs, "%c%s", delimiter, (*tmp)->name);
if ((*tmp)->name_legacy != NULL)
APIs_legacy += sprintf(APIs_legacy, "%c%s",
delimiter, (*tmp)->name_legacy);
tmp++;
}
} }
/** /**

View File

@ -22,6 +22,7 @@
#endif /* not MPI_FILE_NULL */ #endif /* not MPI_FILE_NULL */
#include <sys/stat.h> #include <sys/stat.h>
#include <stdbool.h>
#include "ior.h" #include "ior.h"
#include "iordef.h" /* IOR Definitions */ #include "iordef.h" /* IOR Definitions */
@ -83,8 +84,14 @@ typedef struct ior_aiori {
void (*initialize)(); /* called once per program before MPI is started */ void (*initialize)(); /* called once per program before MPI is started */
void (*finalize)(); /* called once per program after MPI is shutdown */ void (*finalize)(); /* called once per program after MPI is shutdown */
option_help * (*get_options)(); option_help * (*get_options)();
bool enable_mdtest;
} ior_aiori_t; } ior_aiori_t;
enum bench_type {
IOR,
MDTEST
};
extern ior_aiori_t dummy_aiori; extern ior_aiori_t dummy_aiori;
extern ior_aiori_t hdf5_aiori; extern ior_aiori_t hdf5_aiori;
extern ior_aiori_t hdfs_aiori; extern ior_aiori_t hdfs_aiori;
@ -102,7 +109,7 @@ void aiori_initialize(IOR_test_t * tests);
void aiori_finalize(IOR_test_t * tests); void aiori_finalize(IOR_test_t * tests);
const ior_aiori_t *aiori_select (const char *api); const ior_aiori_t *aiori_select (const char *api);
int aiori_count (void); int aiori_count (void);
void aiori_supported_apis(char * APIs, char * APIs_legacy); void aiori_supported_apis(char * APIs, char * APIs_legacy, enum bench_type type);
void airoi_parse_options(int argc, char ** argv, option_help * global_options); void airoi_parse_options(int argc, char ** argv, option_help * global_options);
const char *aiori_default (void); const char *aiori_default (void);

View File

@ -150,7 +150,7 @@ static mdtest_results_t * summary_table;
static pid_t pid; static pid_t pid;
static uid_t uid; static uid_t uid;
/* just use the POSIX backend for now */ /* Use the POSIX backend by default */
static const char *backend_name = "POSIX"; static const char *backend_name = "POSIX";
static const ior_aiori_t *backend; static const ior_aiori_t *backend;
@ -1323,7 +1323,7 @@ void print_help (void) {
char APIs[1024]; char APIs[1024];
char APIs_legacy[1024]; char APIs_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy); aiori_supported_apis(APIs, APIs_legacy, MDTEST);
char apiStr[1024]; char apiStr[1024];
sprintf(apiStr, "API for I/O [%s]", APIs); sprintf(apiStr, "API for I/O [%s]", APIs);
@ -1573,10 +1573,6 @@ void valid_tests() {
FAIL("-c not compatible with -B"); FAIL("-c not compatible with -B");
} }
if (strcasecmp(backend_name, "POSIX") != 0 && strcasecmp(backend_name, "DUMMY") != 0) {
FAIL("-a only supported interface is POSIX (and DUMMY) right now!");
}
/* check for shared file incompatibilities */ /* check for shared file incompatibilities */
if (unique_dir_per_task && shared_file && rank == 0) { if (unique_dir_per_task && shared_file && rank == 0) {
FAIL("-u not compatible with -S"); FAIL("-u not compatible with -S");
@ -2131,7 +2127,7 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
int randomize = 0; int randomize = 0;
char APIs[1024]; char APIs[1024];
char APIs_legacy[1024]; char APIs_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy); aiori_supported_apis(APIs, APIs_legacy, MDTEST);
char apiStr[1024]; char apiStr[1024];
sprintf(apiStr, "API for I/O [%s]", APIs); sprintf(apiStr, "API for I/O [%s]", APIs);

View File

@ -467,7 +467,7 @@ IOR_test_t *ParseCommandLine(int argc, char **argv)
char APIs[1024]; char APIs[1024];
char APIs_legacy[1024]; char APIs_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy); aiori_supported_apis(APIs, APIs_legacy, IOR);
char apiStr[1024]; char apiStr[1024];
sprintf(apiStr, "API for I/O [%s]", APIs); sprintf(apiStr, "API for I/O [%s]", APIs);