Skip to content

Commit 4b44399

Browse files
Merge pull request #121 from glennklockwood/rc
cherry-pick solution to #119 into rc branch
2 parents 1ee2c37 + cb40c99 commit 4b44399

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/mdtest.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ static void remove_file (const char *path, uint64_t itemNum) {
300300
fprintf(out_logfile, "V-3: create_remove_items_helper (non-dirs remove): curr_item is \"%s\"\n", curr_item);
301301
fflush(out_logfile);
302302
}
303-
304303
if (!(shared_file && rank != 0)) {
305304
backend->delete (curr_item, &param);
306305
}
@@ -320,7 +319,7 @@ static void create_file (const char *path, uint64_t itemNum) {
320319

321320
//create files
322321
sprintf(curr_item, "%s/file.%s"LLU"", path, mk_name, itemNum);
323-
if (rank == 0 && verbose >= 3) {
322+
if ((rank == 0 && verbose >= 3) || verbose >= 5) {
324323
fprintf(out_logfile, "V-3: create_remove_items_helper (non-dirs create): curr_item is \"%s\"\n", curr_item);
325324
fflush(out_logfile);
326325
}
@@ -401,7 +400,9 @@ void create_remove_items_helper(const int dirs, const int create, const char *pa
401400
create_remove_dirs (path, create, itemNum + i);
402401
}
403402
if(CHECK_STONE_WALL(progress)){
404-
progress->items_done = i + 1;
403+
if(progress->items_done == 0){
404+
progress->items_done = i + 1;
405+
}
405406
return;
406407
}
407408
}
@@ -1056,13 +1057,13 @@ int updateStoneWallIterations(int iteration, rank_progress_t * progress, double
10561057
long long sum_accessed = 0;
10571058
MPI_Reduce(& progress->items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0, testComm);
10581059

1059-
if(items != (sum_accessed / size) && rank == 0){
1060+
if(items != (sum_accessed / size)){
10601061
summary_table[iteration].stonewall_item_sum[MDTEST_FILE_CREATE_NUM] = sum_accessed;
10611062
summary_table[iteration].stonewall_item_min[MDTEST_FILE_CREATE_NUM] = min_accessed * size;
1062-
fprintf( out_logfile, "Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((double) sum_accessed) / size);
1063-
fflush( out_logfile );
1064-
}
1065-
if( done != max_iter ){
1063+
if (rank == 0){
1064+
fprintf( out_logfile, "Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((double) sum_accessed) / size);
1065+
fflush( out_logfile );
1066+
}
10661067
hit = 1;
10671068
}
10681069
progress->items_start = done;
@@ -1119,14 +1120,19 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro
11191120

11201121
if (hit){
11211122
progress->stone_wall_timer_seconds = 0;
1122-
printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir);
1123+
if (verbose > 1){
1124+
printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir);
1125+
}
11231126
create_remove_items(0, 0, 1, 0, temp_path, 0, progress);
11241127
// now reset the values
11251128
progress->stone_wall_timer_seconds = stone_wall_timer_seconds;
1129+
items = progress->items_done;
11261130
}
11271131
if (stoneWallingStatusFile){
11281132
StoreStoneWallingIterations(stoneWallingStatusFile, progress->items_done);
11291133
}
1134+
// reset stone wall timer to allow proper cleanup
1135+
progress->stone_wall_timer_seconds = 0;
11301136
}
11311137
}
11321138
}else{
@@ -1214,6 +1220,8 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro
12141220
t[3] = MPI_Wtime();
12151221

12161222
if (remove_only) {
1223+
progress->items_start = 0;
1224+
12171225
for (int dir_iter = 0; dir_iter < directory_loops; dir_iter ++){
12181226
prep_testdir(iteration, dir_iter);
12191227
if (unique_dir_per_task) {
@@ -2025,6 +2033,7 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t
20252033

20262034
MPI_Barrier(testComm);
20272035
if (remove_only) {
2036+
progress->items_start = 0;
20282037
startCreate = MPI_Wtime();
20292038
for (int dir_iter = 0; dir_iter < directory_loops; dir_iter ++){
20302039
prep_testdir(j, dir_iter);

0 commit comments

Comments
 (0)