Commit 6b66e0ed authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Get rid of legacy timers.

parent 1041ac80
...@@ -29,13 +29,6 @@ long initial_buffersize = 16 * 1024 * 1024; ...@@ -29,13 +29,6 @@ long initial_buffersize = 16 * 1024 * 1024;
/* 16 * 1024; */ /* 16 * 1024; */
/* 4 * 1024; */ /* 4 * 1024; */
double accumProbe = 0.0;
double accumRecv = 0.0;
double accumSend = 0.0;
double accumSuspend = 0.0;
double accumWait = 0.0;
double accumWrite = 0.0;
char *token = "%"; char *token = "%";
/***************************************************************/ /***************************************************************/
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
extern long initial_buffersize; extern long initial_buffersize;
extern double accumWait;
typedef struct typedef struct
{ {
size_t size; size_t size;
...@@ -86,7 +84,6 @@ destroyAFiledataMPINONB(void *v) ...@@ -86,7 +84,6 @@ destroyAFiledataMPINONB(void *v)
aFiledataM *of; aFiledataM *of;
MPI_Status status; MPI_Status status;
int rankNode = commInqRankNode (); int rankNode = commInqRankNode ();
double startTime;
MPI_Offset endpos; MPI_Offset endpos;
of = (aFiledataM * ) v; of = (aFiledataM * ) v;
...@@ -95,11 +92,8 @@ destroyAFiledataMPINONB(void *v) ...@@ -95,11 +92,8 @@ destroyAFiledataMPINONB(void *v)
rankNode, of->fileID, of->name ); rankNode, of->fileID, of->name );
/* close file */ /* close file */
xmpi(MPI_Wait(&of->request, &status));
startTime = MPI_Wtime ();
xmpi ( MPI_Wait ( & ( of->request ), &status ));
xmpi(MPI_Barrier(commInqCommNode())); xmpi(MPI_Barrier(commInqCommNode()));
accumWait += ( MPI_Wtime () - startTime );
xmpi(MPI_File_get_position_shared(of->fh, &endpos)); xmpi(MPI_File_get_position_shared(of->fh, &endpos));
xmpi(MPI_File_set_size(of->fh, endpos)); xmpi(MPI_File_set_size(of->fh, endpos));
iret = MPI_File_close ( & ( of->fh )); iret = MPI_File_close ( & ( of->fh ));
...@@ -224,7 +218,6 @@ int fcMPINONB ( int fileID ) ...@@ -224,7 +218,6 @@ int fcMPINONB ( int fileID )
{ {
aFiledataM *of; aFiledataM *of;
int iret; int iret;
double accumWaitMax;
MPI_Comm commNode = commInqCommNode (); MPI_Comm commNode = commInqCommNode ();
int rankNode = commInqRankNode (); int rankNode = commInqRankNode ();
...@@ -237,21 +230,7 @@ int fcMPINONB ( int fileID ) ...@@ -237,21 +230,7 @@ int fcMPINONB ( int fileID )
writeMPINONB(of); writeMPINONB(of);
/* remove file element */ /* remove file element */
iret = listSetRemove(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID); int iret = listSetRemove(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
/* timer output */
if ( ddebug == MAXDEBUG )
{
xmpi ( MPI_Reduce ( &accumWait, &accumWaitMax,
1, MPI_DOUBLE, MPI_MAX, 0, commNode ));
xdebug ( "IOPE%d: Wait time %15.10lf s",
rankNode, accumWait );
if ( rankNode == 0 )
xdebug ( "IOPE%d: Max wait time %15.10lf s",
rankNode, accumWaitMax );
}
return iret; return iret;
} }
......
...@@ -31,9 +31,6 @@ extern char * command2charP[6]; ...@@ -31,9 +31,6 @@ extern char * command2charP[6];
extern char *token; extern char *token;
extern double accumSuspend;
extern double accumWrite;
typedef struct typedef struct
{ {
...@@ -105,7 +102,6 @@ destroyBFiledataPA ( void *v ) ...@@ -105,7 +102,6 @@ destroyBFiledataPA ( void *v )
ssize_t ssiret; ssize_t ssiret;
int nextFinishOp = (bfd->nextOpIndex - bfd->prefIndex + nPrefStreams) int nextFinishOp = (bfd->nextOpIndex - bfd->prefIndex + nPrefStreams)
% nPrefStreams; % nPrefStreams;
double startTime;
xdebug ( "filename=%s, cleanup and close file", bfd->name ); xdebug ( "filename=%s, cleanup and close file", bfd->name );
...@@ -115,10 +111,6 @@ destroyBFiledataPA ( void *v ) ...@@ -115,10 +111,6 @@ destroyBFiledataPA ( void *v )
{ {
xdebug("file: %s, prefIndex=%d", bfd->name, (int)bfd->prefIndex); xdebug("file: %s, prefIndex=%d", bfd->name, (int)bfd->prefIndex);
ccBP[0] = ( bfd->ctrlBlks + nextFinishOp ); ccBP[0] = ( bfd->ctrlBlks + nextFinishOp );
if ( ddebug )
startTime = MPI_Wtime ();
do do
{ {
iret = aio_suspend ( ccBP, 1, NULL ); iret = aio_suspend ( ccBP, 1, NULL );
...@@ -126,9 +118,6 @@ destroyBFiledataPA ( void *v ) ...@@ -126,9 +118,6 @@ destroyBFiledataPA ( void *v )
} }
while ( iret != 0 ); while ( iret != 0 );
if ( ddebug )
accumSuspend += ( MPI_Wtime () - startTime);
iret = aio_error(bfd->ctrlBlks + nextFinishOp); iret = aio_error(bfd->ctrlBlks + nextFinishOp);
if (( ssiret = aio_return ( bfd->ctrlBlks + nextFinishOp )) == -1 ) if (( ssiret = aio_return ( bfd->ctrlBlks + nextFinishOp )) == -1 )
xabort("aio_return () failed: %s", strerror(iret)); xabort("aio_return () failed: %s", strerror(iret));
...@@ -170,7 +159,6 @@ writePA(bFiledataPA *bfd, size_t amount) ...@@ -170,7 +159,6 @@ writePA(bFiledataPA *bfd, size_t amount)
{ {
const struct aiocb *ccBP[1]; const struct aiocb *ccBP[1];
ssize_t iret; ssize_t iret;
double startTime;
xdebug ( "file %s, in", bfd->name ); xdebug ( "file %s, in", bfd->name );
...@@ -181,12 +169,8 @@ writePA(bFiledataPA *bfd, size_t amount) ...@@ -181,12 +169,8 @@ writePA(bFiledataPA *bfd, size_t amount)
bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes, bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
bfd->ctrlBlks[bfd->currOpIndex].aio_offset ); bfd->ctrlBlks[bfd->currOpIndex].aio_offset );
if ( ddebug ) startTime = MPI_Wtime ();
iret = aio_write ( bfd->ctrlBlks + bfd->currOpIndex ); iret = aio_write ( bfd->ctrlBlks + bfd->currOpIndex );
if ( ddebug ) accumWrite += ( MPI_Wtime () - startTime);
xdebug ( "after aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu," xdebug ( "after aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu,"
"iret=aio_write()=%d", "iret=aio_write()=%d",
bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes, bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
...@@ -205,10 +189,6 @@ writePA(bFiledataPA *bfd, size_t amount) ...@@ -205,10 +189,6 @@ writePA(bFiledataPA *bfd, size_t amount)
if ( bfd->prefIndex >= nPrefStreams ) if ( bfd->prefIndex >= nPrefStreams )
{ {
ccBP[0] = ( bfd->ctrlBlks + bfd->nextOpIndex ); ccBP[0] = ( bfd->ctrlBlks + bfd->nextOpIndex );
if ( ddebug )
startTime = MPI_Wtime ();
do do
{ {
iret = aio_suspend ( ccBP, 1, NULL ); iret = aio_suspend ( ccBP, 1, NULL );
...@@ -216,9 +196,6 @@ writePA(bFiledataPA *bfd, size_t amount) ...@@ -216,9 +196,6 @@ writePA(bFiledataPA *bfd, size_t amount)
xabort ( "aio_suspend () failed" ); xabort ( "aio_suspend () failed" );
} while ( iret != 0 ); } while ( iret != 0 );
if ( ddebug )
accumSuspend += ( MPI_Wtime () - startTime);
if (( iret = aio_return ( bfd->ctrlBlks + bfd->nextOpIndex )) == -1 ) if (( iret = aio_return ( bfd->ctrlBlks + bfd->nextOpIndex )) == -1 )
xabort ( "aio_return () failed" ); xabort ( "aio_return () failed" );
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "dmemory.h" #include "dmemory.h"
extern char *command2charP[]; extern char *command2charP[];
extern double accumWait;
extern char *token; extern char *token;
extern long initial_buffersize; extern long initial_buffersize;
...@@ -104,7 +103,6 @@ sendP(remoteFileBuf *afd, int id) ...@@ -104,7 +103,6 @@ sendP(remoteFileBuf *afd, int id)
int tag; int tag;
size_t amount; size_t amount;
MPI_Status status; MPI_Status status;
double startTime;
amount = dbuffer_data_size ( afd->db ); amount = dbuffer_data_size ( afd->db );
tag = encodeFileOpTag(id, afd->command); tag = encodeFileOpTag(id, afd->command);
...@@ -112,12 +110,8 @@ sendP(remoteFileBuf *afd, int id) ...@@ -112,12 +110,8 @@ sendP(remoteFileBuf *afd, int id)
xdebug("send buffer for %s, size: %zu bytes, command=%s, in", xdebug("send buffer for %s, size: %zu bytes, command=%s, in",
afd->name, amount, command2charP[afd->command]); afd->name, amount, command2charP[afd->command]);
if ( ddebug ) startTime = MPI_Wtime ();
xmpiStat(MPI_Wait(&(afd->request), &status), &status); xmpiStat(MPI_Wait(&(afd->request), &status), &status);
if ( ddebug ) accumWait += ( MPI_Wtime () - startTime );
/* FIXME: amount > INT_MAX unhandled */ /* FIXME: amount > INT_MAX unhandled */
xmpi(MPI_Issend(afd->db->buffer, (int)amount, MPI_UNSIGNED_CHAR, xmpi(MPI_Issend(afd->db->buffer, (int)amount, MPI_UNSIGNED_CHAR,
commInqSpecialRankNode(), tag, commInqCommNode(), commInqSpecialRankNode(), tag, commInqCommNode(),
...@@ -174,11 +168,8 @@ pioSendWrite(int id, int tsID, const void *buffer, size_t len) ...@@ -174,11 +168,8 @@ pioSendWrite(int id, int tsID, const void *buffer, size_t len)
flushOp(afd, tsID); flushOp(afd, tsID);
{ {
double startTime;
MPI_Status status; MPI_Status status;
if (ddebug) startTime = MPI_Wtime();
xmpiStat(MPI_Wait(&(afd->request), &status), &status); xmpiStat(MPI_Wait(&(afd->request), &status), &status);
if (ddebug) accumWait += MPI_Wtime() - startTime;
} }
xmpi(MPI_Barrier(commInqCommColl())); xmpi(MPI_Barrier(commInqCommColl()));
} }
...@@ -209,10 +200,7 @@ pioSendWrite(int id, int tsID, const void *buffer, size_t len) ...@@ -209,10 +200,7 @@ pioSendWrite(int id, int tsID, const void *buffer, size_t len)
int int
pioSendClose(int id) pioSendClose(int id)
{ {
double accumWaitMax;
remoteFileBuf *afd; remoteFileBuf *afd;
int iret;
xdebug ( "fileID %d: send buffer, close file and cleanup",id ); xdebug ( "fileID %d: send buffer, close file and cleanup",id );
afd = listSetGet(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id); afd = listSetGet(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id);
...@@ -226,18 +214,7 @@ pioSendClose(int id) ...@@ -226,18 +214,7 @@ pioSendClose(int id)
xmpi(MPI_Barrier(commInqCommColl())); xmpi(MPI_Barrier(commInqCommColl()));
/* remove file element */ /* remove file element */
iret = listSetRemove(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id); int iret = listSetRemove(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id);
/* timer output */
if ( ddebug )
{
enum { root = 0 };
xmpi(MPI_Reduce(&accumWait, &accumWaitMax,
1, MPI_DOUBLE, MPI_MAX, root, commInqCommColl()));
xdebug ( "Wait time %15.10lf s", accumWait );
if ( commInqRankColl () == root )
xdebug ( "Max wait time %15.10lf s", accumWaitMax );
}
return iret; return iret;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment