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 = {
"DUMMY",
NULL,
DUMMY_Create,
DUMMY_Open,
DUMMY_Xfer,
DUMMY_Close,
DUMMY_Delete,
DUMMY_getVersion,
DUMMY_Fsync,
DUMMY_GetFileSize,
DUMMY_statfs,
DUMMY_mkdir,
DUMMY_rmdir,
DUMMY_access,
DUMMY_stat,
NULL,
NULL,
DUMMY_options
.name = "DUMMY",
.name_legacy = NULL,
.create = DUMMY_Create,
.open = DUMMY_Open,
.xfer = DUMMY_Xfer,
.close = DUMMY_Close,
.delete = DUMMY_Delete,
.get_version = DUMMY_getVersion,
.fsync = DUMMY_Fsync,
.get_file_size = DUMMY_GetFileSize,
.statfs = DUMMY_statfs,
.mkdir = DUMMY_mkdir,
.rmdir = DUMMY_rmdir,
.access = DUMMY_access,
.stat = DUMMY_stat,
.initialize = NULL,
.finalize = NULL,
.get_options = DUMMY_options,
.enable_mdtest = true,
};

View File

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

View File

@ -90,6 +90,7 @@ ior_aiori_t posix_aiori = {
.rmdir = aiori_posix_rmdir,
.access = aiori_posix_access,
.stat = aiori_posix_stat,
.enable_mdtest = true,
};
/***************************** 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);
}
void aiori_supported_apis(char * APIs, char * APIs_legacy){
ior_aiori_t **tmp = available_aiori;
if(*tmp != NULL){
APIs += sprintf(APIs, "%s", (*tmp)->name);
tmp++;
for (; *tmp != NULL; ++tmp) {
APIs += sprintf(APIs, "|%s", (*tmp)->name);
if ((*tmp)->name_legacy != NULL)
APIs_legacy += sprintf(APIs_legacy, "|%s", (*tmp)->name_legacy);
}
}
void aiori_supported_apis(char * APIs, char * APIs_legacy, enum bench_type type)
{
ior_aiori_t **tmp = available_aiori;
char delimiter = ' ';
while (*tmp != NULL)
{
if ((type == MDTEST) && !(*tmp)->enable_mdtest)
{
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 */
#include <sys/stat.h>
#include <stdbool.h>
#include "ior.h"
#include "iordef.h" /* IOR Definitions */
@ -83,8 +84,14 @@ typedef struct ior_aiori {
void (*initialize)(); /* called once per program before MPI is started */
void (*finalize)(); /* called once per program after MPI is shutdown */
option_help * (*get_options)();
bool enable_mdtest;
} ior_aiori_t;
enum bench_type {
IOR,
MDTEST
};
extern ior_aiori_t dummy_aiori;
extern ior_aiori_t hdf5_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);
const ior_aiori_t *aiori_select (const char *api);
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);
const char *aiori_default (void);

View File

@ -150,7 +150,7 @@ static mdtest_results_t * summary_table;
static pid_t pid;
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 ior_aiori_t *backend;
@ -1323,7 +1323,7 @@ void print_help (void) {
char APIs[1024];
char APIs_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy);
aiori_supported_apis(APIs, APIs_legacy, MDTEST);
char apiStr[1024];
sprintf(apiStr, "API for I/O [%s]", APIs);
@ -1573,10 +1573,6 @@ void valid_tests() {
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 */
if (unique_dir_per_task && shared_file && rank == 0) {
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;
char APIs[1024];
char APIs_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy);
aiori_supported_apis(APIs, APIs_legacy, MDTEST);
char apiStr[1024];
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_legacy[1024];
aiori_supported_apis(APIs, APIs_legacy);
aiori_supported_apis(APIs, APIs_legacy, IOR);
char apiStr[1024];
sprintf(apiStr, "API for I/O [%s]", APIs);