vector<int> out;
if (use_crush) {
- if (output_statistics)
- err << "CRUSH"; // prepend CRUSH to placement output
+ if (output_mappings)
+ err << "CRUSH"; // prepend CRUSH to placement output
crush.do_rule(r, x, out, nr, weight);
} else {
- if (output_statistics)
- err << "RNG"; // prepend RNG to placement output to denote simulation
+ if (output_mappings)
+ err << "RNG"; // prepend RNG to placement output to denote simulation
// test our new monte carlo placement generator
random_placement(r, out, nr, weight);
}
- if (output_statistics)
- err << " rule " << r << " x " << x << " " << out << std::endl;
+ if (output_mappings)
+ err << " rule " << r << " x " << x << " " << out << std::endl;
if (output_data_file)
write_integer_indexed_vector_data_string(tester_data.placement_information, x, out);
bool output_utilization;
bool output_utilization_all;
bool output_statistics;
+ bool output_mappings;
bool output_bad_mappings;
bool output_choose_tries;
output_utilization(false),
output_utilization_all(false),
output_statistics(false),
+ output_mappings(false),
output_bad_mappings(false),
output_choose_tries(false),
output_data_file(false),
return output_statistics;
}
+ void set_output_mappings(bool b) {
+ output_mappings = b;
+ }
+ bool get_output_mappings() const {
+ return output_mappings;
+ }
+
void set_output_bad_mappings(bool b) {
output_bad_mappings = b;
}
--show utilization-all
include zero weight items
--show-statistics show chi squared statistics
+ --show-mappings show mappings
--show-bad-mappings show bad mappings
--show-choose-tries show choose tries histogram
--set-choose-local-tries N
$ crushtool -c "$TESTDIR/set-choose.crushmap.txt" -o set-choose.crushmap
- $ crushtool -i set-choose.crushmap --test --show-statistics
+ $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics
rule 0 (choose), x = 0..1023, numrep = 2..3
CRUSH rule 0 x 0 [0,3]
CRUSH rule 0 x 1 [0,8]
CRUSH rule 5 x 1022 [1,6,4]
CRUSH rule 5 x 1023 [3,2,8]
rule 5 (chooseleaf-set) num_rep 3 result size == 3:\t1024/1024 (esc)
- $ crushtool -i set-choose.crushmap --test --show-statistics --weight 0 0 --weight 1 0 --weight 3 0 --weight 4 0
+ $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 1 0 --weight 3 0 --weight 4 0
rule 0 (choose), x = 0..1023, numrep = 2..3
CRUSH rule 0 x 0 [2,5]
CRUSH rule 0 x 1 [2,8]
CRUSH rule 5 x 1022 [2,6,5]
CRUSH rule 5 x 1023 [5,2,8]
rule 5 (chooseleaf-set) num_rep 3 result size == 3:\t1024/1024 (esc)
- $ crushtool -i set-choose.crushmap --test --show-statistics --weight 0 0 --weight 3 0 --weight 4 .5 --weight 5 0 --weight 6 .1 --weight 7 0
+ $ crushtool -i set-choose.crushmap --test --show-mappings --show-statistics --weight 0 0 --weight 3 0 --weight 4 .5 --weight 5 0 --weight 6 .1 --weight 7 0
rule 0 (choose), x = 0..1023, numrep = 2..3
CRUSH rule 0 x 0 [2,4]
CRUSH rule 0 x 1 [2,8]
- $ crushtool -i "$TESTDIR/test-map-a.crushmap" --test --show-statistics --rule 0 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 1
+ $ crushtool -i "$TESTDIR/test-map-a.crushmap" --test --show-mappings --show-statistics --rule 0 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 1
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 0 (data), x = 0..1023, numrep = 1..10
CRUSH rule 0 x 0 [36]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 0 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 1 --set-chooseleaf-vary-r 1 --weight 12 0 --weight 20 0 --weight 30 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 0 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 1 --set-chooseleaf-vary-r 1 --weight 12 0 --weight 20 0 --weight 30 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 0 (data), x = 0..1023, numrep = 1..10
CRUSH rule 0 x 0 [101]
- $ crushtool -i "$TESTDIR/test-map-indep.crushmap" --test --show-statistics --rule 1 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 2
+ $ crushtool -i "$TESTDIR/test-map-indep.crushmap" --test --show-mappings --show-statistics --rule 1 --set-choose-local-tries 0 --set-choose-local-fallback-tries 0 --set-choose-total-tries 50 --set-chooseleaf-descend-once 2
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 1 (metadata), x = 0..1023, numrep = 1..10
CRUSH rule 1 x 0 [36]
- $ crushtool -i "$TESTDIR/test-map-a.crushmap" --test --show-statistics --rule 0
+ $ crushtool -i "$TESTDIR/test-map-a.crushmap" --test --show-mappings --show-statistics --rule 0
rule 0 (data), x = 0..1023, numrep = 1..10
CRUSH rule 0 x 0 [36]
CRUSH rule 0 x 1 [876]
- $ crushtool -i "$TESTDIR/test-map-tries-vs-retries.crushmap" --test --show-statistics --weight 0 0 --weight 8 0
+ $ crushtool -i "$TESTDIR/test-map-tries-vs-retries.crushmap" --test --show-mappings --show-statistics --weight 0 0 --weight 8 0
rule 0 (replicated_ruleset), x = 0..1023, numrep = 1..10
CRUSH rule 0 x 0 [7]
CRUSH rule 0 x 1 [10]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 3 --set-chooseleaf-vary-r 0 --weight 0 0 --weight 4 0 --weight 9 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 3 --set-chooseleaf-vary-r 0 --weight 0 0 --weight 4 0 --weight 9 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 3 (delltestrule), x = 0..1023, numrep = 2..4
CRUSH rule 3 x 0 [94,85]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 3 --set-chooseleaf-vary-r 1 --weight 0 0 --weight 4 0 --weight 9 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 3 --set-chooseleaf-vary-r 1 --weight 0 0 --weight 4 0 --weight 9 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 3 (delltestrule), x = 0..1023, numrep = 2..4
CRUSH rule 3 x 0 [94,6]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 3 --set-chooseleaf-vary-r 2 --weight 0 0 --weight 4 0 --weight 9 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 3 --set-chooseleaf-vary-r 2 --weight 0 0 --weight 4 0 --weight 9 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 3 (delltestrule), x = 0..1023, numrep = 2..4
CRUSH rule 3 x 0 [94,45]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 3 --set-chooseleaf-vary-r 3 --weight 0 0 --weight 4 0 --weight 9 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 3 --set-chooseleaf-vary-r 3 --weight 0 0 --weight 4 0 --weight 9 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 3 (delltestrule), x = 0..1023, numrep = 2..4
CRUSH rule 3 x 0 [94,85]
- $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-statistics --rule 3 --set-chooseleaf-vary-r 4 --weight 0 0 --weight 4 0 --weight 9 0
+ $ crushtool -i "$TESTDIR/test-map-vary-r.crushmap" --test --show-mappings --show-statistics --rule 3 --set-chooseleaf-vary-r 4 --weight 0 0 --weight 4 0 --weight 9 0
crushtool successfully built or modified map. Use '-o <file>' to write it out.
rule 3 (delltestrule), x = 0..1023, numrep = 2..4
CRUSH rule 3 x 0 [94,85]
cout << " --show utilization-all\n";
cout << " include zero weight items\n";
cout << " --show-statistics show chi squared statistics\n";
+ cout << " --show-mappings show mappings\n";
cout << " --show-bad-mappings show bad mappings\n";
cout << " --show-choose-tries show choose tries histogram\n";
cout << " --set-choose-local-tries N\n";
} else if (ceph_argparse_flag(args, i, "--show_statistics", (char*)NULL)) {
display = true;
tester.set_output_statistics(true);
+ } else if (ceph_argparse_flag(args, i, "--show_mappings", (char*)NULL)) {
+ display = true;
+ tester.set_output_mappings(true);
} else if (ceph_argparse_flag(args, i, "--show_bad_mappings", (char*)NULL)) {
display = true;
tester.set_output_bad_mappings(true);