Moded sync() to aiori backend.

master
Julian M. Kunkel 2019-09-01 15:47:42 +01:00
parent 6de1ea3176
commit e3db1759b2
5 changed files with 17 additions and 9 deletions

View File

@ -71,6 +71,7 @@
static IOR_offset_t POSIX_Xfer(int, void *, IOR_size_t *,
IOR_offset_t, IOR_param_t *);
static void POSIX_Fsync(void *, IOR_param_t *);
static void POSIX_Sync(IOR_param_t * );
/************************** O P T I O N S *****************************/
typedef struct{
@ -122,6 +123,7 @@ ior_aiori_t posix_aiori = {
.stat = aiori_posix_stat,
.get_options = POSIX_options,
.enable_mdtest = true,
.sync = POSIX_Sync
};
/***************************** F U N C T I O N S ******************************/
@ -588,6 +590,16 @@ static void POSIX_Fsync(void *fd, IOR_param_t * param)
EWARNF("fsync(%d) failed", *(int *)fd);
}
static void POSIX_Sync(IOR_param_t * param)
{
int ret = system("sync");
if (ret != 0){
FAIL("Error executing the sync command, ensure it exists.");
}
}
/*
* Close a file through the POSIX interface.
*/

View File

@ -86,6 +86,7 @@ typedef struct ior_aiori {
void (*finalize)(); /* called once per program after MPI is shutdown */
option_help * (*get_options)(void ** init_backend_options, void* init_values); /* initializes the backend options as well and returns the pointer to the option help structure */
bool enable_mdtest;
void (*sync)(IOR_param_t * ); /* synchronize every pending operation for this storage */
} ior_aiori_t;
enum bench_type {

View File

@ -266,7 +266,10 @@ static void prep_testdir(int j, int dir_iter){
static void phase_end(){
if (call_sync){
call_sync_cmd();
if(! backend->sync){
FAIL("Error, backend does not provide the sync method, but your requested to use sync.");
}
backend->sync(& param);
}
if (barriers) {

View File

@ -809,10 +809,3 @@ char *HumanReadable(IOR_offset_t value, int base)
}
return valueStr;
}
void call_sync_cmd(){
int ret = system("sync");
if (ret != 0){
FAIL("Error executing the sync command, ensure it exists.");
}
}

View File

@ -60,7 +60,6 @@ int QueryNodeMapping(MPI_Comm comm, int print_nodemap);
void DelaySecs(int delay);
void updateParsedOptions(IOR_param_t * options, options_all_t * global_options);
size_t NodeMemoryStringToBytes(char *size_str);
void call_sync_cmd();
/* Returns -1, if cannot be read */
int64_t ReadStoneWallingIterations(char * const filename);