Merge pull request #271 from hpc/fix-statvfs
Remove duplicated functionality between mdtest and IOR.master
commit
5d489064d8
|
@ -346,7 +346,9 @@ void ShowTestStart(IOR_param_t *test)
|
||||||
PrintKeyValInt("TestID", test->id);
|
PrintKeyValInt("TestID", test->id);
|
||||||
PrintKeyVal("StartTime", CurrentTimeString());
|
PrintKeyVal("StartTime", CurrentTimeString());
|
||||||
|
|
||||||
ShowFileSystemSize(test);
|
char filename[MAX_PATHLEN];
|
||||||
|
GetTestFileName(filename, test);
|
||||||
|
ShowFileSystemSize(filename, test->backend, test->backend_options);
|
||||||
|
|
||||||
if (verbose >= VERBOSE_3 || outputFormat == OUTPUT_JSON) {
|
if (verbose >= VERBOSE_3 || outputFormat == OUTPUT_JSON) {
|
||||||
char* data_packets[] = {"g","t","o","i"};
|
char* data_packets[] = {"g","t","o","i"};
|
||||||
|
|
36
src/mdtest.c
36
src/mdtest.c
|
@ -1563,39 +1563,6 @@ void show_file_system_size(char *file_system) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_freespace(char *testdirpath)
|
|
||||||
{
|
|
||||||
char dirpath[MAX_PATHLEN] = {0};
|
|
||||||
int i;
|
|
||||||
int directoryFound = 0;
|
|
||||||
|
|
||||||
|
|
||||||
VERBOSE(3,5,"Entering display_freespace on %s...", testdirpath );
|
|
||||||
|
|
||||||
strcpy(dirpath, testdirpath);
|
|
||||||
|
|
||||||
/* get directory for outfile */
|
|
||||||
i = strlen(dirpath);
|
|
||||||
while (i-- > 0) {
|
|
||||||
if (dirpath[i] == '/') {
|
|
||||||
dirpath[i] = '\0';
|
|
||||||
directoryFound = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if no directory/, use '.' */
|
|
||||||
if (directoryFound == 0) {
|
|
||||||
strcpy(dirpath, ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
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 );
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void create_remove_directory_tree(int create,
|
void create_remove_directory_tree(int create,
|
||||||
int currDepth, char* path, int dirNum, rank_progress_t * progress) {
|
int currDepth, char* path, int dirNum, rank_progress_t * progress) {
|
||||||
|
|
||||||
|
@ -1921,6 +1888,7 @@ void mdtest_init_args(){
|
||||||
mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * world_out) {
|
mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * world_out) {
|
||||||
testComm = world_com;
|
testComm = world_com;
|
||||||
out_logfile = world_out;
|
out_logfile = world_out;
|
||||||
|
out_resultfile = world_out;
|
||||||
mpi_comm_world = world_com;
|
mpi_comm_world = world_com;
|
||||||
|
|
||||||
init_clock();
|
init_clock();
|
||||||
|
@ -2203,7 +2171,7 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
|
||||||
/* display disk usage */
|
/* display disk usage */
|
||||||
VERBOSE(3,-1,"main (before display_freespace): testdirpath is '%s'", testdirpath );
|
VERBOSE(3,-1,"main (before display_freespace): testdirpath is '%s'", testdirpath );
|
||||||
|
|
||||||
if (rank == 0) display_freespace(testdirpath);
|
if (rank == 0) ShowFileSystemSize(testdirpath, backend, backend_options);
|
||||||
int tasksBlockMapping = QueryNodeMapping(testComm, true);
|
int tasksBlockMapping = QueryNodeMapping(testComm, true);
|
||||||
|
|
||||||
/* set the shift to mimic IOR and shift by procs per node */
|
/* set the shift to mimic IOR and shift by procs per node */
|
||||||
|
|
|
@ -572,16 +572,14 @@ IOR_offset_t StringToBytes(char *size_str)
|
||||||
/*
|
/*
|
||||||
* Displays size of file system and percent of data blocks and inodes used.
|
* Displays size of file system and percent of data blocks and inodes used.
|
||||||
*/
|
*/
|
||||||
void ShowFileSystemSize(IOR_param_t * test) // this might be converted to an AIORI call
|
void ShowFileSystemSize(char * filename, const struct ior_aiori * backend, void * backend_options) // this might be converted to an AIORI call
|
||||||
{
|
{
|
||||||
ior_aiori_statfs_t stat;
|
ior_aiori_statfs_t stat;
|
||||||
if(! test->backend->statfs){
|
if(! backend->statfs){
|
||||||
WARN("Backend doesn't implement statfs");
|
WARN("Backend doesn't implement statfs");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char filename[MAX_PATHLEN];
|
int ret = backend->statfs(filename, & stat, backend_options);
|
||||||
GetTestFileName(filename, test);
|
|
||||||
int ret = test->backend->statfs(filename, & stat, test->backend_options);
|
|
||||||
if( ret != 0 ){
|
if( ret != 0 ){
|
||||||
WARN("Backend returned error during statfs");
|
WARN("Backend returned error during statfs");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -38,7 +38,7 @@ void set_o_direct_flag(int *fd);
|
||||||
|
|
||||||
char *CurrentTimeString(void);
|
char *CurrentTimeString(void);
|
||||||
int Regex(char *, char *);
|
int Regex(char *, char *);
|
||||||
void ShowFileSystemSize(IOR_param_t * test);
|
void ShowFileSystemSize(char * filename, const struct ior_aiori * backend, void * backend_options);
|
||||||
void DumpBuffer(void *, size_t);
|
void DumpBuffer(void *, size_t);
|
||||||
void SeedRandGen(MPI_Comm);
|
void SeedRandGen(MPI_Comm);
|
||||||
void SetHints (MPI_Info *, char *);
|
void SetHints (MPI_Info *, char *);
|
||||||
|
|
Loading…
Reference in New Issue