Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdtest bugs in leaf-only mode #147

Closed
rmn1 opened this issue May 14, 2019 · 5 comments
Closed

mdtest bugs in leaf-only mode #147

rmn1 opened this issue May 14, 2019 · 5 comments

Comments

@rmn1
Copy link

rmn1 commented May 14, 2019

Hello,
mdtest has serious bugs when run in leaf-only mode (-L option)

  • stat phase gives invalid results
  • stat phase processes only small/limited amount of files
  • wrong number of files is calculated and reported (with -F option) for -I option

Following condition in mdtest.c mdtest_stat function is wrong, so only small amount of files (one directory usually) is tested:

    if( directory_loops != 1 || leaf_only ){
      stop_items = items_per_dir;
    }

But results are calculated using all items.

if (stat_only) {
        summary_table[iteration].rate[5] = items*size/(t[2] - t[1]);
        summary_table[iteration].time[5] = t[2] - t[1];
        summary_table[iteration].items[5] = items*size;
        summary_table[iteration].stonewall_last_item[5] = items;
}

Items calculations doesn't reflect leaf_only when run with -I option.

if (items_per_dir > 0) {
      if(items == 0){
        items = items_per_dir * num_dirs_in_tree;
      }else{
        num_dirs_in_tree_calc = num_dirs_in_tree;
      }
  } else {
      if (leaf_only) {
          if (branch_factor <= 1) {
              items_per_dir = items;
          } else {
              items_per_dir = (uint64_t) (items / pow(branch_factor, depth));
              items = items_per_dir * (uint64_t) pow(branch_factor, depth);
          }
      } else {
          items_per_dir = items / num_dirs_in_tree;
          items = items_per_dir * num_dirs_in_tree;
      }
}

I suggest reverting commit ed421bc and fixing items calculations.

@JulianKunkel
Copy link
Collaborator

JulianKunkel commented May 14, 2019 via email

@rmn1
Copy link
Author

rmn1 commented May 14, 2019

Thank for quick response.
I think that ed421bc solves nothing and just breaks another functionality.
In my opinion #112 is caused by wrong items calculation for case when -I and -L options are used.

Reverting ed421bc and following short patch works for me and for #112.

diff --git a/src/mdtest.c b/src/mdtest.c
index b36dcea..fbfb1d4 100644
--- a/src/mdtest.c
+++ b/src/mdtest.c
@@ -2270,7 +2270,12 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
     }
     if (items_per_dir > 0) {
         if(items == 0){
-          items = items_per_dir * num_dirs_in_tree;
+          if (leaf_only) {
+              items = items_per_dir * (uint64_t) pow(branch_factor, depth);
+          }
+          else {
+              items = items_per_dir * num_dirs_in_tree;
+          }
         }else{
           num_dirs_in_tree_calc = num_dirs_in_tree;
         }

JulianKunkel added a commit that referenced this issue May 14, 2019
@JulianKunkel
Copy link
Collaborator

JulianKunkel commented May 14, 2019 via email

@glennklockwood
Copy link
Contributor

Should we cut a 3.2.1 to address this and the other patch that’s been applied to the 3.2. branch? This seems like something worth releasing.

@JulianKunkel
Copy link
Collaborator

JulianKunkel commented May 14, 2019 via email

glennklockwood pushed a commit to glennklockwood/ior that referenced this issue May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants