@@ -66,7 +66,7 @@ static char **ParseFileName(char *, int *);
66
66
static void InitTests (IOR_test_t * );
67
67
static void TestIoSys (IOR_test_t * );
68
68
static void ValidateTests (IOR_param_t * params , MPI_Comm com );
69
- static IOR_offset_t WriteOrRead (IOR_param_t * test , IOR_results_t * results ,
69
+ static IOR_offset_t WriteOrRead (IOR_param_t * test , int rep , IOR_results_t * results ,
70
70
aiori_fd_t * fd , const int access ,
71
71
IOR_io_buffers * ioBuffers );
72
72
@@ -1267,7 +1267,7 @@ static void TestIoSys(IOR_test_t *test)
1267
1267
CurrentTimeString ());
1268
1268
}
1269
1269
timer [IOR_TIMER_RDWR_START ] = GetTimeStamp ();
1270
- dataMoved = WriteOrRead (params , & results [rep ], fd , WRITE , & ioBuffers );
1270
+ dataMoved = WriteOrRead (params , rep , & results [rep ], fd , WRITE , & ioBuffers );
1271
1271
if (params -> verbose >= VERBOSE_4 ) {
1272
1272
fprintf (out_logfile , "* data moved = %llu\n" , dataMoved );
1273
1273
fflush (out_logfile );
@@ -1318,7 +1318,7 @@ static void TestIoSys(IOR_test_t *test)
1318
1318
params -> open = WRITECHECK ;
1319
1319
fd = backend -> open (testFileName , IOR_RDONLY , params -> backend_options );
1320
1320
if (fd == NULL ) FAIL ("Cannot open file" );
1321
- dataMoved = WriteOrRead (params , & results [rep ], fd , WRITECHECK , & ioBuffers );
1321
+ dataMoved = WriteOrRead (params , rep , & results [rep ], fd , WRITECHECK , & ioBuffers );
1322
1322
backend -> close (fd , params -> backend_options );
1323
1323
rankOffset = 0 ;
1324
1324
}
@@ -1397,7 +1397,7 @@ static void TestIoSys(IOR_test_t *test)
1397
1397
CurrentTimeString ());
1398
1398
}
1399
1399
timer [IOR_TIMER_RDWR_START ] = GetTimeStamp ();
1400
- dataMoved = WriteOrRead (params , & results [rep ], fd , operation_flag , & ioBuffers );
1400
+ dataMoved = WriteOrRead (params , rep , & results [rep ], fd , operation_flag , & ioBuffers );
1401
1401
timer [IOR_TIMER_RDWR_STOP ] = GetTimeStamp ();
1402
1402
if (params -> intraTestBarriers )
1403
1403
MPI_CHECK (MPI_Barrier (testComm ),
@@ -1647,15 +1647,17 @@ IOR_offset_t *GetOffsetArrayRandom(IOR_param_t * test, int pretendRank, IOR_offs
1647
1647
return (offsetArray );
1648
1648
}
1649
1649
1650
- static IOR_offset_t WriteOrReadSingle (IOR_offset_t offset , int pretendRank , IOR_offset_t transfer , int * errors , IOR_param_t * test , aiori_fd_t * fd , IOR_io_buffers * ioBuffers , int access ){
1650
+ static IOR_offset_t WriteOrReadSingle (IOR_offset_t offset , int pretendRank , IOR_offset_t transfer , int * errors , IOR_param_t * test , aiori_fd_t * fd , IOR_io_buffers * ioBuffers , int access , OpTimer * ot , double startTime ){
1651
1651
IOR_offset_t amtXferred = 0 ;
1652
1652
1653
1653
void * buffer = ioBuffers -> buffer ;
1654
1654
if (access == WRITE ) {
1655
1655
/* fills each transfer with a unique pattern
1656
1656
* containing the offset into the file */
1657
1657
update_write_memory_pattern (offset , ioBuffers -> buffer , transfer , test -> setTimeStampSignature , pretendRank , test -> dataPacketType , test -> gpuMemoryFlags );
1658
+ double start = GetTimeStamp ();
1658
1659
amtXferred = backend -> xfer (access , fd , buffer , transfer , offset , test -> backend_options );
1660
+ if (ot ) OpTimerValue (ot , start - startTime , GetTimeStamp () - start );
1659
1661
if (amtXferred != transfer )
1660
1662
ERR ("cannot write to file" );
1661
1663
if (test -> fsyncPerWrite )
@@ -1665,7 +1667,9 @@ static IOR_offset_t WriteOrReadSingle(IOR_offset_t offset, int pretendRank, IOR_
1665
1667
nanosleep ( & wait , NULL );
1666
1668
}
1667
1669
} else if (access == READ ) {
1670
+ double start = GetTimeStamp ();
1668
1671
amtXferred = backend -> xfer (access , fd , buffer , transfer , offset , test -> backend_options );
1672
+ if (ot ) OpTimerValue (ot , start - startTime , GetTimeStamp () - start );
1669
1673
if (amtXferred != transfer )
1670
1674
ERR ("cannot read from file" );
1671
1675
if (test -> interIODelay > 0 ){
@@ -1674,13 +1678,17 @@ static IOR_offset_t WriteOrReadSingle(IOR_offset_t offset, int pretendRank, IOR_
1674
1678
}
1675
1679
} else if (access == WRITECHECK ) {
1676
1680
invalidate_buffer_pattern (buffer , transfer , test -> gpuMemoryFlags );
1681
+ double start = GetTimeStamp ();
1677
1682
amtXferred = backend -> xfer (access , fd , buffer , transfer , offset , test -> backend_options );
1683
+ if (ot ) OpTimerValue (ot , start - startTime , GetTimeStamp () - start );
1678
1684
if (amtXferred != transfer )
1679
1685
ERR ("cannot read from file write check" );
1680
1686
* errors += CompareData (buffer , transfer , test , offset , pretendRank , WRITECHECK );
1681
1687
} else if (access == READCHECK ) {
1682
1688
invalidate_buffer_pattern (buffer , transfer , test -> gpuMemoryFlags );
1689
+ double start = GetTimeStamp ();
1683
1690
amtXferred = backend -> xfer (access , fd , buffer , transfer , offset , test -> backend_options );
1691
+ if (ot ) OpTimerValue (ot , start - startTime , GetTimeStamp () - start );
1684
1692
if (amtXferred != transfer ){
1685
1693
ERR ("cannot read from file" );
1686
1694
}
@@ -1703,7 +1711,7 @@ static void prefillSegment(IOR_param_t *test, void * randomPrefillBuffer, int pr
1703
1711
} else {
1704
1712
offset += (i * test -> numTasks * test -> blockSize ) + (pretendRank * test -> blockSize );
1705
1713
}
1706
- WriteOrReadSingle (offset , pretendRank , test -> randomPrefillBlocksize , & errors , test , fd , ioBuffers , WRITE );
1714
+ WriteOrReadSingle (offset , pretendRank , test -> randomPrefillBlocksize , & errors , test , fd , ioBuffers , WRITE , NULL , 0 );
1707
1715
}
1708
1716
}
1709
1717
ioBuffers -> buffer = oldBuffer ;
@@ -1713,7 +1721,7 @@ static void prefillSegment(IOR_param_t *test, void * randomPrefillBuffer, int pr
1713
1721
* Write or Read data to file(s). This loops through the strides, writing
1714
1722
* out the data to each block in transfer sizes, until the remainder left is 0.
1715
1723
*/
1716
- static IOR_offset_t WriteOrRead (IOR_param_t * test , IOR_results_t * results ,
1724
+ static IOR_offset_t WriteOrRead (IOR_param_t * test , int rep , IOR_results_t * results ,
1717
1725
aiori_fd_t * fd , const int access , IOR_io_buffers * ioBuffers )
1718
1726
{
1719
1727
int errors = 0 ;
@@ -1746,7 +1754,14 @@ static IOR_offset_t WriteOrRead(IOR_param_t *test, IOR_results_t *results,
1746
1754
memset (randomPrefillBuffer , -1 , test -> randomPrefillBlocksize );
1747
1755
}
1748
1756
1749
- // start timer after random offset was generated
1757
+ /* Per operation statistics */
1758
+ OpTimer * ot = NULL ;
1759
+ if (test -> savePerOpDataCSV != NULL ) {
1760
+ char fname [FILENAME_MAX ];
1761
+ sprintf (fname , "%s-%d-%05d.csv" , test -> savePerOpDataCSV , rep , rank );
1762
+ ot = OpTimerInit (fname );
1763
+ }
1764
+ // start timer after random offset was generated
1750
1765
startForStonewall = GetTimeStamp ();
1751
1766
hitStonewall = 0 ;
1752
1767
@@ -1787,7 +1802,7 @@ static IOR_offset_t WriteOrRead(IOR_param_t *test, IOR_results_t *results,
1787
1802
offset += (i * test -> numTasks * test -> blockSize ) + (pretendRank * test -> blockSize );
1788
1803
}
1789
1804
}
1790
- dataMoved += WriteOrReadSingle (offset , pretendRank , test -> transferSize , & errors , test , fd , ioBuffers , access );
1805
+ dataMoved += WriteOrReadSingle (offset , pretendRank , test -> transferSize , & errors , test , fd , ioBuffers , access , ot , startForStonewall );
1791
1806
pairCnt ++ ;
1792
1807
1793
1808
hitStonewall = ((test -> deadlineForStonewalling != 0
@@ -1850,7 +1865,7 @@ static IOR_offset_t WriteOrRead(IOR_param_t *test, IOR_results_t *results,
1850
1865
offset += (i * test -> numTasks * test -> blockSize ) + (pretendRank * test -> blockSize );
1851
1866
}
1852
1867
}
1853
- dataMoved += WriteOrReadSingle (offset , pretendRank , test -> transferSize , & errors , test , fd , ioBuffers , access );
1868
+ dataMoved += WriteOrReadSingle (offset , pretendRank , test -> transferSize , & errors , test , fd , ioBuffers , access , ot , startForStonewall );
1854
1869
pairCnt ++ ;
1855
1870
}
1856
1871
j = 0 ;
@@ -1860,6 +1875,7 @@ static IOR_offset_t WriteOrRead(IOR_param_t *test, IOR_results_t *results,
1860
1875
point -> pairs_accessed = pairCnt ;
1861
1876
}
1862
1877
1878
+ OpTimerFree (ot );
1863
1879
totalErrorCount += CountErrors (test , access , errors );
1864
1880
1865
1881
if (access == WRITE && test -> fsync == TRUE) {
0 commit comments