37 #include <sys/types.h> 45 #include <sys/param.h> 49 #include <sys/mount.h> 53 #include <sys/statfs.h> 56 #if HAVE_SYS_STATVFS_H 57 #include <sys/statvfs.h> 79 #pragma GCC diagnostic ignored "-Wformat-overflow" 81 #ifdef HAVE_LUSTRE_LUSTREAPI 82 #include <lustre/lustreapi.h> 85 #define FILEMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH 86 #define DIRMODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH 87 #define RELEASE_VERS META_VERSION 88 #define TEST_DIR "test-dir" 89 #define ITEM_COUNT 25000 164 #ifdef HAVE_LUSTRE_LUSTREAPI 165 int global_dir_layout;
195 #define CHECK_STONE_WALL(p) (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds)) 206 #define VERBOSE(root,any,...) VerboseMessage(root,any,__LINE__,__VA_ARGS__) 207 void VerboseMessage (
int root_level,
int any_level,
int line,
char * format, ...) {
211 va_start (args, format);
212 vsnprintf (buffer, 1024, format, args);
214 if (root_level == 0 && any_level == -1) {
219 fprintf(
out_logfile,
"V-%d: Rank %3d Line %5d %s\n", root_level,
rank, line, buffer );
229 VERBOSE(1,-1,
"V-1: Entering offset_timers..." );
232 for (i = 0; i < tcount+1; i++) {
239 char delimiter_string[3] = {
'@',
'\n',
'\0' };
243 VERBOSE(1,-1,
"Entering parse_dirpath on %s...", dirpath_arg );
248 while (* tmp !=
'\0') {
255 dirpath_arg = strdup(dirpath_arg);
258 token = strtok(dirpath_arg, delimiter_string);
259 while (token !=
NULL) {
261 token = strtok(
NULL, delimiter_string);
269 pos += sprintf(& o.
testdir[pos],
"/");
272 pos += sprintf(& o.
testdir[pos],
".%d-%d", j, dir_iter);
278 FAIL(
"Error, backend does not provide the sync method, but you requested to use sync.\n");
306 VERBOSE(1,-1,
"Entering unique_dir_access, set it to %s", to );
311 const char *operation = create ?
"create" :
"remove";
313 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
314 VERBOSE(3,5,
"dir: "LLU"", operation, itemNum);
318 sprintf(curr_item,
"%s/dir.%s%" PRIu64, path, create ? o.
mk_name : o.
rm_name, itemNum);
319 VERBOSE(3,5,
"create_remove_items_helper (dirs %s): curr_item is '%s'", operation, curr_item);
323 EWARNF(
"unable to create directory %s", curr_item);
327 EWARNF(
"unable to remove directory %s", curr_item);
335 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
340 sprintf(curr_item,
"%s/file.%s"LLU"", path, o.
rm_name, itemNum);
341 VERBOSE(3,5,
"create_remove_items_helper (non-dirs remove): curr_item is '%s'", curr_item);
352 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
357 sprintf(curr_item,
"%s/file.%s"LLU"", path, o.
mk_name, itemNum);
358 VERBOSE(3,5,
"create_remove_items_helper (non-dirs create): curr_item is '%s'", curr_item);
362 VERBOSE(3,5,
"create_remove_items_helper : mknod..." );
366 EWARNF(
"unable to mknode file %s", curr_item);
370 VERBOSE(3,5,
"create_remove_items_helper (collective): open..." );
373 if (
NULL == aiori_fh){
374 EWARNF(
"unable to open file %s", curr_item);
383 VERBOSE(3,5,
"create_remove_items_helper (non-collective, shared): open..." );
386 if (
NULL == aiori_fh){
387 EWARNF(
"unable to create file %s", curr_item);
393 VERBOSE(3,5,
"create_remove_items_helper: write..." );
403 EWARNF(
"unable to write file %s", curr_item);
409 EWARNF(
"unable to verify write (read/back) file %s", curr_item);
415 VERBOSE(3,5,
"create_remove_items_helper: close..." );
423 VERBOSE(1,-1,
"Entering create_remove_items_helper on %s", path );
425 for (uint64_t i = progress->
items_start; i < progress->items_per_dir ; ++i) {
449 VERBOSE(1,-1,
"Entering collective_helper on %s", path );
450 for (uint64_t i = progress->
items_start ; i < progress->items_per_dir ; ++i) {
456 sprintf(curr_item,
"%s/file.%s"LLU"", path, create ? o.
mk_name : o.
rm_name, itemNum+i);
457 VERBOSE(3,5,
"create file: %s", curr_item);
464 if (
NULL == aiori_fh) {
465 EWARNF(
"unable to create file %s", curr_item);
487 unsigned long long currDir = dirNum;
490 VERBOSE(1,-1,
"Entering create_remove_items on %s, currDepth = %d...", path, currDepth );
494 strcpy(temp_path, path);
496 VERBOSE(3,5,
"create_remove_items (start): temp_path is '%s'", temp_path );
498 if (currDepth == 0) {
510 collective, temp_path, ++dirNum, progress);
513 }
else if (currDepth <= o.
depth) {
519 strcat(temp_path,
"/");
520 strcat(temp_path, dir);
522 VERBOSE(3,5,
"create_remove_items (for loop): temp_path is '%s'", temp_path );
546 strcpy(temp_path, path);
555 uint64_t parent_dir, item_num = 0;
558 VERBOSE(1,-1,
"Entering mdtest_stat on %s", path );
560 uint64_t stop_items = o.
items;
567 for (uint64_t i = 0 ; i < stop_items ; ++i) {
608 if (parent_dir > 0) {
623 sprintf( temp,
"%s/%s", path, item );
624 strcpy( item, temp );
627 VERBOSE(3,5,
"mdtest_stat %4s: %s", (dirs ?
"dir" :
"file"), item);
629 EWARNF(
"unable to stat %s %s", dirs ?
"directory" :
"file", item);
635 void mdtest_read(
int random,
int dirs,
const long dir_iter,
char *path) {
636 uint64_t parent_dir, item_num = 0;
640 VERBOSE(1,-1,
"Entering mdtest_read on %s", path );
649 uint64_t stop_items = o.
items;
656 for (uint64_t i = 0 ; i < stop_items ; ++i) {
693 if (parent_dir > 0) {
701 parent_dir = (
unsigned long long) ((parent_dir-1) / o.
branch_factor);
708 sprintf( temp,
"%s/%s", path, item );
709 strcpy( item, temp );
712 VERBOSE(3,5,
"mdtest_read file: %s", item);
716 if (
NULL == aiori_fh) {
717 EWARNF(
"unable to open file %s", item);
725 EWARNF(
"unable to read file %s", item);
734 }
else if((o.
read_bytes >= 8 && ((uint64_t*) read_buffer)[0] != item_num) || (o.
read_bytes < 8 && read_buffer[0] != (
char) item_num)){
753 VERBOSE(1,-1,
"Entering collective_create_remove on %s", path );
756 for (
int i = 0 ; i < ntasks ; ++i) {
796 VERBOSE(3,5,
"collective_create_remove (create_remove_items): temp is '%s'", temp);
829 uint64_t parent_dir, item_num = 0;
834 WARN(
"Backend doesn't support rename\n");
838 VERBOSE(1,-1,
"Entering mdtest_rename on %s", path );
840 uint64_t stop_items = o.
items;
846 if(stop_items == 1)
return;
850 for (uint64_t i = 0 ; i < stop_items; ++i) {
867 if (parent_dir > 0) {
881 sprintf( temp,
"%s/%s", path, item );
882 strcpy( item, temp );
884 VERBOSE(3,5,
"mdtest_rename %4s: %s", (dirs ?
"dir" :
"file"), item);
886 sprintf(first_item_name,
"%s-XX", item);
887 strcpy(item_last, first_item_name);
888 }
else if(i == stop_items - 1){
889 strcpy(item, first_item_name);
892 EWARNF(
"unable to rename %s %s", dirs ?
"directory" :
"file", item);
895 strcpy(item_last, item);
900 res->
time[test] = times[t] - times[t-1];
906 res->
rate[test] = item_count/res->
time[test];
908 res->
items[test] = item_count;
915 double tBefore[6] = {0};
921 VERBOSE(1,-1,
"Entering directory_test on %s", path );
940 sprintf( temp_path,
"%s/%s", o.
testdir, path );
943 VERBOSE(3,-1,
"directory_test: create path is '%s'", temp_path );
972 sprintf( temp_path,
"%s/%s", o.
testdir, path );
975 VERBOSE(3,5,
"stat path is '%s'", temp_path );
1001 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1004 VERBOSE(3,5,
"directory_test: read path is '%s'", temp_path );
1027 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1030 VERBOSE(3,5,
"rename path is '%s'", temp_path );
1052 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1055 VERBOSE(3,5,
"directory_test: remove directories path is '%s'", temp_path );
1076 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1079 VERBOSE(3,5,
"directory_test: remove unique directories path is '%s'\n", temp_path );
1108 long long unsigned max_iter = 0;
1110 VERBOSE(1,1,
"stonewall hit with %lld items", (
long long) items_done );
1111 MPI_Allreduce(& items_done, & max_iter, 1, MPI_LONG_LONG_INT, MPI_MAX,
testComm);
1114 *out_max_iter = max_iter;
1117 long long min_accessed = 0;
1118 MPI_Reduce(& items_done, & min_accessed, 1, MPI_LONG_LONG_INT, MPI_MIN, 0,
testComm);
1119 long long sum_accessed = 0;
1120 MPI_Reduce(& items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0,
testComm);
1125 VERBOSE(0,-1,
"Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((
double) sum_accessed) / o.
size);
1139 VERBOSE(5,5,
"operating on %s", temp_path);
1144 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1147 VERBOSE(3,-1,
"file_test: create path is '%s'", temp_path );
1160 uint64_t max_iter = 0;
1187 double tBefore[5] = {0};
1191 VERBOSE(3,5,
"Entering file_test on %s", path);
1205 int64_t expected_items;
1208 if(expected_items >= 0){
1213 o.
items = expected_items;
1218 if(expected_items == -1){
1219 WARN(
"Could not read stonewall status file");
1241 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1244 VERBOSE(3,5,
"file_test: stat path is '%s'", temp_path );
1265 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1268 VERBOSE(3,5,
"file_test: read path is '%s'", temp_path );
1294 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1297 VERBOSE(3,5,
"file_test: rm directories path is '%s'", temp_path );
1304 VERBOSE(3,5,
"gonna create %s", temp_path);
1317 strcpy( temp_path, path );
1320 VERBOSE(3,5,
"file_test: rm unique directories path is '%s'", temp_path );
1368 default:
return "ERR INVALID TESTNAME :";
1381 FAIL(
"Cannot open saveRankPerformanceDetails file for writes!");
1385 MPI_Gather(o.
summary_table, size /
sizeof(
double), MPI_DOUBLE, results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1389 cpos += sprintf(cpos,
"all,%llu", (
long long unsigned) o.
items);
1391 if(agg->
items[e] == 0){
1392 cpos += sprintf(cpos,
",,");
1394 cpos += sprintf(cpos,
",%.10e,%.10e", agg->
items[e] / agg->
time[e], agg->
time[e]);
1397 cpos += sprintf(cpos,
"\n");
1398 int ret = fwrite(buff, cpos - buff, 1, fd);
1400 for(
int iter = 0; iter < iterations; iter++){
1401 for(
int i=0; i < o.
size; i++){
1404 cpos += sprintf(cpos,
"%d,", i);
1406 if(cur->
items[e] == 0){
1407 cpos += sprintf(cpos,
",,");
1412 cpos += sprintf(cpos,
"\n");
1413 ret = fwrite(buff, cpos - buff, 1, fd);
1415 WARN(
"Couln't append to saveRankPerformanceDetailsCSV file\n");
1429 return & all_results[proc * interation_count + iter];
1434 double min, max, mean, sd, sum, var, curr = 0;
1435 double imin, imax, imean, isum, icur;
1436 char const * access;
1457 fprintf(
out_logfile,
"\nPer process result (%s):\n", print_time ?
"time" :
"rate");
1458 for (
int j = 0; j < iterations; j++) {
1466 for (
int k=0; k < o.
size; k++) {
1473 fprintf(
out_logfile,
"%c%e", (k==0 ?
' ':
','), curr);
1480 VERBOSE(0, -1,
"\nSUMMARY %s: (of %d iterations)", print_time ?
"time" :
"rate", iterations);
1482 " Operation per Rank: Max Min Mean " 1483 " per Iteration: Max Min Mean Std Dev");
1485 " --------- --- --- ---- " 1486 " --- --- ---- -------");
1487 for (
int i = start; i < stop; i++) {
1493 double iter_result[iterations];
1494 for (
int j = 0; j < iterations; j++) {
1495 icur = print_time ? 0 : 1e308;
1496 for (
int k = 0; k < o.
size; k++) {
1512 curr = cur->
time[i];
1517 curr = cur->
rate[i];
1532 iter_result[j] = icur;
1534 iter_result[j] = icur * o.
size;
1537 mean = sum / iterations / o.
size;
1538 imean = isum / iterations;
1545 for (
int j = 0; j < iterations; j++) {
1546 var += (imean - iter_result[j]) * (imean - iter_result[j]);
1548 var = var / (iterations - 1);
1559 fprintf(
out_logfile,
"%14.3f\n", iterations == 1 ? 0 : sd);
1569 for (
int j = 0; j < iterations; j++) {
1590 mean = sum / (iterations);
1592 for (
int j = 0; j < iterations; j++) {
1598 var += (mean - curr)*(mean - curr);
1600 var = var / (iterations - 1);
1609 fprintf(
out_logfile,
"%14.3f ", sum / iterations);
1610 fprintf(
out_logfile,
"%14.3f\n", iterations == 1 ? 0 : sd);
1623 memset(all_results, 0, size * o.
size);
1624 MPI_Gather(o.
summary_table, size /
sizeof(
double), MPI_DOUBLE, all_results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1626 for(
int j=0; j < iterations; j++){
1629 double max_time = 0;
1630 double max_stonewall_time = 0;
1631 uint64_t sum_items = 0;
1634 for(
int p=0; p < o.
size; p++){
1637 double t = cur->
time[i];
1638 max_time = max_time < t ? t : max_time;
1640 sum_items += cur->
items[i];
1643 max_stonewall_time = max_stonewall_time < t ? t : max_stonewall_time;
1646 results[j].
items[i] = sum_items;
1647 results[j].
time[i] = max_time;
1650 results[j].
rate[i] = 0.0;
1652 results[j].
rate[i] = sum_items / max_time;
1666 MPI_Bcast(results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1669 for(
int j=0; j < iterations; j++){
1694 FAIL(
"Error, stone wall timer does only work with a branch factor <= 1 (current is %d) and with barriers\n", o.
branch_factor);
1699 VERBOSE(1,-1,
"main: Setting create/stat/read/remove_only to True" );
1702 VERBOSE(1,-1,
"Entering md_validate_tests..." );
1720 FAIL(
"Possible race conditions will occur: -B not compatible with -N");
1725 FAIL(
"-c not compatible with -S");
1728 FAIL(
"-c not compatible with multiple test directories");
1731 FAIL(
"-c not compatible with -B");
1736 FAIL(
"-u not compatible with -S");
1741 FAIL(
"cannot have multiple directory paths with -N strides between neighbor tasks");
1746 FAIL(
"shared directory mode is not compatible with multiple directory paths");
1751 FAIL(
"cannot have more directory paths than MPI tasks");
1756 FAIL(
"depth must be greater than or equal to zero");
1760 FAIL(
"branch factor must be greater than or equal to zero");
1765 FAIL(
"only specify the number of items or the number of items per directory");
1767 FAIL(
"items must be a multiple of items per directory");
1772 FAIL(
"-k not compatible with -w");
1776 FAIL(
"Verify read requires that the read test is used");
1779 FAIL(
"Verify read requires that read bytes is > 0");
1782 WARN(
"Read bytes is 0, thus, a read test will actually just open/close");
1785 FAIL(
"When writing and reading files, read bytes must be smaller than write bytes");
1791 FAIL(
"Cannot open saveRankPerformanceDetails file for write!");
1793 char * head =
"rank,items";
1794 int ret = fwrite(head, strlen(head), 1, fd);
1799 sprintf(buf,
",rate-%s,time-%s", str, str);
1800 ret = fwrite(buf, strlen(buf), 1, fd);
1802 FAIL(
"Cannot write header to saveRankPerformanceDetails file");
1805 fwrite(
"\n", 1, 1, fd);
1814 int64_t file_system_unit_val = 1024 * 1024 * 1024;
1815 int64_t inode_unit_val = 1024 * 1024;
1816 int64_t total_file_system_size,
1817 free_file_system_size,
1820 double total_file_system_size_hr,
1821 used_file_system_percentage,
1822 used_inode_percentage;
1826 VERBOSE(1,-1,
"Entering show_file_system_size on %s", file_system );
1830 FAIL(
"unable to stat file system %s", file_system);
1836 used_file_system_percentage = (1 - ((double)free_file_system_size
1837 / (
double)total_file_system_size)) * 100;
1838 total_file_system_size_hr = (double)total_file_system_size
1839 / (
double)file_system_unit_val;
1840 if (total_file_system_size_hr > 1024) {
1841 total_file_system_size_hr = total_file_system_size_hr / 1024;
1842 strcpy(file_system_unit_str,
"TiB");
1846 total_inodes = stat_buf.
f_files;
1847 free_inodes = stat_buf.
f_ffree;
1849 used_inode_percentage = (1 - ((double)free_inodes/(
double)total_inodes))
1852 if (realpath(file_system, real_path) ==
NULL) {
1853 WARN(
"unable to use realpath() on file system");
1858 VERBOSE(0,-1,
"Path: %s", real_path);
1859 VERBOSE(0,-1,
"FS: %.1f %s Used FS: %2.1f%% Inodes: %.1f %s Used Inodes: %2.1f%%\n",
1860 total_file_system_size_hr, file_system_unit_str, used_file_system_percentage,
1861 (
double)total_inodes / (
double)inode_unit_val, inode_unit_str, used_inode_percentage);
1873 VERBOSE(1,5,
"Entering create_remove_directory_tree on %s, currDepth = %d...", path, currDepth );
1875 if (currDepth == 0) {
1879 VERBOSE(2,5,
"Making directory '%s'", dir);
1881 EWARNF(
"unable to create tree directory '%s'", dir);
1883 #ifdef HAVE_LUSTRE_LUSTREAPI 1885 if (o.global_dir_layout && \
1886 llapi_dir_set_default_lmv_stripe(dir, -1, 0,
1887 LMV_HASH_TYPE_FNV_1A_64,
1889 FAIL(
"Unable to reset to global default directory layout");
1897 VERBOSE(2,5,
"Remove directory '%s'", dir);
1899 EWARNF(
"Unable to remove directory %s", dir);
1902 }
else if (currDepth <= o.
depth) {
1905 strcpy(temp_path, path);
1906 int currDir = dirNum;
1910 strcat(temp_path, dir);
1913 VERBOSE(2,5,
"Making directory '%s'", temp_path);
1915 EWARNF(
"Unable to create directory %s", temp_path);
1924 VERBOSE(2,5,
"Remove directory '%s'", temp_path);
1926 EWARNF(
"Unable to remove directory %s", temp_path);
1930 strcpy(temp_path, path);
1938 memset(& progress_o, 0 ,
sizeof(progress_o));
1944 double startCreate, endCreate;
1947 VERBOSE(1,-1,
"main: * iteration %d *", j+1);
1956 VERBOSE(2,5,
"main (for j loop): making o.testdir, '%s'", o.
testdir );
1961 #ifdef HAVE_LUSTRE_LUSTREAPI 1964 EWARNF(
"Unable to reset to global default directory layout");
1983 for (k=0; k < o.
size; k++) {
1986 VERBOSE(3,5,
"main (create hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
1998 VERBOSE(3,5,
"main (create hierarchical directory loop-!collective_creates): Calling create_remove_directory_tree with '%s'", o.
testdir );
2007 VERBOSE(3,5,
"main (create hierarchical directory loop-!unque_dir_per_task): Calling create_remove_directory_tree with '%s'", o.
testdir );
2090 for (k=0; k < o.
size; k++) {
2093 VERBOSE(3,-1,
"main (remove hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
2106 VERBOSE(3,-1,
"main (remove hierarchical directory loop-!collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
2116 VERBOSE(3,-1,
"V-3: main (remove hierarchical directory loop-!unique_dir_per_task): Calling create_remove_directory_tree with '%s'", o.
testdir );
2134 VERBOSE(2,-1,
"main (at end of for j loop): Removing o.testdir of '%s'\n", o.
testdir );
2154 .random_buffer_offset = -1
2168 int numTasksOnNode0 = 0;
2169 MPI_Group worldgroup, testgroup;
2174 } range = {0, 0, 1};
2179 int created_root_dir = 0;
2182 int no_barriers = 0;
2183 char * path =
"./out";
2186 char APIs_legacy[1024];
2189 sprintf(apiStr,
"API for I/O [%s]", APIs);
2205 #ifdef HAVE_LUSTRE_LUSTREAPI 2206 {
'g',
NULL,
"global default directory layout for test subdirectories (deletes inherited striping layout)",
OPTION_FLAG,
'd', & o.global_dir_layout},
2219 {
'R',
NULL,
"random access to files (only for stat)",
OPTION_FLAG,
'd', & randomize},
2232 {0,
"verify-write",
"Verify the data after a write by reading it back immediately",
OPTION_FLAG,
'd', & o.
verify_write},
2234 {
'Y',
NULL,
"call the sync command after each phase (included in the timing; note it causes all IO to be flushed from your node)",
OPTION_FLAG,
'd', & o.
call_sync},
2246 ERR(
"Unrecognized I/O API");
2248 ERR(
"Backend doesn't support MDTest");
2251 free(global_options->
modules);
2252 free(global_options);
2273 char cmd_buffer[4096];
2274 strncpy(cmd_buffer, argv[0], 4096);
2275 for (i = 1; i < argc; i++) {
2276 snprintf(&cmd_buffer[strlen(cmd_buffer)], 4096-strlen(cmd_buffer),
" '%s'", argv[i]);
2281 VERBOSE(0,-1,
"Command line used: %s", cmd_buffer);
2288 if( randomize > 0 ){
2313 VERBOSE(1,-1,
"dirpath(s):" );
2320 VERBOSE(1,-1,
"first : %d", first );
2322 #ifdef HAVE_LUSTRE_LUSTREAPI 2323 VERBOSE(1,-1,
"global_dir_layout : %s", ( o.global_dir_layout ?
"True" :
"False" ));
2325 VERBOSE(1,-1,
"iterations : %d", iterations );
2327 VERBOSE(1,-1,
"last : %d", last );
2334 VERBOSE(1,-1,
"stride : %d", stride );
2390 for (s=0; s < o.
items; s++) {
2395 uint64_t n = o.
items;
2407 uint64_t k = ( uint64_t ) (((
double )rand() / ( double )RAND_MAX ) * ( double )n );
2442 created_root_dir = 1;
2446 VERBOSE(3,-1,
"main (before display_freespace): o.testdirpath is '%s'", o.
testdirpath );
2453 if ( numNodes > 1 && tasksBlockMapping ) {
2461 VERBOSE(3,-1,
"main (after display_freespace): o.testdirpath is '%s'", o.
testdirpath );
2470 perror(
"gethostname");
2492 strcpy(o.
mk_name,
"mdtest.shared.");
2495 strcpy(o.
rm_name,
"mdtest.shared.");
2497 MPI_Comm_group(
testComm, &worldgroup);
2500 for (i = first; i <= last && i <= o.
size; i += stride) {
2502 MPI_Group_range_incl(worldgroup, 1, (
void *)&range, &testgroup);
2505 uint64_t items_all = i * o.
items;
2510 VERBOSE(0,-1,
"%d tasks, "LLU" files/directories", i, items_all);
2513 VERBOSE(0,-1,
"%d tasks, "LLU" files", i, items_all);
2516 VERBOSE(0,-1,
"%d tasks, 1 file", i);
2519 VERBOSE(0,-1,
"%d tasks, "LLU" directories", i, items_all);
2523 VERBOSE(1,-1,
" Operation Duration Rate");
2524 VERBOSE(1,-1,
" --------- -------- ----");
2526 for (j = 0; j < iterations; j++) {
2534 if (i == 1 && stride > 1) {
2538 int total_errors = 0;
2540 if(
rank == 0 && total_errors){
2541 VERBOSE(0, -1,
"\nERROR: verifying the data on read (%lld errors)! Take the performance values with care!\n", total_errors);
2545 MPI_Group_free(&testgroup);
2548 MPI_Group_free(&worldgroup);
2570 return aggregated_results;
char * stoneWallingStatusFile
double time_before_barrier[MDTEST_TREE_CREATE_NUM]
uint64_t stonewall_item_sum[MDTEST_LAST_NUM]
double rate[MDTEST_LAST_NUM]
char read_name[MAX_PATHLEN]
#define VERBOSE(root, any,...)
char stat_name[MAX_PATHLEN]
char unique_rm_dir[MAX_PATHLEN]
uint64_t num_dirs_in_tree_calc
char rm_name[MAX_PATHLEN]
char unique_rm_uni_dir[MAX_PATHLEN]
void * airoi_update_module_options(const ior_aiori_t *backend, options_all_t *opt)
void VerboseMessage(int root_level, int any_level, int line, char *format,...)
int option_parse(int argc, char **argv, options_all_t *opt_all)
static void create_file(const char *path, uint64_t itemNum)
int time_unique_dir_overhead
int stone_wall_timer_seconds
char mk_name[MAX_PATHLEN]
int64_t ReadStoneWallingIterations(char *const filename, MPI_Comm com)
mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *world_out)
static void updateResult(mdtest_results_t *res, mdtest_test_num_t test, uint64_t item_count, int t, double *times, double *tBefore)
uint64_t stonewall_item_min[MDTEST_LAST_NUM]
void parse_dirpath(char *dirpath_arg)
void(* delete)(char *, aiori_mod_opt_t *module_options)
int(* statfs)(const char *, ior_aiori_statfs_t *, aiori_mod_opt_t *module_options)
uint64_t num_dirs_in_tree
int(* mkdir)(const char *path, mode_t mode, aiori_mod_opt_t *module_options)
int QueryNodeMapping(MPI_Comm comm, int print_nodemap)
char testdirpath[MAX_PATHLEN]
void offset_timers(double *t, int tcount)
static mdtest_options_t o
int(* access)(const char *path, int mode, aiori_mod_opt_t *module_options)
static void prep_testdir(int j, int dir_iter)
void create_remove_items(int currDepth, const int dirs, const int create, const int collective, const char *path, uint64_t dirNum, rank_progress_t *progress)
static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t *summary_table)
char const * mdtest_test_name(int i)
void mdtest_read(int random, int dirs, const long dir_iter, char *path)
int stone_wall_timer_seconds
void show_file_system_size(char *file_system)
char unique_stat_dir[MAX_PATHLEN]
char hostname[MAX_PATHLEN]
void rename_dir_test(const int dirs, const long dir_iter, const char *path, rank_progress_t *progress)
int(* rmdir)(const char *path, aiori_mod_opt_t *module_options)
void mdtest_stat(const int random, const int dirs, const long dir_iter, const char *path, rank_progress_t *progress)
const ior_aiori_t * aiori_select(const char *api)
char base_tree_name[MAX_PATHLEN]
void collective_helper(const int dirs, const int create, const char *path, uint64_t itemNum, rank_progress_t *progress)
void file_test(const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
double rate_before_barrier[MDTEST_LAST_NUM]
double time[MDTEST_LAST_NUM]
static option_help options[]
int(* check_params)(aiori_mod_opt_t *)
int verify_memory_pattern(int item, char *buffer, size_t bytes, int buff_offset, int pretendRank)
uint64_t items[MDTEST_LAST_NUM]
void init_clock(MPI_Comm com)
void(* initialize)(aiori_mod_opt_t *options)
void collective_create_remove(const int create, const int dirs, const int ntasks, const char *path, rank_progress_t *progress)
static void summarize_results_rank0(int iterations, mdtest_results_t *all_results, int print_time)
char unique_mk_dir[MAX_PATHLEN]
mdtest_results_t * summary_table
int GetNumNodes(MPI_Comm comm)
static mdtest_results_t * get_result_index(mdtest_results_t *all_results, int proc, int iter, int interation_count)
int(* rename)(const char *oldpath, const char *newpath, aiori_mod_opt_t *module_options)
void(* xfer_hints)(aiori_xfer_hint_t *params)
void directory_test(const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
void create_remove_items_helper(const int dirs, const int create, const char *path, uint64_t itemNum, rank_progress_t *progress)
void(* close)(aiori_fd_t *, aiori_mod_opt_t *module_options)
int(* stat)(const char *path, struct stat *buf, aiori_mod_opt_t *module_options)
options_all_t * airoi_create_all_module_options(option_help *global_options)
double GetTimeStamp(void)
void create_remove_directory_tree(int create, int currDepth, char *path, int dirNum, rank_progress_t *progress)
#define EWARNF(FORMAT,...)
void aiori_supported_apis(char *APIs, char *APIs_legacy, enum bench_type type)
void generate_memory_pattern(char *buf, size_t bytes, int buff_offset, int rank)
aiori_fd_t *(* create)(char *, int iorflags, aiori_mod_opt_t *)
IOR_offset_t(* xfer)(int access, aiori_fd_t *, IOR_size_t *, IOR_offset_t size, IOR_offset_t offset, aiori_mod_opt_t *module_options)
static void remove_file(const char *path, uint64_t itemNum)
void StoreStoneWallingIterations(char *const filename, int64_t count)
char testdir[MAX_PATHLEN]
void file_test_create(const int iteration, const int ntasks, const char *path, rank_progress_t *progress, double *t)
static void StoreRankInformation(int iterations, mdtest_results_t *agg)
static options_all_t * global_options
char unique_chdir_dir[MAX_PATHLEN]
int updateStoneWallIterations(int iteration, uint64_t items_done, double tstart, uint64_t *out_max_iter)
static void create_remove_dirs(const char *path, bool create, uint64_t itemNum)
uint64_t stonewall_last_item[MDTEST_LAST_NUM]
void(* finalize)(aiori_mod_opt_t *options)
char * saveRankDetailsCSV
char unique_read_dir[MAX_PATHLEN]
void ShowFileSystemSize(char *filename, const struct ior_aiori *backend, void *backend_options)
aiori_fd_t *(* open)(char *, int iorflags, aiori_mod_opt_t *)
double stonewall_time[MDTEST_LAST_NUM]
void DelaySecs(int delay)
void(* sync)(aiori_mod_opt_t *)
int aiori_warning_as_errors
void aligned_buffer_free(void *buf, ior_memory_flags gpu)
void summarize_results(int iterations, mdtest_results_t *results)
void unique_dir_access(int opt, char *to)
int GetNumTasksOnNode0(MPI_Comm comm)
const ior_aiori_t * backend
#define CHECK_STONE_WALL(p)
void update_write_memory_pattern(uint64_t item, char *buf, size_t bytes, int buff_offset, int rank)
void * safeMalloc(uint64_t size)
void * aligned_buffer_alloc(size_t size, ior_memory_flags type)