38 #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> 74 #define FILEMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH 75 #define DIRMODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH 76 #define RELEASE_VERS "1.9.3" 77 #define TEST_DIR "#test-dir" 78 #define ITEM_COUNT 25000 167 #define CHECK_STONE_WALL(p) (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds)) 179 fprintf(
out_logfile,
"V-1: Entering offset_timers...\n" );
183 toffset = MPI_Wtime() - t[tcount];
184 for (i = 0; i < tcount+1; i++) {
191 char delimiter_string[3] = {
'@',
'\n',
'\0' };
196 fprintf(
out_logfile,
"V-1: Entering parse_dirpath...\n" );
203 while (* tmp !=
'\0') {
210 dirpath_arg = strdup(dirpath_arg);
213 FAIL(
"out of memory");
216 token = strtok(dirpath_arg, delimiter_string);
217 while (token !=
NULL) {
219 token = strtok(
NULL, delimiter_string);
227 pos += sprintf(&
testdir[pos],
"/");
230 pos += sprintf(&
testdir[pos],
".%d-%d", j, dir_iter);
240 fprintf(
out_logfile,
"V-1: Entering unique_dir_access...\n" );
260 const char *operation = create ?
"create" :
"remove";
264 (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
271 sprintf(curr_item,
"%s/dir.%s%" PRIu64, path, create ?
mk_name :
rm_name, itemNum);
273 fprintf(
out_logfile,
"V-3: create_remove_items_helper (dirs %s): curr_item is \"%s\"\n", operation, curr_item);
279 FAIL(
"unable to create directory");
282 if (backend->
rmdir(curr_item, ¶m) == -1) {
283 FAIL(
"unable to remove directory");
293 (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
300 sprintf(curr_item,
"%s/file.%s"LLU"", path,
rm_name, itemNum);
302 fprintf(
out_logfile,
"V-3: create_remove_items_helper (non-dirs remove): curr_item is \"%s\"\n", curr_item);
306 backend->
delete (curr_item, ¶m);
316 (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
323 sprintf(curr_item,
"%s/file.%s"LLU"", path,
mk_name, itemNum);
325 fprintf(
out_logfile,
"V-3: create_remove_items_helper (non-dirs create): curr_item is \"%s\"\n", curr_item);
333 fprintf(
out_logfile,
"V-3: create_remove_items_helper (collective): open...\n" );
337 aiori_fh = backend->
open (curr_item, ¶m);
338 if (
NULL == aiori_fh) {
339 FAIL(
"unable to open file");
350 fprintf(
out_logfile,
"V-3: create_remove_items_helper (non-collective, shared): open...\n" );
354 aiori_fh = backend->
create (curr_item, ¶m);
355 if (
NULL == aiori_fh) {
356 FAIL(
"unable to create file");
362 fprintf(
out_logfile,
"V-3: create_remove_items_helper: write...\n" );
373 FAIL(
"unable to write file");
378 fprintf(
out_logfile,
"V-3: create_remove_items_helper: close...\n" );
382 backend->
close (aiori_fh, ¶m);
390 fprintf(
out_logfile,
"V-1: Entering create_remove_items_helper...\n" );
419 fprintf(
out_logfile,
"V-1: Entering collective_helper...\n" );
428 sprintf(curr_item,
"%s/file.%s"LLU"", path, create ?
mk_name :
rm_name, itemNum+i);
430 fprintf(
out_logfile,
"V-3: create file: %s\n", curr_item);
439 aiori_fh = backend->
create (curr_item, ¶m);
440 if (
NULL == aiori_fh) {
441 FAIL(
"unable to create file");
444 backend->
close (aiori_fh, ¶m);
447 backend->
delete (curr_item, ¶m);
463 unsigned long long currDir = dirNum;
467 fprintf(
out_logfile,
"V-1: Entering create_remove_items, currDepth = %d...\n", currDepth );
473 strcpy(temp_path, path);
476 fprintf(
out_logfile,
"V-3: create_remove_items (start): temp_path is \"%s\"\n", temp_path );
480 if (currDepth == 0) {
492 collective, temp_path, ++dirNum, progress);
495 }
else if (currDepth <=
depth) {
501 strcat(temp_path,
"/");
502 strcat(temp_path, dir);
505 fprintf(
out_logfile,
"V-3: create_remove_items (for loop): temp_path is \"%s\"\n", temp_path );
525 ( currDir * (
unsigned long long )branch_factor ) + 1,
531 strcpy(temp_path, path);
540 uint64_t parent_dir, item_num = 0;
544 fprintf(
out_logfile,
"V-1: Entering mdtest_stat...\n" );
548 uint64_t stop_items =
items;
555 for (uint64_t i = 0 ; i < stop_items ; ++i) {
598 if (parent_dir > 0) {
613 sprintf( temp,
"%s/%s", path, item );
614 strcpy( item, temp );
619 fprintf(
out_logfile,
"V-3: mdtest_stat dir : %s\n", item);
621 fprintf(
out_logfile,
"V-3: mdtest_stat file: %s\n", item);
626 if (-1 == backend->
stat (item, &buf, ¶m)) {
629 fprintf(
out_logfile,
"V-3: Stat'ing directory \"%s\"\n", item );
632 FAIL(
"unable to stat directory");
635 fprintf(
out_logfile,
"V-3: Stat'ing file \"%s\"\n", item );
638 FAIL(
"unable to stat file");
646 void mdtest_read(
int random,
int dirs,
const long dir_iter,
char *path) {
647 uint64_t parent_dir, item_num = 0;
652 fprintf(
out_logfile,
"V-1: Entering mdtest_read...\n" );
660 FAIL(
"out of memory");
664 uint64_t stop_items =
items;
671 for (uint64_t i = 0 ; i < stop_items ; ++i) {
709 if (parent_dir > 0) {
717 parent_dir = (
unsigned long long) ((parent_dir-1) /
branch_factor);
724 sprintf( temp,
"%s/%s", path, item );
725 strcpy( item, temp );
730 fprintf(
out_logfile,
"V-3: mdtest_read file: %s\n", item);
737 aiori_fh = backend->
open (item, ¶m);
738 if (
NULL == aiori_fh) {
739 FAIL(
"unable to open file");
745 FAIL(
"unable to read file");
750 backend->
close (aiori_fh, ¶m);
760 fprintf(
out_logfile,
"V-1: Entering collective_create_remove...\n" );
765 for (
int i = 0 ; i < ntasks ; ++i) {
805 fprintf(
out_logfile,
"V-3: collective_create_remove (create_remove_items): temp is \"%s\"\n", temp);
847 fprintf(
out_logfile,
"V-1: Entering directory_test...\n" );
864 sprintf( temp_path,
"%s/%s",
testdir, path );
868 fprintf(
out_logfile,
"V-3: directory_test: create path is \"%s\"\n", temp_path );
899 sprintf( temp_path,
"%s/%s",
testdir, path );
903 fprintf(
out_logfile,
"V-3: directory_test: stat path is \"%s\"\n", temp_path );
931 sprintf( temp_path,
"%s/%s",
testdir, path );
935 fprintf(
out_logfile,
"V-3: directory_test: read path is \"%s\"\n", temp_path );
962 sprintf( temp_path,
"%s/%s",
testdir, path );
966 fprintf(
out_logfile,
"V-3: directory_test: remove directories path is \"%s\"\n", temp_path );
990 sprintf( temp_path,
"%s/%s",
testdir, path );
994 fprintf(
out_logfile,
"V-3: directory_test: remove unique directories path is \"%s\"\n", temp_path );
1005 summary_table[iteration].
rate[0] =
items*size/(t[1] - t[0]);
1006 summary_table[iteration].
time[0] = t[1] - t[0];
1011 summary_table[iteration].
rate[1] =
items*size/(t[2] - t[1]);
1012 summary_table[iteration].
time[1] = t[2] - t[1];
1017 summary_table[iteration].
rate[2] =
items*size/(t[3] - t[2]);
1018 summary_table[iteration].
time[2] = t[3] - t[2];
1023 summary_table[iteration].
rate[3] =
items*size/(t[4] - t[3]);
1024 summary_table[iteration].
time[3] = t[4] - t[3];
1030 fprintf(
out_logfile,
"V-1: Directory creation: %14.3f sec, %14.3f ops/sec\n",
1031 t[1] - t[0], summary_table[iteration].rate[0]);
1032 fprintf(
out_logfile,
"V-1: Directory stat : %14.3f sec, %14.3f ops/sec\n",
1033 t[2] - t[1], summary_table[iteration].rate[1]);
1038 fprintf(
out_logfile,
"V-1: Directory removal : %14.3f sec, %14.3f ops/sec\n",
1039 t[4] - t[3], summary_table[iteration].rate[3]);
1052 long long unsigned max_iter = 0;
1053 MPI_Allreduce(& progress->
items_done, & max_iter, 1, MPI_LONG_LONG_INT, MPI_MAX,
testComm);
1057 long long min_accessed = 0;
1058 MPI_Reduce(& progress->
items_done, & min_accessed, 1, MPI_LONG_LONG_INT, MPI_MIN, 0,
testComm);
1059 long long sum_accessed = 0;
1060 MPI_Reduce(& progress->
items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0,
testComm);
1066 fprintf(
out_logfile,
"Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((
double) sum_accessed) / size);
1084 fprintf(
out_logfile,
"V-1: Entering file_test...\n" );
1102 sprintf( temp_path,
"%s/%s",
testdir, path );
1106 fprintf(
out_logfile,
"V-3: file_test: create path is \"%s\"\n", temp_path );
1142 int64_t expected_items;
1145 if(expected_items >= 0){
1146 items = expected_items;
1150 if(expected_items == -1){
1151 fprintf(
out_logfile,
"WARNING: could not read stonewall status file\n");
1174 sprintf( temp_path,
"%s/%s",
testdir, path );
1178 fprintf(
out_logfile,
"V-3: file_test: stat path is \"%s\"\n", temp_path );
1202 sprintf( temp_path,
"%s/%s",
testdir, path );
1206 fprintf(
out_logfile,
"V-3: file_test: read path is \"%s\"\n", temp_path );
1235 sprintf( temp_path,
"%s/%s",
testdir, path );
1239 fprintf(
out_logfile,
"V-3: file_test: rm directories path is \"%s\"\n", temp_path );
1261 strcpy( temp_path, path );
1265 fprintf(
out_logfile,
"V-3: file_test: rm unique directories path is \"%s\"\n", temp_path );
1280 summary_table[iteration].
rate[4] =
items*size/(t[1] - t[0]);
1281 summary_table[iteration].
time[4] = t[1] - t[0];
1286 summary_table[iteration].
rate[5] =
items*size/(t[2] - t[1]);
1287 summary_table[iteration].
time[5] = t[2] - t[1];
1292 summary_table[iteration].
rate[6] =
items*size/(t[3] - t[2]);
1293 summary_table[iteration].
time[6] = t[3] - t[2];
1298 summary_table[iteration].
rate[7] =
items*size/(t[4] - t[3]);
1299 summary_table[iteration].
time[7] = t[4] - t[3];
1305 fprintf(
out_logfile,
"V-1: File creation : %14.3f sec, %14.3f ops/sec\n",
1306 t[1] - t[0], summary_table[iteration].rate[4]);
1307 fprintf(
out_logfile,
"V-1: File stat : %14.3f sec, %14.3f ops/sec\n",
1308 t[2] - t[1], summary_table[iteration].rate[5]);
1309 fprintf(
out_logfile,
"V-1: File read : %14.3f sec, %14.3f ops/sec\n",
1310 t[3] - t[2], summary_table[iteration].rate[6]);
1311 fprintf(
out_logfile,
"V-1: File removal : %14.3f sec, %14.3f ops/sec\n",
1312 t[4] - t[3], summary_table[iteration].rate[7]);
1323 sprintf(apiStr,
"API for I/O [%s]", APIs);
1326 "Usage: mdtest [-b branching_factor] [-B] [-c] [-C] [-d testdir] [-D] [-e number_of_bytes_to_read]\n" 1327 " [-E] [-f first] [-F] [-h] [-i iterations] [-I items_per_dir] [-l last] [-L]\n" 1328 " [-n number_of_items] [-N stride_length] [-p seconds] [-r]\n" 1329 " [-R[seed]] [-s stride] [-S] [-t] [-T] [-u] [-v] [-a API]\n" 1330 " [-V verbosity_value] [-w number_of_bytes_to_write] [-W seconds] [-y] [-z depth] -Z\n" 1332 "\t-b: branching factor of hierarchical directory structure\n" 1333 "\t-B: no barriers between phases\n" 1334 "\t-c: collective creates: task 0 does all creates\n" 1335 "\t-C: only create files/dirs\n" 1336 "\t-d: the directory in which the tests will run\n" 1337 "\t-D: perform test on directories only (no files)\n" 1338 "\t-e: bytes to read from each file\n" 1339 "\t-E: only read files/dir\n" 1340 "\t-f: first number of tasks on which the test will run\n" 1341 "\t-F: perform test on files only (no directories)\n" 1342 "\t-h: prints this help message\n" 1343 "\t-i: number of iterations the test will run\n" 1344 "\t-I: number of items per directory in tree\n" 1345 "\t-l: last number of tasks on which the test will run\n" 1346 "\t-L: files only at leaf level of tree\n" 1347 "\t-n: every process will creat/stat/read/remove # directories and files\n" 1348 "\t-N: stride # between neighbor tasks for file/dir operation (local=0)\n" 1349 "\t-p: pre-iteration delay (in seconds)\n" 1350 "\t-r: only remove files or directories left behind by previous runs\n" 1351 "\t-R: randomly stat files (optional argument for random seed)\n" 1352 "\t-s: stride between the number of tasks for each test\n" 1353 "\t-S: shared file access (file only, no directories)\n" 1354 "\t-t: time unique working directory overhead\n" 1355 "\t-T: only stat files/dirs\n" 1356 "\t-u: unique working directory for each task\n" 1357 "\t-v: verbosity (each instance of option increments by one)\n" 1358 "\t-V: verbosity value\n" 1359 "\t-w: bytes to write to each file after it is created\n" 1360 "\t-W: number in seconds; stonewall timer, write as many seconds and ensure all processes did the same number of operations (currently only stops during create phase)\n" 1361 "\t-x: StoneWallingStatusFile; contains the number of iterations of the creation phase, can be used to split phases across runs\n" 1362 "\t-y: sync file after writing\n" 1363 "\t-z: depth of hierarchical directory structure\n" 1364 "\t-Z: print time instead of rate\n",
1368 MPI_Initialized(&j);
1377 return iter * tableSize *
size + rank * tableSize + op;
1384 double min, max, mean, sd, sum = 0, var = 0, curr = 0;
1386 double all[iterations *
size * tableSize];
1390 fprintf(
out_logfile,
"V-1: Entering summarize_results...\n" );
1395 for(
int i=0; i < iterations; i++){
1397 MPI_Gather(& summary_table[i].time[0], tableSize, MPI_DOUBLE, & all[i*tableSize*
size], tableSize, MPI_DOUBLE, 0,
testComm);
1399 MPI_Gather(& summary_table[i].rate[0], tableSize, MPI_DOUBLE, & all[i*tableSize*
size], tableSize, MPI_DOUBLE, 0,
testComm);
1405 fprintf(
out_logfile,
"\nSUMMARY %s: (of %d iterations)\n",
print_time ?
"time":
"rate", iterations);
1407 " Operation Max Min Mean Std Dev\n");
1409 " --------- --- --- ---- -------\n");
1433 double maxes[iterations];
1440 for (i = start; i < stop; i++) {
1441 for (j=0; j<iterations; j++) {
1442 maxes[j] = all[j*tableSize + i];
1443 for (k=0; k<
size; k++) {
1446 if (maxes[j] < curr) {
1452 min = max = maxes[0];
1453 for (j=0; j<iterations; j++) {
1454 if (min > maxes[j]) {
1457 if (max < maxes[j]) {
1462 mean = sum / iterations;
1463 for (j=0; j<iterations; j++) {
1464 var += pow((mean - maxes[j]), 2);
1466 var = var / iterations;
1469 case 0: strcpy(access,
"Directory creation:");
break;
1470 case 1: strcpy(access,
"Directory stat :");
break;
1473 case 3: strcpy(access,
"Directory removal :");
break;
1474 case 4: strcpy(access,
"File creation :");
break;
1475 case 5: strcpy(access,
"File stat :");
break;
1476 case 6: strcpy(access,
"File read :");
break;
1477 case 7: strcpy(access,
"File removal :");
break;
1478 default: strcpy(access,
"ERR");
break;
1493 for (i = start; i < stop; i++) {
1495 for (k=0; k <
size; k++) {
1496 for (j = 0; j < iterations; j++) {
1507 mean = sum / (iterations *
size);
1508 for (k=0; k<
size; k++) {
1509 for (j = 0; j < iterations; j++) {
1510 var += pow((mean - all[(k*tableSize*iterations)
1511 + (j*tableSize) + i]), 2);
1514 var = var / (iterations *
size);
1517 case 0: strcpy(access,
"Directory creation:");
break;
1518 case 1: strcpy(access,
"Directory stat :");
break;
1521 case 3: strcpy(access,
"Directory removal :");
break;
1522 case 4: strcpy(access,
"File creation :");
break;
1523 case 5: strcpy(access,
"File stat :");
break;
1524 case 6: strcpy(access,
"File read :");
break;
1525 case 7: strcpy(access,
"File removal :");
break;
1526 default: strcpy(access,
"ERR");
break;
1542 for (i = 8; i < tableSize; i++) {
1544 for (j = 0; j < iterations; j++) {
1546 curr = summary_table[j].
time[i];
1548 curr = summary_table[j].
rate[i];
1559 mean = sum / (iterations);
1560 for (j = 0; j < iterations; j++) {
1562 curr = summary_table[j].
time[i];
1564 curr = summary_table[j].
rate[i];
1567 var += pow((mean - curr), 2);
1569 var = var / (iterations);
1572 case 8: strcpy(access,
"Tree creation :");
break;
1573 case 9: strcpy(access,
"Tree removal :");
break;
1574 default: strcpy(access,
"ERR");
break;
1591 fprintf(
out_logfile,
"Error, stone wall timer does only work with a branch factor <= 1 and with barriers\n");
1598 fprintf(
out_logfile,
"V-1: main: Setting create/stat/read/remove_only to True\n" );
1604 fprintf(
out_logfile,
"V-1: Entering valid_tests...\n" );
1624 FAIL(
"Possible race conditions will occur: -B not compatible with -N");
1629 FAIL(
"-c not compatible with -S");
1632 FAIL(
"-c not compatible with multiple test directories");
1635 FAIL(
"-c not compatible with -B");
1639 FAIL(
"-a only supported interface is POSIX (and DUMMY) right now!");
1644 FAIL(
"-u not compatible with -S");
1649 FAIL(
"cannot have multiple directory paths with -N strides between neighbor tasks");
1654 FAIL(
"shared directory mode is not compatible with multiple directory paths");
1659 FAIL(
"cannot have more directory paths than MPI tasks");
1664 FAIL(
"depth must be greater than or equal to zero");
1667 if (branch_factor < 1 && depth > 0) {
1668 FAIL(
"branch factor must be greater than or equal to zero");
1673 FAIL(
"only specify the number of items or the number of items per directory");
1675 FAIL(
"items must be a multiple of items per directory");
1677 FAIL(
"items + items_per_dir can only be set without stonewalling");
1687 int64_t file_system_unit_val = 1024 * 1024 * 1024;
1688 int64_t inode_unit_val = 1024 * 1024;
1689 int64_t total_file_system_size,
1690 free_file_system_size,
1693 double total_file_system_size_hr,
1694 used_file_system_percentage,
1695 used_inode_percentage;
1700 fprintf(
out_logfile,
"V-1: Entering show_file_system_size...\n" );
1704 ret = backend->
statfs (file_system, &stat_buf, ¶m);
1706 FAIL(
"unable to stat file system");
1712 used_file_system_percentage = (1 - ((double)free_file_system_size
1713 / (
double)total_file_system_size)) * 100;
1714 total_file_system_size_hr = (double)total_file_system_size
1715 / (
double)file_system_unit_val;
1716 if (total_file_system_size_hr > 1024) {
1717 total_file_system_size_hr = total_file_system_size_hr / 1024;
1718 strcpy(file_system_unit_str,
"TiB");
1722 total_inodes = stat_buf.
f_files;
1723 free_inodes = stat_buf.
f_ffree;
1725 used_inode_percentage = (1 - ((double)free_inodes/(
double)total_inodes))
1728 if (realpath(file_system, real_path) ==
NULL) {
1729 FAIL(
"unable to use realpath()");
1735 fprintf(
out_logfile,
"FS: %.1f %s Used FS: %2.1f%% ",
1736 total_file_system_size_hr, file_system_unit_str,
1737 used_file_system_percentage);
1738 fprintf(
out_logfile,
"Inodes: %.1f %s Used Inodes: %2.1f%%\n",
1739 (
double)total_inodes / (
double)inode_unit_val,
1740 inode_unit_str, used_inode_percentage);
1750 int directoryFound = 0;
1754 fprintf(
out_logfile,
"V-1: Entering display_freespace...\n" );
1759 fprintf(
out_logfile,
"V-3: testdirpath is \"%s\"\n", testdirpath );
1763 strcpy(dirpath, testdirpath);
1766 i = strlen(dirpath);
1768 if (dirpath[i] ==
'/') {
1776 if (directoryFound == 0) {
1777 strcpy(dirpath,
".");
1781 fprintf(
out_logfile,
"V-3: Before show_file_system_size, dirpath is \"%s\"\n", dirpath );
1788 fprintf(
out_logfile,
"V-3: After show_file_system_size, dirpath is \"%s\"\n", dirpath );
1803 fprintf(
out_logfile,
"V-1: Entering create_remove_directory_tree, currDepth = %d...\n", currDepth );
1807 if (currDepth == 0) {
1812 fprintf(
out_logfile,
"V-2: Making directory \"%s\"\n", dir);
1817 fprintf(
out_logfile,
"error could not create directory \"%s\"\n", dir);
1825 fprintf(
out_logfile,
"V-2: Remove directory \"%s\"\n", dir);
1829 if (-1 == backend->
rmdir(dir, ¶m)) {
1830 FAIL(
"Unable to remove directory");
1833 }
else if (currDepth <=
depth) {
1836 strcpy(temp_path, path);
1837 int currDir = dirNum;
1841 strcat(temp_path, dir);
1845 fprintf(
out_logfile,
"V-2: Making directory \"%s\"\n", temp_path);
1849 if (-1 == backend->
mkdir(temp_path,
DIRMODE, ¶m)) {
1850 FAIL(
"Unable to create directory");
1855 temp_path, (branch_factor*currDir)+1, progress);
1860 fprintf(
out_logfile,
"V-2: Remove directory \"%s\"\n", temp_path);
1864 if (-1 == backend->
rmdir(temp_path, ¶m)) {
1865 FAIL(
"Unable to remove directory");
1869 strcpy(temp_path, path);
1877 memset(& progress_o, 0 ,
sizeof(progress_o));
1884 double startCreate, endCreate;
1888 fprintf(
out_logfile,
"V-1: main: * iteration %d *\n", j+1);
1901 FAIL(
"Unable to create test directory");
1910 startCreate = MPI_Wtime();
1920 for (k=0; k<
size; k++) {
1925 "V-3: main (create hierarchical directory loop-collective): Calling create_remove_directory_tree with \"%s\"\n",
1943 "V-3: main (create hierarchical directory loop-!collective_creates): Calling create_remove_directory_tree with \"%s\"\n",
1958 "V-3: main (create hierarchical directory loop-!unque_dir_per_task): Calling create_remove_directory_tree with \"%s\"\n",
1972 endCreate = MPI_Wtime();
1973 summary_table->
rate[8] =
1975 summary_table->
time[8] = (endCreate - startCreate);
1979 fprintf(
out_logfile,
"V-1: main: Tree creation : %14.3f sec, %14.3f ops/sec\n",
1980 (endCreate - startCreate), summary_table->
rate[8]);
2044 startCreate = MPI_Wtime();
2053 for (k=0; k<
size; k++) {
2058 "V-3: main (remove hierarchical directory loop-collective): Calling create_remove_directory_tree with \"%s\"\n",
2076 "V-3: main (remove hierarchical directory loop-!collective): Calling create_remove_directory_tree with \"%s\"\n",
2091 "V-3: main (remove hierarchical directory loop-!unique_dir_per_task): Calling create_remove_directory_tree with \"%s\"\n",
2106 endCreate = MPI_Wtime();
2108 summary_table->
time[9] = endCreate - startCreate;
2112 fprintf(
out_logfile,
"V-1: main Tree removal : %14.3f sec, %14.3f ops/sec\n",
2113 (endCreate - startCreate), summary_table->
rate[9]);
2118 fprintf(
out_logfile,
"V-2: main (at end of for j loop): Removing testdir of \"%s\"\n",
testdir );
2127 FAIL(
"unable to remove directory");
2132 summary_table->
rate[9] = 0;
2179 MPI_Group worldgroup, testgroup;
2184 } range = {0, 0, 1};
2191 int no_barriers = 0;
2192 char * path =
"./out";
2197 sprintf(apiStr,
"API for I/O [%s]", APIs);
2219 {
'R',
NULL,
"random access to files (only for stat)",
OPTION_FLAG,
'd', & randomize},
2239 if (
NULL == backend) {
2240 FAIL(
"Could not find suitable backend to use");
2253 fprintf(
out_logfile,
"mdtest-%s was launched with %d total task(s) on %d node(s)\n",
2259 fprintf(
out_logfile,
"Command line used: %s", argv[0]);
2260 for (i = 1; i < argc; i++) {
2272 if( randomize > 0 ){
2303 fprintf(
out_logfile,
"iterations : %d\n", iterations );
2368 for (s=0; s <
items; s++) {
2385 uint64_t k = ( uint64_t ) (((
double )rand() / ( double )RAND_MAX ) * ( double )n );
2402 FAIL(
"out of memory");
2411 FAIL(
"Unable to get current working directory");
2421 FAIL(
"Unable to create test directory path");
2445 perror(
"gethostname");
2457 for(
int i=0; i < iterations; i++){
2459 summary_table[i].
rate[j] = 0.0;
2460 summary_table[i].
time[j] = 0.0;
2464 if (summary_table ==
NULL) {
2465 FAIL(
"out of memory");
2475 strcpy(
mk_name,
"mdtest.shared.");
2478 strcpy(
rm_name,
"mdtest.shared.");
2480 MPI_Comm_group(
testComm, &worldgroup);
2483 for (i = first; i <= last && i <=
size; i += stride) {
2485 MPI_Group_range_incl(worldgroup, 1, (
void *)&range, &testgroup);
2488 uint64_t items_all = i *
items;
2493 fprintf(
out_logfile,
"\n%d tasks, "LLU" files/directories\n", i, items_all);
2502 fprintf(
out_logfile,
"\n%d tasks, "LLU" directories\n", i, items_all);
2507 fprintf(
out_logfile,
" Operation Duration Rate\n");
2508 fprintf(
out_logfile,
" --------- -------- ----\n");
2511 for (j = 0; j < iterations; j++) {
2516 if (i == 1 && stride > 1) {
uint64_t stonewall_item_sum[MDTEST_LAST_NUM]
static char testdir[MAX_PATHLEN]
double rate[MDTEST_LAST_NUM]
static char unique_rm_dir[MAX_PATHLEN]
static char testdirpath[MAX_PATHLEN]
void(* delete)(char *, IOR_param_t *)
static char unique_read_dir[MAX_PATHLEN]
static char rm_name[MAX_PATHLEN]
int(* rmdir)(const char *path, IOR_param_t *param)
static int stone_wall_timer_seconds
static char stat_name[MAX_PATHLEN]
static char unique_rm_uni_dir[MAX_PATHLEN]
static void create_file(const char *path, uint64_t itemNum)
static const ior_aiori_t * backend
static int time_unique_dir_overhead
int64_t ReadStoneWallingIterations(char *const filename)
mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *world_out)
static int unique_dir_per_task
int CountTasksPerNode(MPI_Comm comm)
uint64_t stonewall_item_min[MDTEST_LAST_NUM]
void parse_dirpath(char *dirpath_arg)
static int collective_creates
void offset_timers(double *t, int tcount)
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)
static unsigned branch_factor
int(* access)(const char *path, int mode, IOR_param_t *param)
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)
void(* close)(void *, IOR_param_t *)
void aiori_supported_apis(char *APIs)
static char * write_buffer
static int directory_loops
static size_t write_bytes
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)
void *(* open)(char *, IOR_param_t *)
static char * stoneWallingStatusFile
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 time[MDTEST_LAST_NUM]
static char base_tree_name[MAX_PATHLEN]
static mdtest_results_t * summary_table
uint64_t items[MDTEST_LAST_NUM]
static uint64_t num_dirs_in_tree
static char unique_chdir_dir[MAX_PATHLEN]
void collective_create_remove(const int create, const int dirs, const int ntasks, const char *path, rank_progress_t *progress)
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)
double GetTimeStamp(void)
int updateStoneWallIterations(int iteration, rank_progress_t *progress, double tstart)
void display_freespace(char *testdirpath)
void create_remove_directory_tree(int create, int currDepth, char *path, int dirNum, rank_progress_t *progress)
static option_help options[]
int(* mkdir)(const char *path, mode_t mode, IOR_param_t *param)
static void remove_file(const char *path, uint64_t itemNum)
void StoreStoneWallingIterations(char *const filename, int64_t count)
static char hostname[MAX_PATHLEN]
static char unique_stat_dir[MAX_PATHLEN]
static char read_name[MAX_PATHLEN]
static uint64_t num_dirs_in_tree_calc
static void create_remove_dirs(const char *path, bool create, uint64_t itemNum)
void *(* create)(char *, IOR_param_t *)
uint64_t stonewall_last_item[MDTEST_LAST_NUM]
static char * read_buffer
void summarize_results(int iterations)
static char mk_name[MAX_PATHLEN]
static const char * backend_name
double stonewall_time[MDTEST_LAST_NUM]
int(* statfs)(const char *, ior_aiori_statfs_t *, IOR_param_t *param)
static char unique_mk_dir[MAX_PATHLEN]
void DelaySecs(int delay)
int calc_allreduce_index(int iter, int rank, int op)
static uint64_t items_per_dir
void unique_dir_access(int opt, char *to)
int(* stat)(const char *path, struct stat *buf, IOR_param_t *param)
#define CHECK_STONE_WALL(p)
IOR_offset_t(* xfer)(int, void *, IOR_size_t *, IOR_offset_t, IOR_param_t *)
void airoi_parse_options(int argc, char **argv, option_help *global_options)
static uint64_t * rand_array