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 #ifdef HAVE_GPFSCREATESHARING_T 80 #include <gpfs_fcntl.h> 87 #pragma GCC diagnostic ignored "-Wformat-overflow" 89 #ifdef HAVE_LUSTRE_LUSTREAPI 90 #include <lustre/lustreapi.h> 93 #define FILEMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH 94 #define DIRMODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH 95 #define RELEASE_VERS META_VERSION 96 #define TEST_DIR "test-dir" 97 #define ITEM_COUNT 25000 177 #ifdef HAVE_LUSTRE_LUSTREAPI 178 int global_dir_layout;
210 #define CHECK_STONE_WALL(p) (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds)) 215 #define PRINT(...) fprintf(out_logfile, __VA_ARGS__); 223 #define VERBOSE(root,any,...) VerboseMessage(root,any,__LINE__,__VA_ARGS__) 224 void VerboseMessage (
int root_level,
int any_level,
int line,
char * format, ...) {
228 va_start (args, format);
229 vsnprintf (buffer, 1024, format, args);
231 if (root_level == 0 && any_level == -1) {
236 fprintf(
out_logfile,
"V-%d: Rank %3d Line %5d %s\n", root_level,
rank, line, buffer );
244 char delimiter_string[3] = {
'@',
'\n',
'\0' };
248 VERBOSE(1,-1,
"Entering parse_dirpath on %s...", dirpath_arg );
253 while (* tmp !=
'\0') {
260 dirpath_arg = strdup(dirpath_arg);
263 token = strtok(dirpath_arg, delimiter_string);
264 while (token !=
NULL) {
266 token = strtok(
NULL, delimiter_string);
274 pos += sprintf(& o.
testdir[pos],
"/");
277 pos += sprintf(& o.
testdir[pos],
".%d-%d", j, dir_iter);
293 FAIL(
"Error, backend does not provide the sync method, but you requested to use sync.\n");
325 VERBOSE(1,-1,
"Entering unique_dir_access, set it to %s", to );
330 const char *operation = create ?
"create" :
"remove";
332 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
333 VERBOSE(3,5,
"dir: "LLU"", operation, itemNum);
337 sprintf(curr_item,
"%s/dir.%s%" PRIu64, path, create ? o.
mk_name : o.
rm_name, itemNum);
338 VERBOSE(3,5,
"create_remove_items_helper (dirs %s): curr_item is '%s'", operation, curr_item);
342 WARNF(
"unable to create directory %s", curr_item);
346 WARNF(
"unable to remove directory %s", curr_item);
354 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
359 sprintf(curr_item,
"%s/file.%s"LLU"", path, o.
rm_name, itemNum);
360 VERBOSE(3,5,
"create_remove_items_helper (non-dirs remove): curr_item is '%s'", curr_item);
371 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
376 sprintf(curr_item,
"%s/file.%s"LLU"", path, o.
mk_name, itemNum);
377 VERBOSE(3,5,
"create_remove_items_helper (non-dirs create): curr_item is '%s'", curr_item);
381 VERBOSE(3,5,
"create_remove_items_helper : mknod..." );
385 WARNF(
"unable to mknode file %s", curr_item);
389 VERBOSE(3,5,
"create_remove_items_helper (collective): open..." );
392 if (
NULL == aiori_fh){
393 WARNF(
"unable to open file %s", curr_item);
402 VERBOSE(3,5,
"create_remove_items_helper (non-collective, shared): open..." );
405 if (
NULL == aiori_fh){
406 WARNF(
"unable to create file %s", curr_item);
412 VERBOSE(3,5,
"create_remove_items_helper: write..." );
418 WARNF(
"unable to write file %s", curr_item);
424 WARNF(
"unable to verify write (read/back) file %s", curr_item);
429 VERBOSE(1,1,
"verification error in file: %s", curr_item);
434 VERBOSE(3,5,
"create_remove_items_helper: close..." );
442 VERBOSE(1,-1,
"Entering create_remove_items_helper on %s", path );
444 for (uint64_t i = progress->
items_start; i < progress->items_per_dir ; ++i) {
468 VERBOSE(1,-1,
"Entering collective_helper on %s", path );
469 for (uint64_t i = progress->
items_start ; i < progress->items_per_dir ; ++i) {
475 sprintf(curr_item,
"%s/file.%s"LLU"", path, create ? o.
mk_name : o.
rm_name, itemNum+i);
476 VERBOSE(3,5,
"create file: %s", curr_item);
483 if (
NULL == aiori_fh) {
484 WARNF(
"unable to create file %s", curr_item);
506 unsigned long long currDir = dirNum;
509 VERBOSE(1,-1,
"Entering create_remove_items on %s, currDepth = %d...", path, currDepth );
513 strcpy(temp_path, path);
515 VERBOSE(3,5,
"create_remove_items (start): temp_path is '%s'", temp_path );
517 if (currDepth == 0) {
529 collective, temp_path, ++dirNum, progress);
532 }
else if (currDepth <= o.
depth) {
538 strcat(temp_path,
"/");
539 strcat(temp_path, dir);
541 VERBOSE(3,5,
"create_remove_items (for loop): temp_path is '%s'", temp_path );
565 strcpy(temp_path, path);
574 uint64_t parent_dir, item_num = 0;
577 VERBOSE(1,-1,
"Entering mdtest_stat on %s", path );
579 uint64_t stop_items = o.
items;
586 for (uint64_t i = 0 ; i < stop_items ; ++i) {
627 if (parent_dir > 0) {
642 sprintf( temp,
"%s/%s", path, item );
643 strcpy( item, temp );
646 VERBOSE(3,5,
"mdtest_stat %4s: %s", (dirs ?
"dir" :
"file"), item);
648 WARNF(
"unable to stat %s %s", dirs ?
"directory" :
"file", item);
654 void mdtest_read(
int random,
int dirs,
const long dir_iter,
char *path) {
655 uint64_t parent_dir, item_num = 0;
659 VERBOSE(1,-1,
"Entering mdtest_read on %s", path );
668 uint64_t stop_items = o.
items;
675 for (uint64_t i = 0 ; i < stop_items ; ++i) {
712 if (parent_dir > 0) {
720 parent_dir = (
unsigned long long) ((parent_dir-1) / o.
branch_factor);
727 sprintf( temp,
"%s/%s", path, item );
728 strcpy( item, temp );
731 VERBOSE(3,5,
"mdtest_read file: %s", item);
737 if (
NULL == aiori_fh) {
738 WARNF(
"unable to open file %s", item);
746 WARNF(
"unable to read file %s", item);
758 VERBOSE(1,1,
"verification error in file: %s", item);
776 VERBOSE(1,-1,
"Entering collective_create_remove on %s", path );
779 for (
int i = 0 ; i < ntasks ; ++i) {
819 VERBOSE(3,5,
"collective_create_remove (create_remove_items): temp is '%s'", temp);
852 uint64_t parent_dir, item_num = 0;
857 WARN(
"Backend doesn't support rename\n");
861 VERBOSE(1,-1,
"Entering mdtest_rename on %s", path );
863 uint64_t stop_items = o.
items;
869 if(stop_items == 1)
return;
873 for (uint64_t i = 0 ; i < stop_items; ++i) {
890 if (parent_dir > 0) {
904 sprintf( temp,
"%s/%s", path, item );
905 strcpy( item, temp );
907 VERBOSE(3,5,
"mdtest_rename %4s: %s", (dirs ?
"dir" :
"file"), item);
909 sprintf(first_item_name,
"%s-XX", item);
910 strcpy(item_last, first_item_name);
911 }
else if(i == stop_items - 1){
912 strcpy(item, first_item_name);
915 WARNF(
"unable to rename %s %s", dirs ?
"directory" :
"file", item);
918 strcpy(item_last, item);
923 res->
time[test] = t_end - t_start;
924 if(isfinite(t_end_before_barrier)){
930 res->
rate[test] = 0.0;
933 res->
rate[test] = item_count/res->
time[test];
936 res->
items[test] = item_count;
942 double t_start, t_end, t_end_before_barrier;
948 VERBOSE(1,-1,
"Entering directory_test on %s", path );
967 sprintf( temp_path,
"%s/%s", o.
testdir, path );
970 VERBOSE(3,-1,
"directory_test: create path is '%s'", temp_path );
1001 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1004 VERBOSE(3,5,
"stat path is '%s'", temp_path );
1031 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1034 VERBOSE(3,5,
"directory_test: read path is '%s'", temp_path );
1061 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1064 VERBOSE(3,5,
"rename path is '%s'", temp_path );
1086 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1089 VERBOSE(3,5,
"directory_test: remove directories path is '%s'", temp_path );
1110 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1113 VERBOSE(3,5,
"directory_test: remove unique directories path is '%s'\n", temp_path );
1125 long long unsigned max_iter = 0;
1127 VERBOSE(1,1,
"stonewall hit with %lld items", (
long long) items_done );
1128 MPI_Allreduce(& items_done, & max_iter, 1, MPI_LONG_LONG_INT, MPI_MAX,
testComm);
1131 *out_max_iter = max_iter;
1134 long long min_accessed = 0;
1135 MPI_Reduce(& items_done, & min_accessed, 1, MPI_LONG_LONG_INT, MPI_MIN, 0,
testComm);
1136 long long sum_accessed = 0;
1137 MPI_Reduce(& items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0,
testComm);
1142 VERBOSE(0,-1,
"Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((
double) sum_accessed) / o.
size);
1149 #ifdef HAVE_GPFSCREATESHARING_T 1150 void gpfs_createSharing(
char *testDirName,
int enable)
1153 int fd_oflag = O_RDONLY;
1157 gpfsFcntlHeader_t header;
1158 gpfsCreateSharing_t fcreate;
1159 } createSharingHint;
1161 createSharingHint.header.totalLength =
sizeof(createSharingHint);
1162 createSharingHint.header.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
1163 createSharingHint.header.fcntlReserved = 0;
1165 createSharingHint.fcreate.structLen =
sizeof(createSharingHint.fcreate);
1166 createSharingHint.fcreate.structType = GPFS_CREATE_SHARING;
1167 createSharingHint.fcreate.enable = enable;
1169 fd =
open64(testDirName, fd_oflag);
1171 ERRF(
"open64(\"%s\", %d) failed: %s", testDirName, fd_oflag, strerror(
errno));
1173 rc = gpfs_fcntl(fd, &createSharingHint);
1175 WARNF(
"gpfs_fcntl(%d, ...) create sharing hint failed. rc %d", fd, rc);
1187 VERBOSE(5,5,
"operating on %s", temp_path);
1192 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1195 VERBOSE(3,-1,
"file_test: create path is '%s'", temp_path );
1208 uint64_t max_iter = 0;
1234 double t_start, t_end, t_end_before_barrier;
1240 VERBOSE(3,5,
"Entering file_test on %s", path);
1248 #ifdef HAVE_GPFSCREATESHARING_T 1253 sprintf(temp_path,
"%s/%s", o.
testdir, path);
1254 VERBOSE(3,5,
"file_test: GPFS Hint enable directory path is '%s'", temp_path);
1255 gpfs_createSharing(temp_path, 1);
1264 #ifdef HAVE_GPFSCREATESHARING_T 1268 VERBOSE(3,5,
"file_test: GPFS Hint disable directory path is '%s'", temp_path);
1269 gpfs_createSharing(temp_path, 0);
1276 int64_t expected_items;
1279 if(expected_items >= 0){
1284 o.
items = expected_items;
1289 if(expected_items == -1){
1290 WARN(
"Could not read stonewall status file");
1310 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1313 VERBOSE(3,5,
"file_test: stat path is '%s'", temp_path );
1336 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1339 VERBOSE(3,5,
"file_test: read path is '%s'", temp_path );
1368 sprintf( temp_path,
"%s/%s", o.
testdir, path );
1371 VERBOSE(3,5,
"file_test: rm directories path is '%s'", temp_path );
1378 VERBOSE(3,5,
"gonna create %s", temp_path);
1392 strcpy( temp_path, path );
1395 VERBOSE(3,5,
"file_test: rm unique directories path is '%s'", temp_path );
1424 default:
return "ERR INVALID TESTNAME :";
1437 FAIL(
"Cannot open saveRankPerformanceDetails file for writes!");
1441 MPI_Gather(o.
summary_table, size /
sizeof(
double), MPI_DOUBLE, results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1445 cpos += sprintf(cpos,
"all,%llu", (
long long unsigned) o.
items);
1447 if(agg->
items[e] == 0){
1448 cpos += sprintf(cpos,
",,");
1450 cpos += sprintf(cpos,
",%.10e,%.10e", agg->
items[e] / agg->
time[e], agg->
time[e]);
1453 cpos += sprintf(cpos,
"\n");
1454 int ret = fwrite(buff, cpos - buff, 1, fd);
1456 for(
int iter = 0; iter < iterations; iter++){
1457 for(
int i=0; i < o.
size; i++){
1460 cpos += sprintf(cpos,
"%d,", i);
1462 if(cur->
items[e] == 0){
1463 cpos += sprintf(cpos,
",,");
1468 cpos += sprintf(cpos,
"\n");
1469 ret = fwrite(buff, cpos - buff, 1, fd);
1471 WARN(
"Couln't append to saveRankPerformanceDetailsCSV file\n");
1485 return & all_results[proc * interation_count + iter];
1490 double min, max, mean, sd, sum, var, curr = 0;
1491 double imin, imax, imean, isum, icur;
1492 char const * access;
1513 fprintf(
out_logfile,
"\nPer process result (%s):\n", print_time ?
"time" :
"rate");
1514 for (
int j = 0; j < iterations; j++) {
1522 for (
int k=0; k < o.
size; k++) {
1529 fprintf(
out_logfile,
"%c%e", (k==0 ?
' ':
','), curr);
1536 VERBOSE(0, -1,
"\nSUMMARY %s (in ops/sec): (of %d iterations)", print_time ?
"time" :
"rate", iterations);
1537 PRINT(
" Operation ");
1539 PRINT(
"per Rank: Max Min Mean per Iteration:");
1543 PRINT(
" Max Min Mean Std Dev\n");
1544 PRINT(
" --------- ");
1547 PRINT(
" --- --- ---- ");
1549 PRINT(
" --- --- ---- -------\n");
1550 for (
int i = start; i < stop; i++) {
1556 double iter_result[iterations];
1557 for (
int j = 0; j < iterations; j++) {
1558 icur = print_time ? 0 : 1e308;
1559 for (
int k = 0; k < o.
size; k++) {
1575 curr = cur->
time[i];
1580 curr = cur->
rate[i];
1595 iter_result[j] = icur;
1597 iter_result[j] = icur * o.
size;
1600 mean = sum / iterations / o.
size;
1601 imean = isum / iterations;
1608 for (
int j = 0; j < iterations; j++) {
1609 var += (imean - iter_result[j]) * (imean - iter_result[j]);
1611 var = var / (iterations - 1);
1627 fprintf(
out_logfile,
"%14.3f\n", iterations == 1 ? 0 : sd);
1637 for (
int j = 0; j < iterations; j++) {
1658 mean = sum / (iterations);
1660 for (
int j = 0; j < iterations; j++) {
1666 var += (mean - curr)*(mean - curr);
1668 var = var / (iterations - 1);
1680 fprintf(
out_logfile,
"%14.3f ", sum / iterations);
1681 fprintf(
out_logfile,
"%14.3f\n", iterations == 1 ? 0 : sd);
1694 memset(all_results, 0, size * o.
size);
1695 MPI_Gather(o.
summary_table, size /
sizeof(
double), MPI_DOUBLE, all_results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1697 for(
int j=0; j < iterations; j++){
1700 double max_time = 0;
1701 double max_stonewall_time = 0;
1702 uint64_t sum_items = 0;
1705 for(
int p=0; p < o.
size; p++){
1708 double t = cur->
time[i];
1709 max_time = max_time < t ? t : max_time;
1711 sum_items += cur->
items[i];
1714 max_stonewall_time = max_stonewall_time < t ? t : max_stonewall_time;
1717 results[j].
items[i] = sum_items;
1718 results[j].
time[i] = max_time;
1721 results[j].
rate[i] = 0.0;
1723 results[j].
rate[i] = sum_items / max_time;
1737 MPI_Bcast(results, size /
sizeof(
double), MPI_DOUBLE, 0,
testComm);
1740 for(
int j=0; j < iterations; j++){
1765 FAIL(
"Error, stone wall timer does only work with a branch factor <= 1 (current is %d) and with barriers\n", o.
branch_factor);
1770 VERBOSE(1,-1,
"main: Setting create/stat/read/remove_only to True" );
1773 VERBOSE(1,-1,
"Entering md_validate_tests..." );
1791 FAIL(
"Possible race conditions will occur: -B not compatible with -N");
1796 FAIL(
"-c not compatible with -S");
1799 FAIL(
"-c not compatible with multiple test directories");
1802 FAIL(
"-c not compatible with -B");
1807 FAIL(
"-u not compatible with -S");
1812 FAIL(
"cannot have multiple directory paths with -N strides between neighbor tasks");
1817 FAIL(
"shared directory mode is not compatible with multiple directory paths");
1822 FAIL(
"cannot have more directory paths than MPI tasks");
1827 FAIL(
"depth must be greater than or equal to zero");
1831 FAIL(
"branch factor must be greater than or equal to zero");
1836 FAIL(
"only specify the number of items or the number of items per directory");
1838 FAIL(
"items must be a multiple of items per directory");
1843 FAIL(
"-k not compatible with -w");
1847 FAIL(
"Verify read requires that the read test is used");
1850 FAIL(
"Verify read requires that read bytes is > 0");
1853 WARN(
"Read bytes is 0, thus, a read test will actually just open/close");
1856 FAIL(
"When writing and reading files, read bytes must be smaller than write bytes");
1862 FAIL(
"Cannot open saveRankPerformanceDetails file for write!");
1864 char * head =
"rank,items";
1865 int ret = fwrite(head, strlen(head), 1, fd);
1870 sprintf(buf,
",rate-%s,time-%s", str, str);
1871 ret = fwrite(buf, strlen(buf), 1, fd);
1873 FAIL(
"Cannot write header to saveRankPerformanceDetails file");
1876 fwrite(
"\n", 1, 1, fd);
1885 int64_t file_system_unit_val = 1024 * 1024 * 1024;
1886 int64_t inode_unit_val = 1024 * 1024;
1887 int64_t total_file_system_size,
1888 free_file_system_size,
1891 double total_file_system_size_hr,
1892 used_file_system_percentage,
1893 used_inode_percentage;
1897 VERBOSE(1,-1,
"Entering show_file_system_size on %s", file_system );
1901 FAIL(
"unable to stat file system %s", file_system);
1907 used_file_system_percentage = (1 - ((double)free_file_system_size
1908 / (
double)total_file_system_size)) * 100;
1909 total_file_system_size_hr = (double)total_file_system_size
1910 / (
double)file_system_unit_val;
1911 if (total_file_system_size_hr > 1024) {
1912 total_file_system_size_hr = total_file_system_size_hr / 1024;
1913 strcpy(file_system_unit_str,
"TiB");
1917 total_inodes = stat_buf.
f_files;
1918 free_inodes = stat_buf.
f_ffree;
1920 used_inode_percentage = (1 - ((double)free_inodes/(
double)total_inodes))
1923 if (realpath(file_system, real_path) ==
NULL) {
1924 WARN(
"unable to use realpath() on file system");
1929 VERBOSE(0,-1,
"Path: %s", real_path);
1930 VERBOSE(0,-1,
"FS: %.1f %s Used FS: %2.1f%% Inodes: %.1f %s Used Inodes: %2.1f%%\n",
1931 total_file_system_size_hr, file_system_unit_str, used_file_system_percentage,
1932 (
double)total_inodes / (
double)inode_unit_val, inode_unit_str, used_inode_percentage);
1944 VERBOSE(1,5,
"Entering create_remove_directory_tree on %s, currDepth = %d...", path, currDepth );
1946 if (currDepth == 0) {
1950 VERBOSE(2,5,
"Making directory '%s'", dir);
1952 WARNF(
"unable to create tree directory '%s'", dir);
1954 #ifdef HAVE_LUSTRE_LUSTREAPI 1956 if (o.global_dir_layout && \
1957 llapi_dir_set_default_lmv_stripe(dir, -1, 0,
1958 LMV_HASH_TYPE_FNV_1A_64,
1960 FAIL(
"Unable to reset to global default directory layout");
1968 VERBOSE(2,5,
"Remove directory '%s'", dir);
1970 WARNF(
"Unable to remove directory %s", dir);
1973 }
else if (currDepth <= o.
depth) {
1976 strcpy(temp_path, path);
1977 int currDir = dirNum;
1981 strcat(temp_path, dir);
1984 VERBOSE(2,5,
"Making directory '%s'", temp_path);
1986 WARNF(
"Unable to create directory %s", temp_path);
1995 VERBOSE(2,5,
"Remove directory '%s'", temp_path);
1997 WARNF(
"Unable to remove directory %s", temp_path);
2001 strcpy(temp_path, path);
2009 memset(& progress_o, 0 ,
sizeof(progress_o));
2015 double startCreate, endCreate;
2018 VERBOSE(1,-1,
"main: * iteration %d *", j+1);
2027 VERBOSE(2,5,
"main (for j loop): making o.testdir, '%s'", o.
testdir );
2030 WARNF(
"Unable to create test directory %s", o.
testdir);
2032 #ifdef HAVE_LUSTRE_LUSTREAPI 2035 WARN(
"Unable to reset to global default directory layout");
2054 for (k=0; k < o.
size; k++) {
2057 VERBOSE(3,5,
"main (create hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
2069 VERBOSE(3,5,
"main (create hierarchical directory loop-!collective_creates): Calling create_remove_directory_tree with '%s'", o.
testdir );
2078 VERBOSE(3,5,
"main (create hierarchical directory loop-!unque_dir_per_task): Calling create_remove_directory_tree with '%s'", o.
testdir );
2161 for (k=0; k < o.
size; k++) {
2164 VERBOSE(3,-1,
"main (remove hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
2177 VERBOSE(3,-1,
"main (remove hierarchical directory loop-!collective): Calling create_remove_directory_tree with '%s'", o.
testdir );
2187 VERBOSE(3,-1,
"V-3: main (remove hierarchical directory loop-!unique_dir_per_task): Calling create_remove_directory_tree with '%s'", o.
testdir );
2205 VERBOSE(2,-1,
"main (at end of for j loop): Removing o.testdir of '%s'\n", o.
testdir );
2225 .random_buffer_offset = -1,
2242 int numTasksOnNode0 = 0;
2243 MPI_Group worldgroup;
2248 } range = {0, 0, 1};
2253 int created_root_dir = 0;
2256 int no_barriers = 0;
2257 char * path =
"./out";
2260 char APIs_legacy[1024];
2263 sprintf(apiStr,
"API for I/O [%s]", APIs);
2266 char * packetType =
"t";
2271 {
'd',
NULL,
"directory or multiple directories where the test will run [dir|dir1@dir2@dir3...]",
OPTION_OPTIONAL_ARGUMENT,
's', & path},
2281 #ifdef HAVE_LUSTRE_LUSTREAPI 2282 {
'g',
NULL,
"global default directory layout for test subdirectories (deletes inherited striping layout)",
OPTION_FLAG,
'd', & o.global_dir_layout},
2295 {
'R',
NULL,
"random access to files (only for stat)",
OPTION_FLAG,
'd', & randomize},
2308 {0,
"verify-write",
"Verify the data after a write by reading it back immediately",
OPTION_FLAG,
'd', & o.
verify_write},
2310 {
'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},
2313 {0,
"dataPacketType",
"type of packet that will be created [offset|incompressible|timestamp|random|o|i|t|r]",
OPTION_OPTIONAL_ARGUMENT,
's', & packetType},
2317 {0,
"allocateBufferOnGPU",
"Allocate I/O buffers on the GPU: X=1 uses managed memory - verifications are run on CPU; X=2 managed memory - verifications on GPU; X=3 device memory with verifications on GPU.",
OPTION_OPTIONAL_ARGUMENT,
'd', & o.
gpuMemoryFlags},
2319 #ifdef HAVE_GPU_DIRECT 2320 {0,
"gpuDirect",
"Allocate I/O buffers on the GPU and use gpuDirect to store data; this option is incompatible with any option requiring CPU access to data.",
OPTION_FLAG,
'd', & o.
gpuDirect},
2333 ERR(
"Unrecognized I/O API");
2335 ERR(
"Backend doesn't support MDTest");
2338 free(global_options->
modules);
2339 free(global_options);
2362 char cmd_buffer[4096];
2363 strncpy(cmd_buffer, argv[0], 4096);
2364 for (i = 1; i < argc; i++) {
2365 snprintf(&cmd_buffer[strlen(cmd_buffer)], 4096-strlen(cmd_buffer),
" '%s'", argv[i]);
2370 VERBOSE(0,-1,
"Command line used: %s", cmd_buffer);
2377 if( randomize > 0 ){
2401 VERBOSE(1,-1,
"dirpath(s):" );
2408 VERBOSE(1,-1,
"first : %d", first );
2410 #ifdef HAVE_LUSTRE_LUSTREAPI 2411 VERBOSE(1,-1,
"global_dir_layout : %s", ( o.global_dir_layout ?
"True" :
"False" ));
2413 VERBOSE(1,-1,
"iterations : %d", iterations );
2415 VERBOSE(1,-1,
"last : %d", last );
2422 VERBOSE(1,-1,
"stride : %d", stride );
2483 for (s=0; s < o.
items; s++) {
2488 uint64_t n = o.
items;
2500 uint64_t k = ( uint64_t ) (((
double )rand() / ( double )RAND_MAX ) * ( double )n );
2535 created_root_dir = 1;
2539 VERBOSE(3,-1,
"main (before display_freespace): o.testdirpath is '%s'", o.
testdirpath );
2544 if ( numNodes > 1 && tasksBlockMapping ) {
2552 VERBOSE(3,-1,
"main (after display_freespace): o.testdirpath is '%s'", o.
testdirpath );
2561 perror(
"gethostname");
2570 FAIL(
"process number: first > last doesn't make sense");
2573 FAIL(
"process number: last > number of processes doesn't make sense");
2589 strcpy(o.
mk_name,
"mdtest.shared.");
2592 strcpy(o.
rm_name,
"mdtest.shared.");
2594 MPI_Comm_group(
testComm, &worldgroup);
2596 last = o.
size < last ? o.
size : last;
2599 for (i = first; i <= last; i += stride) {
2603 MPI_Group testgroup;
2605 MPI_Group_range_incl(worldgroup, 1, (
void *)&range, &testgroup);
2606 MPI_Comm_create(world_com, testgroup, &
testComm);
2607 MPI_Group_free(&testgroup);
2612 MPI_Comm_dup(world_com, &
testComm);
2617 uint64_t items_all = i * o.
items;
2622 VERBOSE(0,-1,
"%d tasks, "LLU" files/directories", i, items_all);
2625 VERBOSE(0,-1,
"%d tasks, "LLU" files", i, items_all);
2628 VERBOSE(0,-1,
"%d tasks, 1 file", i);
2631 VERBOSE(0,-1,
"%d tasks, "LLU" directories", i, items_all);
2635 VERBOSE(1,-1,
" Operation Duration Rate");
2636 VERBOSE(1,-1,
" --------- -------- ----");
2638 for (j = 0; j < iterations; j++) {
2646 int total_errors = 0;
2648 if(
rank == 0 && total_errors){
2649 VERBOSE(0, -1,
"\nERROR: verifying the data on read (%lld errors)! Take the performance values with care!\n", total_errors);
2655 MPI_Group_free(&worldgroup);
2677 return aggregated_results;
char * stoneWallingStatusFile
void invalidate_buffer_pattern(char *buffer, size_t bytes, ior_memory_flags type)
double time_before_barrier[MDTEST_TREE_CREATE_NUM]
ior_dataPacketType_e dataPacketType
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]
void file_test_create(const int iteration, const int ntasks, const char *path, rank_progress_t *progress, double *t_start)
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)
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]
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)
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]
ior_dataPacketType_e parsePacketType(char t)
static option_help options[]
int(* check_params)(aiori_mod_opt_t *)
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)
void initCUDA(int blockMapping, int rank, int numNodes, int tasksPerNode, int useGPUID)
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)
ior_memory_flags gpuMemoryFlags
double GetTimeStamp(void)
void create_remove_directory_tree(int create, int currDepth, char *path, int dirNum, rank_progress_t *progress)
void aiori_supported_apis(char *APIs, char *APIs_legacy, enum bench_type type)
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 phase_prepare()
static void remove_file(const char *path, uint64_t itemNum)
void StoreStoneWallingIterations(char *const filename, int64_t count)
char testdir[MAX_PATHLEN]
static void StoreRankInformation(int iterations, mdtest_results_t *agg)
static options_all_t * global_options
void update_write_memory_pattern(uint64_t item, char *buf, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
#define WARNF(FORMAT,...)
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)
int show_perrank_statistics
uint64_t stonewall_last_item[MDTEST_LAST_NUM]
void(* finalize)(aiori_mod_opt_t *options)
void generate_memory_pattern(char *buf, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
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]
int verify_memory_pattern(uint64_t item, char *buffer, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
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)
static void mdtest_iteration(int i, int j, mdtest_results_t *summary_table)
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)
static void updateResult(mdtest_results_t *res, mdtest_test_num_t test, uint64_t item_count, double t_start, double t_end, double t_end_before_barrier)
void * safeMalloc(uint64_t size)
void * aligned_buffer_alloc(size_t size, ior_memory_flags type)