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_LUSTRE_LUSTREAPI 80 #include <lustre/lustreapi.h> 83 #define FILEMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH 84 #define DIRMODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH 85 #define RELEASE_VERS META_VERSION 86 #define TEST_DIR "test-dir" 87 #define ITEM_COUNT 25000 159 #ifdef HAVE_LUSTRE_LUSTREAPI 160 static int global_dir_layout;
184 #define CHECK_STONE_WALL(p) (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds)) 195 #define VERBOSE(root,any,...) VerboseMessage(root,any,__LINE__,__VA_ARGS__) 196 void VerboseMessage (
int root_level,
int any_level,
int line,
char * format, ...) {
200 va_start (args, format);
201 vsnprintf (buffer, 1024, format, args);
203 if (root_level == 0 && any_level == -1) {
208 fprintf(
out_logfile,
"V-%d: Rank %3d Line %5d %s\n", root_level,
rank, line, buffer );
215 for(
int i=0; i < bytes; i++){
225 VERBOSE(1,-1,
"V-1: Entering offset_timers..." );
228 for (i = 0; i < tcount+1; i++) {
235 char delimiter_string[3] = {
'@',
'\n',
'\0' };
239 VERBOSE(1,-1,
"Entering parse_dirpath on %s...", dirpath_arg );
244 while (* tmp !=
'\0') {
251 dirpath_arg = strdup(dirpath_arg);
254 FAIL(
"out of memory");
257 token = strtok(dirpath_arg, delimiter_string);
258 while (token !=
NULL) {
260 token = strtok(
NULL, delimiter_string);
268 pos += sprintf(&
testdir[pos],
"/");
271 pos += sprintf(&
testdir[pos],
".%d-%d", j, dir_iter);
277 FAIL(
"Error, backend does not provide the sync method, but you requested to use sync.\n");
279 backend->
sync(& param);
305 VERBOSE(1,-1,
"Entering unique_dir_access, set it to %s", to );
310 const char *operation = create ?
"create" :
"remove";
312 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
313 VERBOSE(3,5,
"dir: "LLU"", operation, itemNum);
317 sprintf(curr_item,
"%s/dir.%s%" PRIu64, path, create ?
mk_name :
rm_name, itemNum);
318 VERBOSE(3,5,
"create_remove_items_helper (dirs %s): curr_item is '%s'", operation, curr_item);
322 FAIL(
"unable to create directory %s", curr_item);
325 if (backend->
rmdir(curr_item, ¶m) == -1) {
326 FAIL(
"unable to remove directory %s", curr_item);
334 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
339 sprintf(curr_item,
"%s/file.%s"LLU"", path,
rm_name, itemNum);
340 VERBOSE(3,5,
"create_remove_items_helper (non-dirs remove): curr_item is '%s'", curr_item);
342 backend->
delete (curr_item, ¶m);
348 void *aiori_fh =
NULL;
350 if ( (itemNum %
ITEM_COUNT==0 && (itemNum != 0))) {
355 sprintf(curr_item,
"%s/file.%s"LLU"", path,
mk_name, itemNum);
356 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..." );
364 ret = backend->
mknod (curr_item);
366 FAIL(
"unable to mknode file %s", curr_item);
370 VERBOSE(3,5,
"create_remove_items_helper (collective): open..." );
372 aiori_fh = backend->
open (curr_item, ¶m);
373 if (
NULL == aiori_fh)
374 FAIL(
"unable to open file %s", curr_item);
383 VERBOSE(3,5,
"create_remove_items_helper (non-collective, shared): open..." );
385 aiori_fh = backend->
create (curr_item, ¶m);
386 if (
NULL == aiori_fh)
387 FAIL(
"unable to create file %s", curr_item);
391 VERBOSE(3,5,
"create_remove_items_helper: write..." );
400 FAIL(
"unable to write file %s", curr_item);
404 VERBOSE(3,5,
"create_remove_items_helper: close..." );
405 backend->
close (aiori_fh, ¶m);
412 VERBOSE(1,-1,
"Entering create_remove_items_helper on %s", path );
438 VERBOSE(1,-1,
"Entering collective_helper on %s", path );
445 sprintf(curr_item,
"%s/file.%s"LLU"", path, create ?
mk_name :
rm_name, itemNum+i);
446 VERBOSE(3,5,
"create file: %s", curr_item);
454 aiori_fh = backend->
create (curr_item, ¶m);
455 if (
NULL == aiori_fh) {
456 FAIL(
"unable to create file %s", curr_item);
459 backend->
close (aiori_fh, ¶m);
462 backend->
delete (curr_item, ¶m);
478 unsigned long long currDir = dirNum;
481 VERBOSE(1,-1,
"Entering create_remove_items on %s, currDepth = %d...", path, currDepth );
485 strcpy(temp_path, path);
487 VERBOSE(3,5,
"create_remove_items (start): temp_path is '%s'", temp_path );
489 if (currDepth == 0) {
501 collective, temp_path, ++dirNum, progress);
504 }
else if (currDepth <=
depth) {
510 strcat(temp_path,
"/");
511 strcat(temp_path, dir);
513 VERBOSE(3,5,
"create_remove_items (for loop): temp_path is '%s'", temp_path );
531 ( currDir * (
unsigned long long )branch_factor ) + 1,
537 strcpy(temp_path, path);
546 uint64_t parent_dir, item_num = 0;
549 VERBOSE(1,-1,
"Entering mdtest_stat on %s", path );
551 uint64_t stop_items =
items;
558 for (uint64_t i = 0 ; i < stop_items ; ++i) {
599 if (parent_dir > 0) {
614 sprintf( temp,
"%s/%s", path, item );
615 strcpy( item, temp );
618 VERBOSE(3,5,
"mdtest_stat %4s: %s", (dirs ?
"dir" :
"file"), item);
619 if (-1 == backend->
stat (item, &buf, ¶m)) {
620 FAIL(
"unable to stat %s %s", dirs ?
"directory" :
"file", item);
627 void mdtest_read(
int random,
int dirs,
const long dir_iter,
char *path) {
628 uint64_t parent_dir, item_num = 0;
632 VERBOSE(1,-1,
"Entering mdtest_read on %s", path );
638 FAIL(
"out of memory");
644 FAIL(
"out of memory");
650 uint64_t stop_items =
items;
657 for (uint64_t i = 0 ; i < stop_items ; ++i) {
694 if (parent_dir > 0) {
702 parent_dir = (
unsigned long long) ((parent_dir-1) /
branch_factor);
709 sprintf( temp,
"%s/%s", path, item );
710 strcpy( item, temp );
713 VERBOSE(3,5,
"mdtest_read file: %s", item);
717 aiori_fh = backend->
open (item, ¶m);
718 if (
NULL == aiori_fh) {
719 FAIL(
"unable to open file %s", item);
726 FAIL(
"unable to read file %s", item);
730 VERBOSE(2, -1,
"Error verifying %s", item);
737 backend->
close (aiori_fh, ¶m);
746 VERBOSE(1,-1,
"Entering collective_create_remove on %s", path );
749 for (
int i = 0 ; i < ntasks ; ++i) {
789 VERBOSE(3,5,
"collective_create_remove (create_remove_items): temp is '%s'", temp);
828 VERBOSE(1,-1,
"Entering directory_test on %s", path );
843 sprintf( temp_path,
"%s/%s",
testdir, path );
846 VERBOSE(3,-1,
"directory_test: create path is '%s'", temp_path );
873 sprintf( temp_path,
"%s/%s",
testdir, path );
876 VERBOSE(3,5,
"stat path is '%s'", temp_path );
899 sprintf( temp_path,
"%s/%s",
testdir, path );
902 VERBOSE(3,5,
"directory_test: read path is '%s'", temp_path );
925 sprintf( temp_path,
"%s/%s",
testdir, path );
928 VERBOSE(3,5,
"directory_test: remove directories path is '%s'", temp_path );
948 sprintf( temp_path,
"%s/%s",
testdir, path );
951 VERBOSE(3,5,
"directory_test: remove unique directories path is '%s'\n", temp_path );
960 summary_table[iteration].
rate[0] =
items*size/(t[1] - t[0]);
961 summary_table[iteration].
time[0] = t[1] - t[0];
966 summary_table[iteration].
rate[1] =
items*size/(t[2] - t[1]);
967 summary_table[iteration].
time[1] = t[2] - t[1];
972 summary_table[iteration].
rate[2] =
items*size/(t[3] - t[2]);
973 summary_table[iteration].
time[2] = t[3] - t[2];
978 summary_table[iteration].
rate[3] =
items*size/(t[4] - t[3]);
979 summary_table[iteration].
time[3] = t[4] - t[3];
984 VERBOSE(1,-1,
" Directory creation: %14.3f sec, %14.3f ops/sec", t[1] - t[0], summary_table[iteration].rate[0]);
985 VERBOSE(1,-1,
" Directory stat : %14.3f sec, %14.3f ops/sec", t[2] - t[1], summary_table[iteration].rate[1]);
989 VERBOSE(1,-1,
" Directory removal : %14.3f sec, %14.3f ops/sec", t[4] - t[3], summary_table[iteration].rate[3]);
996 long long unsigned max_iter = 0;
999 MPI_Allreduce(& progress->
items_done, & max_iter, 1, MPI_LONG_LONG_INT, MPI_MAX,
testComm);
1003 long long min_accessed = 0;
1004 MPI_Reduce(& progress->
items_done, & min_accessed, 1, MPI_LONG_LONG_INT, MPI_MIN, 0,
testComm);
1005 long long sum_accessed = 0;
1006 MPI_Reduce(& progress->
items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0,
testComm);
1010 if(
items != (sum_accessed / size)){
1011 VERBOSE(0,-1,
"Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((
double) sum_accessed) / size);
1026 VERBOSE(3,5,
"Entering file_test on %s", path);
1038 VERBOSE(5,5,
"operating on %s", temp_path);
1043 sprintf( temp_path,
"%s/%s",
testdir, path );
1048 VERBOSE(3,-1,
"file_test: create path is '%s'", temp_path );
1080 int64_t expected_items;
1083 if(expected_items >= 0){
1084 items = expected_items;
1088 if(expected_items == -1){
1089 fprintf(
out_logfile,
"WARNING: could not read stonewall status file\n");
1110 sprintf( temp_path,
"%s/%s",
testdir, path );
1113 VERBOSE(3,5,
"file_test: stat path is '%s'", temp_path );
1133 sprintf( temp_path,
"%s/%s",
testdir, path );
1136 VERBOSE(3,5,
"file_test: read path is '%s'", temp_path );
1161 sprintf( temp_path,
"%s/%s",
testdir, path );
1164 VERBOSE(3,5,
"file_test: rm directories path is '%s'", temp_path );
1171 VERBOSE(3,5,
"gonna create %s", temp_path);
1183 strcpy( temp_path, path );
1186 VERBOSE(3,5,
"file_test: rm unique directories path is '%s'", temp_path );
1199 summary_table[iteration].
rate[4] =
items*size/(t[1] - t[0]);
1200 summary_table[iteration].
time[4] = t[1] - t[0];
1205 summary_table[iteration].
rate[5] =
items*size/(t[2] - t[1]);
1206 summary_table[iteration].
time[5] = t[2] - t[1];
1211 summary_table[iteration].
rate[6] =
items*size/(t[3] - t[2]);
1212 summary_table[iteration].
time[6] = t[3] - t[2];
1217 summary_table[iteration].
rate[7] =
items*size/(t[4] - t[3]);
1218 summary_table[iteration].
time[7] = t[4] - t[3];
1223 VERBOSE(1,-1,
" File creation : %14.3f sec, %14.3f ops/sec", t[1] - t[0], summary_table[iteration].rate[4]);
1225 VERBOSE(1,-1,
" File creation (stonewall): %14.3f sec, %14.3f ops/sec", summary_table[iteration].stonewall_time[MDTEST_FILE_CREATE_NUM], summary_table[iteration].stonewall_item_sum[MDTEST_FILE_CREATE_NUM]);
1227 VERBOSE(1,-1,
" File stat : %14.3f sec, %14.3f ops/sec", t[2] - t[1], summary_table[iteration].rate[5]);
1228 VERBOSE(1,-1,
" File read : %14.3f sec, %14.3f ops/sec", t[3] - t[2], summary_table[iteration].rate[6]);
1229 VERBOSE(1,-1,
" File removal : %14.3f sec, %14.3f ops/sec", t[4] - t[3], summary_table[iteration].rate[7]);
1234 return iter * tableSize *
size + rank * tableSize + op;
1241 double min, max, mean, sd, sum = 0, var = 0, curr = 0;
1243 double all[iterations *
size * tableSize];
1246 VERBOSE(1,-1,
"Entering summarize_results..." );
1249 for(
int i=0; i < iterations; i++){
1251 MPI_Gather(& summary_table[i].time[0], tableSize, MPI_DOUBLE, & all[i*tableSize*
size], tableSize, MPI_DOUBLE, 0,
testComm);
1253 MPI_Gather(& summary_table[i].rate[0], tableSize, MPI_DOUBLE, & all[i*tableSize*
size], tableSize, MPI_DOUBLE, 0,
testComm);
1261 VERBOSE(0,-1,
"\nSUMMARY %s: (of %d iterations)", print_time ?
"time":
"rate", iterations);
1262 VERBOSE(0,-1,
" Operation Max Min Mean Std Dev");
1263 VERBOSE(0,-1,
" --------- --- --- ---- -------");
1284 for (i = start; i < stop; i++) {
1286 for (k=0; k <
size; k++) {
1287 for (j = 0; j < iterations; j++) {
1298 mean = sum / (iterations *
size);
1299 for (k=0; k<
size; k++) {
1300 for (j = 0; j < iterations; j++) {
1304 var = var / (iterations *
size);
1307 case 0: strcpy(access,
"Directory creation :");
break;
1308 case 1: strcpy(access,
"Directory stat :");
break;
1311 case 3: strcpy(access,
"Directory removal :");
break;
1312 case 4: strcpy(access,
"File creation :");
break;
1313 case 5: strcpy(access,
"File stat :");
break;
1314 case 6: strcpy(access,
"File read :");
break;
1315 case 7: strcpy(access,
"File removal :");
break;
1316 default: strcpy(access,
"ERR");
break;
1331 double stonewall_time = 0;
1332 uint64_t stonewall_items = 0;
1333 for(
int i=0; i < iterations; i++){
1339 if(stonewall_items != 0){
1340 fprintf(
out_logfile,
" File create (stonewall) : ");
1341 fprintf(
out_logfile,
"%14s %14s %14.3f %14s\n",
"NA",
"NA", print_time ? stonewall_time : stonewall_items / stonewall_time,
"NA");
1345 for (i = 8; i < tableSize; i++) {
1347 for (j = 0; j < iterations; j++) {
1349 curr = summary_table[j].
time[i];
1351 curr = summary_table[j].
rate[i];
1362 mean = sum / (iterations);
1363 for (j = 0; j < iterations; j++) {
1365 curr = summary_table[j].
time[i];
1367 curr = summary_table[j].
rate[i];
1370 var += pow((mean - curr), 2);
1372 var = var / (iterations);
1375 case 8: strcpy(access,
"Tree creation :");
break;
1376 case 9: strcpy(access,
"Tree removal :");
break;
1377 default: strcpy(access,
"ERR");
break;
1393 FAIL(
"Error, stone wall timer does only work with a branch factor <= 1 (current is %d) and with barriers\n",
branch_factor);
1398 VERBOSE(1,-1,
"main: Setting create/stat/read/remove_only to True" );
1401 VERBOSE(1,-1,
"Entering valid_tests..." );
1419 FAIL(
"Possible race conditions will occur: -B not compatible with -N");
1424 FAIL(
"-c not compatible with -S");
1427 FAIL(
"-c not compatible with multiple test directories");
1430 FAIL(
"-c not compatible with -B");
1435 FAIL(
"-u not compatible with -S");
1440 FAIL(
"cannot have multiple directory paths with -N strides between neighbor tasks");
1445 FAIL(
"shared directory mode is not compatible with multiple directory paths");
1450 FAIL(
"cannot have more directory paths than MPI tasks");
1455 FAIL(
"depth must be greater than or equal to zero");
1458 if (branch_factor < 1 && depth > 0) {
1459 FAIL(
"branch factor must be greater than or equal to zero");
1464 FAIL(
"only specify the number of items or the number of items per directory");
1466 FAIL(
"items must be a multiple of items per directory");
1468 FAIL(
"items + items_per_dir can only be set without stonewalling");
1473 FAIL(
"-k not compatible with -w");
1481 int64_t file_system_unit_val = 1024 * 1024 * 1024;
1482 int64_t inode_unit_val = 1024 * 1024;
1483 int64_t total_file_system_size,
1484 free_file_system_size,
1487 double total_file_system_size_hr,
1488 used_file_system_percentage,
1489 used_inode_percentage;
1493 VERBOSE(1,-1,
"Entering show_file_system_size on %s", file_system );
1495 ret = backend->
statfs (file_system, &stat_buf, ¶m);
1497 FAIL(
"unable to stat file system %s", file_system);
1503 used_file_system_percentage = (1 - ((double)free_file_system_size
1504 / (
double)total_file_system_size)) * 100;
1505 total_file_system_size_hr = (double)total_file_system_size
1506 / (
double)file_system_unit_val;
1507 if (total_file_system_size_hr > 1024) {
1508 total_file_system_size_hr = total_file_system_size_hr / 1024;
1509 strcpy(file_system_unit_str,
"TiB");
1513 total_inodes = stat_buf.
f_files;
1514 free_inodes = stat_buf.
f_ffree;
1516 used_inode_percentage = (1 - ((double)free_inodes/(
double)total_inodes))
1519 if (realpath(file_system, real_path) ==
NULL) {
1520 WARN(
"unable to use realpath() on file system");
1525 VERBOSE(0,-1,
"Path: %s", real_path);
1526 VERBOSE(0,-1,
"FS: %.1f %s Used FS: %2.1f%% Inodes: %.1f %s Used Inodes: %2.1f%%\n",
1527 total_file_system_size_hr, file_system_unit_str, used_file_system_percentage,
1528 (
double)total_inodes / (
double)inode_unit_val, inode_unit_str, used_inode_percentage);
1537 int directoryFound = 0;
1540 VERBOSE(3,5,
"Entering display_freespace on %s...", testdirpath );
1542 strcpy(dirpath, testdirpath);
1545 i = strlen(dirpath);
1547 if (dirpath[i] ==
'/') {
1555 if (directoryFound == 0) {
1556 strcpy(dirpath,
".");
1559 if (param.
api && strcasecmp(param.
api,
"DFS") == 0)
1562 VERBOSE(3,5,
"Before show_file_system_size, dirpath is '%s'", dirpath );
1564 VERBOSE(3,5,
"After show_file_system_size, dirpath is '%s'\n", dirpath );
1576 VERBOSE(1,5,
"Entering create_remove_directory_tree on %s, currDepth = %d...", path, currDepth );
1578 if (currDepth == 0) {
1582 VERBOSE(2,5,
"Making directory '%s'", dir);
1584 fprintf(
out_logfile,
"error could not create directory '%s'\n", dir);
1586 #ifdef HAVE_LUSTRE_LUSTREAPI 1588 if (global_dir_layout && \
1589 llapi_dir_set_default_lmv_stripe(dir, -1, 0,
1590 LMV_HASH_TYPE_FNV_1A_64,
1592 FAIL(
"Unable to reset to global default directory layout");
1600 VERBOSE(2,5,
"Remove directory '%s'", dir);
1601 if (-1 == backend->
rmdir(dir, ¶m)) {
1602 FAIL(
"Unable to remove directory %s", dir);
1605 }
else if (currDepth <=
depth) {
1608 strcpy(temp_path, path);
1609 int currDir = dirNum;
1613 strcat(temp_path, dir);
1616 VERBOSE(2,5,
"Making directory '%s'", temp_path);
1617 if (-1 == backend->
mkdir(temp_path,
DIRMODE, ¶m)) {
1618 FAIL(
"Unable to create directory %s", temp_path);
1623 temp_path, (branch_factor*currDir)+1, progress);
1627 VERBOSE(2,5,
"Remove directory '%s'", temp_path);
1628 if (-1 == backend->
rmdir(temp_path, ¶m)) {
1629 FAIL(
"Unable to remove directory %s", temp_path);
1633 strcpy(temp_path, path);
1641 memset(& progress_o, 0 ,
sizeof(progress_o));
1648 double startCreate, endCreate;
1651 VERBOSE(1,-1,
"main: * iteration %d *", j+1);
1656 VERBOSE(2,5,
"main (for j loop): making testdir, '%s'",
testdir );
1659 FAIL(
"Unable to create test directory %s",
testdir);
1661 #ifdef HAVE_LUSTRE_LUSTREAPI 1664 FAIL(
"Unable to reset to global default directory layout");
1684 for (k=0; k<
size; k++) {
1687 VERBOSE(3,5,
"main (create hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'",
testdir );
1699 VERBOSE(3,5,
"main (create hierarchical directory loop-!collective_creates): Calling create_remove_directory_tree with '%s'",
testdir );
1708 VERBOSE(3,5,
"main (create hierarchical directory loop-!unque_dir_per_task): Calling create_remove_directory_tree with '%s'",
testdir );
1720 summary_table->
rate[8] =
1722 summary_table->
time[8] = (endCreate - startCreate);
1725 VERBOSE(1,-1,
"V-1: main: Tree creation : %14.3f sec, %14.3f ops/sec", (endCreate - startCreate), summary_table->
rate[8]);
1790 for (k=0; k<
size; k++) {
1793 VERBOSE(3,-1,
"main (remove hierarchical directory loop-collective): Calling create_remove_directory_tree with '%s'",
testdir );
1806 VERBOSE(3,-1,
"main (remove hierarchical directory loop-!collective): Calling create_remove_directory_tree with '%s'",
testdir );
1816 VERBOSE(3,-1,
"V-3: main (remove hierarchical directory loop-!unique_dir_per_task): Calling create_remove_directory_tree with '%s'",
testdir );
1830 summary_table->
time[9] = endCreate - startCreate;
1833 VERBOSE(1,-1,
"main Tree removal : %14.3f sec, %14.3f ops/sec", (endCreate - startCreate), summary_table->
rate[9]);
1834 VERBOSE(2,-1,
"main (at end of for j loop): Removing testdir of '%s'\n",
testdir );
1846 summary_table->
rate[9] = 0;
1885 #ifdef HAVE_LUSTRE_LUSTREAPI 1886 global_dir_layout = 0;
1900 int numTasksOnNode0 = 0;
1901 MPI_Group worldgroup, testgroup;
1906 } range = {0, 0, 1};
1913 int no_barriers = 0;
1914 char * path =
"./out";
1917 char APIs_legacy[1024];
1920 sprintf(apiStr,
"API for I/O [%s]", APIs);
1935 #ifdef HAVE_LUSTRE_LUSTREAPI 1936 {
'g',
NULL,
"global default directory layout for test subdirectories (deletes inherited striping layout)",
OPTION_FLAG,
'd', & global_dir_layout},
1947 {
'R',
NULL,
"random access to files (only for stat)",
OPTION_FLAG,
'd', & randomize},
1961 {
'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', &
call_sync},
1970 free(global_options->
modules);
1971 free(global_options);
1986 char cmd_buffer[4096];
1987 strncpy(cmd_buffer, argv[0], 4096);
1988 for (i = 1; i < argc; i++) {
1989 snprintf(&cmd_buffer[strlen(cmd_buffer)], 4096-strlen(cmd_buffer),
" '%s'", argv[i]);
1994 VERBOSE(0,-1,
"Command line used: %s", cmd_buffer);
2001 if( randomize > 0 ){
2022 VERBOSE(1,-1,
"dirpath(s):" );
2029 VERBOSE(1,-1,
"first : %d", first );
2031 #ifdef HAVE_LUSTRE_LUSTREAPI 2032 VERBOSE(1,-1,
"global_dir_layout : %s", ( global_dir_layout ?
"True" :
"False" ));
2034 VERBOSE(1,-1,
"iterations : %d", iterations );
2036 VERBOSE(1,-1,
"last : %d", last );
2043 VERBOSE(1,-1,
"stride : %d", stride );
2099 for (s=0; s <
items; s++) {
2116 uint64_t k = ( uint64_t ) (((
double )rand() / ( double )RAND_MAX ) * ( double )n );
2133 FAIL(
"out of memory");
2139 if (path_count == 0) {
2164 if ( numNodes > 1 && tasksBlockMapping ) {
2181 perror(
"gethostname");
2193 for(
int i=0; i < iterations; i++){
2195 summary_table[i].
rate[j] = 0.0;
2196 summary_table[i].
time[j] = 0.0;
2200 if (summary_table ==
NULL) {
2201 FAIL(
"out of memory");
2211 strcpy(
mk_name,
"mdtest.shared.");
2214 strcpy(
rm_name,
"mdtest.shared.");
2216 MPI_Comm_group(
testComm, &worldgroup);
2219 for (i = first; i <= last && i <=
size; i += stride) {
2221 MPI_Group_range_incl(worldgroup, 1, (
void *)&range, &testgroup);
2224 uint64_t items_all = i *
items;
2229 VERBOSE(0,-1,
"%d tasks, "LLU" files/directories", i, items_all);
2232 VERBOSE(0,-1,
"%d tasks, "LLU" files", i, items_all);
2235 VERBOSE(0,-1,
"%d tasks, 1 file", i);
2238 VERBOSE(0,-1,
"%d tasks, "LLU" directories", i, items_all);
2242 VERBOSE(1,-1,
" Operation Duration Rate");
2243 VERBOSE(1,-1,
" --------- -------- ----");
2245 for (j = 0; j < iterations; j++) {
2255 if (i == 1 && stride > 1) {
2261 VERBOSE(0, -1,
"\nERROR: verifying the data read! Take the performance values with care!\n");
uint64_t stonewall_item_sum[MDTEST_LAST_NUM]
static char testdir[MAX_PATHLEN]
static int verification_error
double rate[MDTEST_LAST_NUM]
static char unique_rm_dir[MAX_PATHLEN]
#define VERBOSE(root, any,...)
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 char * verify_read_buffer
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)
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
uint64_t stonewall_item_min[MDTEST_LAST_NUM]
void parse_dirpath(char *dirpath_arg)
static int collective_creates
int QueryNodeMapping(MPI_Comm comm, int print_nodemap)
void offset_timers(double *t, int tcount)
void summarize_results(int iterations, int print_time)
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 *)
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)
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 int print_rate_and_time
static char base_tree_name[MAX_PATHLEN]
static option_help options[]
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 updateParsedOptions(IOR_param_t *options, options_all_t *global_options)
int GetNumNodes(MPI_Comm comm)
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)
options_all_t * airoi_create_all_module_options(option_help *global_options)
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)
void aiori_supported_apis(char *APIs, char *APIs_legacy, enum bench_type type)
int(* mkdir)(const char *path, mode_t mode, IOR_param_t *param)
void generate_memory_pattern(char *buffer, size_t bytes)
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 options_all_t * global_options
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
static char mk_name[MAX_PATHLEN]
double stonewall_time[MDTEST_LAST_NUM]
const struct ior_aiori * backend
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(* sync)(IOR_param_t *)
void unique_dir_access(int opt, char *to)
int GetNumTasksOnNode0(MPI_Comm comm)
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 *)
static uint64_t * rand_array