mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r5220]
Purpose: Bug Fix Description: Users could not trace MPI programs when library wasn't compiled for parallel execution Solution: Allow Pablo Trace library to set the processor number and generate the filenames for each processor. Platforms tested: Sun Workstation, HP VClass, Irix 64
This commit is contained in:
parent
e5fc40662c
commit
b60521774f
@ -164,7 +164,7 @@ PABLO_CLEAN=HDFentryNames.h HDFidList.h ProcMasks.h HDFentries.txt \
|
||||
|
||||
HDFentries.txt: $(top_srcdir)/src/*.c
|
||||
grep "FUNC_ENTER[_INIT ]*(" $(top_srcdir)/src/*.c | \
|
||||
sed "s/.*FUNC_ENTER[_INIT ]*(//;s/[,)].*//" | sort -u > $@
|
||||
sed "s/.*FUNC_ENTER[_INIT ]*( *//;s/[,)].*//" | sort -u > $@
|
||||
|
||||
HDFentryNames.h: HDFentries.txt
|
||||
sed "s/.*/\"&\",/" $? > $@
|
||||
|
@ -151,12 +151,12 @@ void endHDFtraceEvent (int , int , char *, int );
|
||||
void hdfCaptureInit( const char* name, int captureType );
|
||||
void hdfCaptureEnd( void );
|
||||
#else
|
||||
void HDFinitTrace_RT ( const char *, int );
|
||||
void HDFinitTrace_SDDF ( const char *, int );
|
||||
void HDFinitTrace_RT ( const char * );
|
||||
void HDFinitTrace_SDDF ( const char * );
|
||||
void hinittracex_ ( char [], int *, int[], int *,unsigned * );
|
||||
void hdfendtrace_ ( void ) ;
|
||||
void HDFendTrace_RT (int);
|
||||
void HDFendTrace_SDDF(int);
|
||||
void HDFendTrace_RT (void );
|
||||
void HDFendTrace_SDDF( void );
|
||||
void HDFfinalTimeStamp( void );
|
||||
void HDFtraceEvent_RT ( int , HDFsetInfo *, unsigned );
|
||||
void HDFtraceIOEvent( int , void *, unsigned );
|
||||
@ -246,13 +246,13 @@ hinittracex_( char *file,
|
||||
if ( OUTPUT_SWITCH == RUNTIME_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_RUNTIME_TRACE )
|
||||
{
|
||||
HDFinitTrace_SDDF( traceFileName, OUTPUT_SWITCH );
|
||||
HDFinitTrace_SDDF( traceFileName );
|
||||
IOtracingEnabled = 1;
|
||||
}
|
||||
else if ( OUTPUT_SWITCH == SUMMARY_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_SUMMARY_TRACE )
|
||||
{
|
||||
HDFinitTrace_RT( traceFileName, OUTPUT_SWITCH );
|
||||
HDFinitTrace_RT( traceFileName );
|
||||
IOtracingEnabled = 1;
|
||||
}
|
||||
else if ( OUTPUT_SWITCH == NO_TRACE )
|
||||
@ -328,13 +328,13 @@ HDFinitTrace( const char *traceFileName, int id_flag, ... )
|
||||
if ( OUTPUT_SWITCH == RUNTIME_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_RUNTIME_TRACE )
|
||||
{
|
||||
HDFinitTrace_SDDF( traceFileName, OUTPUT_SWITCH );
|
||||
HDFinitTrace_SDDF( traceFileName );
|
||||
IOtracingEnabled = 1;
|
||||
}
|
||||
else if ( OUTPUT_SWITCH == SUMMARY_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_SUMMARY_TRACE )
|
||||
{
|
||||
HDFinitTrace_RT( traceFileName, OUTPUT_SWITCH );
|
||||
HDFinitTrace_RT( traceFileName );
|
||||
IOtracingEnabled = 1;
|
||||
}
|
||||
else if ( OUTPUT_SWITCH == NO_TRACE )
|
||||
@ -370,14 +370,14 @@ void HDFendTrace(void)
|
||||
hdfCaptureEnd();
|
||||
#else
|
||||
if ( OUTPUT_SWITCH == RUNTIME_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_RUNTIME_TRACE )
|
||||
|| OUTPUT_SWITCH == MPI_RUNTIME_TRACE )
|
||||
{
|
||||
HDFendTrace_SDDF( OUTPUT_SWITCH );
|
||||
HDFendTrace_SDDF( );
|
||||
}
|
||||
else if ( OUTPUT_SWITCH == SUMMARY_TRACE
|
||||
|| OUTPUT_SWITCH == MPI_SUMMARY_TRACE )
|
||||
|| OUTPUT_SWITCH == MPI_SUMMARY_TRACE )
|
||||
{
|
||||
HDFendTrace_RT( OUTPUT_SWITCH );
|
||||
HDFendTrace_RT();
|
||||
}
|
||||
#endif /* PCF_BUILD */
|
||||
}
|
||||
@ -773,7 +773,6 @@ HDFtraceREAD( int fd, void *buf, size_t nbyte )
|
||||
#else
|
||||
struct read_write_args readArgs;
|
||||
int bytes;
|
||||
CLOCK t1, t2, incDur;
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -784,10 +783,7 @@ HDFtraceREAD( int fd, void *buf, size_t nbyte )
|
||||
HDFtraceIOEvent( readBeginID, (void *) &readArgs, sizeof(readArgs) );
|
||||
}
|
||||
|
||||
t1 = getClock();
|
||||
ret = read( fd, buf, nbyte );
|
||||
t2 = getClock();
|
||||
incDur = clockSubtract(t2,t1);
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -826,7 +822,6 @@ HDFtraceFREAD( void *ptr, size_t size, size_t nitems, FILE *stream )
|
||||
struct read_write_args readArgs;
|
||||
int nbytes;
|
||||
int fd = fileno( stream );
|
||||
CLOCK t1, t2, incDur;
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -836,10 +831,7 @@ HDFtraceFREAD( void *ptr, size_t size, size_t nitems, FILE *stream )
|
||||
HDFtraceIOEvent( freadBeginID, (void *) &readArgs, sizeof(readArgs) );
|
||||
}
|
||||
|
||||
t1 = getClock();
|
||||
ret = fread( ptr, size, nitems, stream );
|
||||
t2 = getClock();
|
||||
incDur = clockSubtract(t2,t1);
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -1039,7 +1031,6 @@ HDFtraceWRITE( int fd, const void *buf, size_t nbyte )
|
||||
#else
|
||||
struct read_write_args writeArgs;
|
||||
int bytes;
|
||||
CLOCK t1, t2, incDur;
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -1050,10 +1041,7 @@ HDFtraceWRITE( int fd, const void *buf, size_t nbyte )
|
||||
HDFtraceIOEvent( writeBeginID, (void *) &writeArgs, sizeof(writeArgs) );
|
||||
}
|
||||
|
||||
t1 = getClock();
|
||||
ret = write( fd, buf, nbyte );
|
||||
t2 = getClock();
|
||||
incDur = clockSubtract(t2,t1);
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -1092,7 +1080,6 @@ HDFtraceFWRITE(const void *ptr,size_t size,size_t nitems,FILE *stream )
|
||||
struct read_write_args writeArgs;
|
||||
int nbytes;
|
||||
int fd = fileno( stream );
|
||||
CLOCK t1, t2, incDur;
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
@ -1103,10 +1090,7 @@ HDFtraceFWRITE(const void *ptr,size_t size,size_t nitems,FILE *stream )
|
||||
HDFtraceIOEvent(fwriteBeginID, (void *)&writeArgs, sizeof(writeArgs));
|
||||
}
|
||||
|
||||
t1 = getClock();
|
||||
ret = fwrite( ptr, size, nitems, stream );
|
||||
t2 = getClock();
|
||||
incDur = clockSubtract(t2,t1);
|
||||
|
||||
if ( IOtracingEnabled )
|
||||
{
|
||||
|
@ -821,10 +821,10 @@ PabloMPI_File_open( MPI_Comm comm,
|
||||
struct mpiOpenBeginArgs mpiOpenBeginArguments;
|
||||
struct mpiOpenEndArgs mpiOpenEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "PabloMPI_File_open\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
MPI_Comm_rank( comm, &HDFlocalNode );
|
||||
MPI_Comm_rank( MPI_COMM_WORLD, &HDFmyNode );
|
||||
@ -864,10 +864,10 @@ PabloMPI_File_close( MPI_File *fh )
|
||||
struct mpiCloseBeginArgs mpiCloseBeginArguments;
|
||||
struct mpiCloseEndArgs mpiCloseEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_close\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiCloseBeginArguments.localNode = HDFlocalNode;
|
||||
mpiCloseBeginArguments.globalNode = HDFmyNode;
|
||||
@ -900,10 +900,10 @@ PabloMPI_File_set_size( MPI_File fh, MPI_Offset size )
|
||||
struct mpiSetSizeBeginArgs mpiSetSizeBeginArguments;
|
||||
struct mpiSetSizeEndArgs mpiSetSizeEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_set_size\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiSetSizeBeginArguments.localNode = HDFlocalNode;
|
||||
mpiSetSizeBeginArguments.globalNode = HDFmyNode;
|
||||
@ -939,10 +939,10 @@ PabloMPI_File_get_size( MPI_File fh, MPI_Offset *size )
|
||||
struct mpiGetSizeBeginArgs mpiGetSizeBeginArguments;
|
||||
struct mpiGetSizeEndArgs mpiGetSizeEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_get_size\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiGetSizeBeginArguments.localNode = HDFlocalNode;
|
||||
mpiGetSizeBeginArguments.globalNode = HDFmyNode;
|
||||
@ -984,10 +984,10 @@ PabloMPI_File_set_view( MPI_File fh,
|
||||
struct mpiSetViewBeginArgs mpiSetViewBeginArguments;
|
||||
struct mpiSetViewEndArgs mpiSetViewEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_set_view\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiSetViewBeginArguments.localNode = HDFlocalNode;
|
||||
mpiSetViewBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1036,10 +1036,10 @@ PabloMPI_File_get_view( MPI_File fh,
|
||||
struct mpiGetViewBeginArgs mpiGetViewBeginArguments;
|
||||
struct mpiGetViewEndArgs mpiGetViewEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_get_view\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiGetViewBeginArguments.localNode = HDFlocalNode;
|
||||
mpiGetViewBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1083,10 +1083,10 @@ PabloMPI_File_read_at( MPI_File fh,
|
||||
struct mpiReadAtBeginArgs mpiReadAtBeginArguments;
|
||||
struct mpiReadAtEndArgs mpiReadAtEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_read_at\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiReadAtBeginArguments.localNode = HDFlocalNode;
|
||||
mpiReadAtBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1143,10 +1143,10 @@ PabloMPI_File_read_at_all( MPI_File fh,
|
||||
struct mpiReadAtAllBeginArgs mpiReadAtAllBeginArguments;
|
||||
struct mpiReadAtAllEndArgs mpiReadAtAllEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_read_at_all\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiReadAtAllBeginArguments.localNode = HDFlocalNode;
|
||||
mpiReadAtAllBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1208,10 +1208,10 @@ PabloMPI_File_write_at( MPI_File fh,
|
||||
struct mpiWriteAtBeginArgs mpiWriteAtBeginArguments;
|
||||
struct mpiWriteAtEndArgs mpiWriteAtEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_write_at\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiWriteAtBeginArguments.localNode = HDFlocalNode;
|
||||
mpiWriteAtBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1266,10 +1266,10 @@ PabloMPI_File_write_at_all( MPI_File fh,
|
||||
struct mpiWriteAtAllBeginArgs mpiWriteAtAllBeginArguments;
|
||||
struct mpiWriteAtAllEndArgs mpiWriteAtAllEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_write_at\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiWriteAtAllBeginArguments.localNode = HDFlocalNode;
|
||||
mpiWriteAtAllBeginArguments.globalNode = HDFmyNode;
|
||||
@ -1326,10 +1326,10 @@ PabloMPI_File_sync( MPI_File fh )
|
||||
struct mpiSyncBeginArgs mpiSyncBeginArguments;
|
||||
struct mpiSyncEndArgs mpiSyncEndArguments;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "MPI_File_sync\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
|
||||
mpiSyncBeginArguments.localNode = HDFlocalNode;
|
||||
mpiSyncBeginArguments.globalNode = HDFmyNode;
|
||||
|
@ -143,7 +143,7 @@
|
||||
|
||||
#include "HDFrecord_RT.h"
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#ifdef H5_HAVE_MPIOTRACE
|
||||
#include "mpi.h"
|
||||
#include "MPIO_EventArgs.h"
|
||||
#endif
|
||||
@ -184,7 +184,7 @@ fileRec_t *HDFfileList;
|
||||
// Internal Function prototypes *
|
||||
//======================================================================*/
|
||||
void HDFinitTrace_RT( char *, int );
|
||||
void HDFendTrace_RT( int );
|
||||
void HDFendTrace_RT();
|
||||
int initproctracert_( void );
|
||||
int initHDFProcTrace_RT( void );
|
||||
void HDFtraceEvent_RT( int , char *, unsigned ) ;
|
||||
@ -223,51 +223,32 @@ extern char HDFprocNames[][40];
|
||||
// NAME *
|
||||
// HDFinitTrace_RT-- initialize HDF real-time tracing *
|
||||
// USAGE *
|
||||
// VOID HDFinitTrace_RT( fileName, OUTSW ) *
|
||||
// VOID HDFinitTrace_RT( fileName ) *
|
||||
// *
|
||||
// char *fileName; IN: name of output file *
|
||||
// int OUTSW ; IN: Type of tracing *
|
||||
// RETURNS *
|
||||
// None. *
|
||||
//======================================================================*/
|
||||
void HDFinitTrace_RT( char *fileName, int OUTSW )
|
||||
{
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
int myNode;
|
||||
#endif
|
||||
int error;
|
||||
TRgetClock( &epoch );
|
||||
error = initHDFProcTrace_RT() ;
|
||||
if ( error != SUCCESS ) {
|
||||
fprintf (stderr,"Unable to Initialize properly. Exiting program\n");
|
||||
exit(-1);
|
||||
}
|
||||
FileName = ( char * ) malloc ( strlen( fileName ) + 10 );
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/*==============================================================*
|
||||
// Here the library was built to linked with the MPI and MPIO *
|
||||
// libraries. However, the use may chose not to run with MPI. *
|
||||
// A check is made to see if MPI has been initialized. If so, *
|
||||
// a trace file is assigned to the current node with the number *
|
||||
// of the node as a suffix; if not, only one file is opened *
|
||||
// and it is not given a suffix. *
|
||||
//==============================================================*/
|
||||
if ( OUTSW == MPI_SUMMARY_TRACE ) {
|
||||
MPI_Comm_rank( MPI_COMM_WORLD, &myNode );
|
||||
setTraceProcessorNumber( myNode );
|
||||
sprintf(FileName,"%s.nd%d",fileName,myNode);
|
||||
} else {
|
||||
strcpy( FileName, fileName ) ;
|
||||
}
|
||||
#else
|
||||
/*==============================================================*
|
||||
case, set the trace file name and *
|
||||
// initialize the trace library. *
|
||||
//==============================================================*/
|
||||
strcpy( FileName, fileName ) ;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
setTraceFileName(FileName);
|
||||
basicLibraryInit( );
|
||||
int error;
|
||||
TRgetClock( &epoch );
|
||||
error = initHDFProcTrace_RT() ;
|
||||
if ( error != SUCCESS )
|
||||
{
|
||||
fprintf (stderr,"Unable to Initialize properly. Exiting program\n");
|
||||
exit(-1);
|
||||
}
|
||||
FileName = ( char * ) malloc ( strlen( fileName ) + 10 );
|
||||
/*===================================================================*
|
||||
// Here the library was built to linked with the MPI and MPIO *
|
||||
// libraries. However, the use may chose not to run with MPI. *
|
||||
// A check is made to see if MPI has been initialized. If so, *
|
||||
// a trace file is assigned to the current node with the number *
|
||||
// of the node as a suffix; if not, only one file is opened *
|
||||
// and it is not given a suffix. *
|
||||
//===================================================================*/
|
||||
IOtraceInit( fileName, OUTSW );
|
||||
}
|
||||
/*======================================================================*
|
||||
// NAME *
|
||||
@ -277,37 +258,37 @@ void HDFinitTrace_RT( char *fileName, int OUTSW )
|
||||
// RETURNS *
|
||||
// None. *
|
||||
//======================================================================*/
|
||||
void HDFendTrace_RT( int OUTSW )
|
||||
void HDFendTrace_RT( )
|
||||
{
|
||||
int j, numSetIDs;
|
||||
HDFnode_t *P;
|
||||
char **Names;
|
||||
int j, numSetIDs;
|
||||
HDFnode_t *P;
|
||||
char **Names;
|
||||
|
||||
HDFfinalTimeStamp();
|
||||
/*==============================================================*
|
||||
// Assing pablo ids to named identifiers and tag records *
|
||||
//==============================================================*/
|
||||
HDFassignPabloIDs( &numSetIDs, &Names );
|
||||
/*==============================================================*
|
||||
// Create a file name for the File map file. *
|
||||
// Disable for now. *
|
||||
//==============================================================*/
|
||||
HDFfinalTimeStamp();
|
||||
/*===================================================================*
|
||||
// Assing pablo ids to named identifiers and tag records *
|
||||
//===================================================================*/
|
||||
HDFassignPabloIDs( &numSetIDs, &Names );
|
||||
/*===================================================================*
|
||||
// Create a file name for the File map file. *
|
||||
// Disable for now. *
|
||||
//===================================================================*/
|
||||
/* mapFile = (char *)malloc( strlen(FileName) + 4 );
|
||||
strcpy(mapFile,FileName);
|
||||
strcat(mapFile,".map"); */
|
||||
/*==============================================================*
|
||||
// print the file mappings. *
|
||||
//==============================================================*/
|
||||
strcpy(mapFile,FileName);
|
||||
strcat(mapFile,".map"); */
|
||||
/*===================================================================*
|
||||
// print the file mappings. *
|
||||
//===================================================================*/
|
||||
/* printFileMappingsRT( mapFile, Names, numSetIDs ); */
|
||||
/*==============================================================*
|
||||
// Print SDDF summary records *
|
||||
//==============================================================*/
|
||||
writeHDFRecDescrptrsRT();
|
||||
writeHDFNamePacketsRT( Names, numSetIDs );
|
||||
/*===================================================================*
|
||||
// Print SDDF summary records *
|
||||
//===================================================================*/
|
||||
writeHDFRecDescrptrsRT();
|
||||
writeHDFNamePacketsRT( Names, numSetIDs );
|
||||
for ( j = 0; j < NumHDFProcs; ++j ) {
|
||||
HDFSummarySDDF( HDFQueues[j], j );
|
||||
}
|
||||
endTracing();
|
||||
HDFSummarySDDF( HDFQueues[j], j );
|
||||
}
|
||||
endTracing();
|
||||
}
|
||||
/*======================================================================*
|
||||
// initHFDProcTrace_RT *
|
||||
@ -318,71 +299,80 @@ void HDFendTrace_RT( int OUTSW )
|
||||
int initproctracert_( void )
|
||||
|
||||
{
|
||||
return initHDFProcTrace_RT();
|
||||
return initHDFProcTrace_RT();
|
||||
}
|
||||
|
||||
int initHDFProcTrace_RT( void )
|
||||
|
||||
{
|
||||
int i, j, size;
|
||||
int numProcs = NumHDFProcs;
|
||||
int i;
|
||||
int j;
|
||||
int size;
|
||||
int numProcs = NumHDFProcs;
|
||||
|
||||
if ( traceProcessorNumber == -1 ) {
|
||||
traceProcessorNumber = TRgetDefaultProcessor();
|
||||
}
|
||||
/*==============================================================*
|
||||
// Initialize InitNode used for node initialization. *
|
||||
//==============================================================*/
|
||||
InitNode.ptr = NULL;
|
||||
InitNode.eventID = 0;
|
||||
InitNode.lastIOtime = zeroClock;
|
||||
InitNode.record.nCalls = 0;
|
||||
InitNode.record.lastCall = zeroClock;
|
||||
InitNode.record.incDur = zeroClock;
|
||||
InitNode.record.excDur = zeroClock;
|
||||
InitNode.record.hdfID = 0;
|
||||
InitNode.record.xRef = 0;
|
||||
for ( j = 0; j < nTallyFields; ++j ) {
|
||||
if ( traceProcessorNumber == -1 )
|
||||
{
|
||||
traceProcessorNumber = TRgetDefaultProcessor();
|
||||
}
|
||||
/*===================================================================*
|
||||
// Initialize InitNode used for node initialization. *
|
||||
//===================================================================*/
|
||||
InitNode.ptr = NULL;
|
||||
InitNode.eventID = 0;
|
||||
InitNode.lastIOtime = zeroClock;
|
||||
InitNode.record.nCalls = 0;
|
||||
InitNode.record.lastCall = zeroClock;
|
||||
InitNode.record.incDur = zeroClock;
|
||||
InitNode.record.excDur = zeroClock;
|
||||
InitNode.record.hdfID = 0;
|
||||
InitNode.record.xRef = 0;
|
||||
for ( j = 0; j < nTallyFields; ++j )
|
||||
{
|
||||
InitNode.record.times[j] = zeroClock;
|
||||
}
|
||||
for ( j = 0; j < nTallyFields; ++j ) {
|
||||
}
|
||||
for ( j = 0; j < nTallyFields; ++j )
|
||||
{
|
||||
InitNode.record.counts[j] = 0;
|
||||
}
|
||||
for ( j = 0; j < nByteFields; ++j ) {
|
||||
}
|
||||
for ( j = 0; j < nByteFields; ++j )
|
||||
{
|
||||
InitNode.record.bytes[j] = 0;
|
||||
}
|
||||
for ( i = 0; i < nByteFields; ++i ) {
|
||||
for ( j = 0; j < nBkts; ++j ) {
|
||||
InitNode.record.Hists[i][j] = 0;
|
||||
}
|
||||
}
|
||||
/*==============================================================*
|
||||
// initialize linked list used to keep track of named hdf *
|
||||
// identifiers. *
|
||||
//==============================================================*/
|
||||
HDFfileList = NULL;
|
||||
/*==============================================================*
|
||||
// Allocate a one dimensional array of pointers to queues of *
|
||||
// HDFnodes. There is one queue for each thread and one for *
|
||||
// each HDF procedure. Each queue will be a list of summary *
|
||||
// records distinquished by file type and *
|
||||
//==============================================================*/
|
||||
size = (int)(numProcs*sizeof( HDFnode_t * ));
|
||||
HDFQueues = (HDFnode_t **)malloc( size );
|
||||
if ( HDFQueues == NULL ) {
|
||||
fprintf(stderr,"Failed to allocate HDFQueues in initHDFProcTrace\n");
|
||||
return FAILURE;
|
||||
}
|
||||
for ( j = 0; j < numProcs; ++j ) {
|
||||
HDFQueues[j] = NULL;
|
||||
}
|
||||
/*==============================================================*
|
||||
// Initialize call stack to a dummy node and TagQueue to NULL *
|
||||
//==============================================================*/
|
||||
CallStack = (HDFnode_t *)malloc( sizeof(HDFnode_t) );
|
||||
*CallStack = InitNode;
|
||||
TagQueue = NULL ;
|
||||
return SUCCESS;
|
||||
}
|
||||
for ( i = 0; i < nByteFields; ++i )
|
||||
{
|
||||
for ( j = 0; j < nBkts; ++j )
|
||||
{
|
||||
InitNode.record.Hists[i][j] = 0;
|
||||
}
|
||||
}
|
||||
/*===================================================================*
|
||||
// initialize linked list used to keep track of named hdf *
|
||||
// identifiers. *
|
||||
//===================================================================*/
|
||||
HDFfileList = NULL;
|
||||
/*===================================================================*
|
||||
// Allocate a one dimensional array of pointers to queues of *
|
||||
// HDFnodes. There is one queue for each thread and one for *
|
||||
// each HDF procedure. Each queue will be a list of summary *
|
||||
// records distinquished by file type and *
|
||||
//===================================================================*/
|
||||
size = (int)(numProcs*sizeof( HDFnode_t * ));
|
||||
HDFQueues = (HDFnode_t **)malloc( size );
|
||||
if ( HDFQueues == NULL )
|
||||
{
|
||||
fprintf(stderr,"Failed to allocate HDFQueues in initHDFProcTrace\n");
|
||||
return FAILURE;
|
||||
}
|
||||
for ( j = 0; j < numProcs; ++j )
|
||||
{
|
||||
HDFQueues[j] = NULL;
|
||||
}
|
||||
/*===================================================================*
|
||||
// Initialize call stack to a dummy node and TagQueue to NULL *
|
||||
//===================================================================*/
|
||||
CallStack = (HDFnode_t *)malloc( sizeof(HDFnode_t) );
|
||||
*CallStack = InitNode;
|
||||
TagQueue = NULL ;
|
||||
return SUCCESS;
|
||||
}
|
||||
/*======================================================================*
|
||||
// This is called from the HDF and I/O routines when real-time summary *
|
||||
@ -411,7 +401,7 @@ void HDFtraceEvent_RT( int eventType, char *dataPtr, unsigned dataLen )
|
||||
else if ( isEndHDFEvent( eventType ) )
|
||||
{
|
||||
EndHDFEventRecord ( seconds, dataPtr );
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#ifdef H5_HAVE_MPIOTRACE
|
||||
}
|
||||
else if ( isBeginMPIOEvent( eventType ) )
|
||||
{
|
||||
@ -420,7 +410,7 @@ void HDFtraceEvent_RT( int eventType, char *dataPtr, unsigned dataLen )
|
||||
else if ( isEndMPIOEvent( eventType ) )
|
||||
{
|
||||
EndMPIOEventRecord ( eventType, seconds, dataPtr, dataLen );
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
#endif /* H5_HAVE_MPIOTRACE */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -529,7 +519,7 @@ void EndIOEventRecord ( int eventType, CLOCK secs, void *dataPtr )
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#ifdef H5_HAVE_MPIOTRACE
|
||||
/*======================================================================*
|
||||
// BeginMPIOEventRecord: *
|
||||
// This routine simply records the time in the record on the top of *
|
||||
@ -542,18 +532,18 @@ void BeginMPIOEventRecord( int eventType,
|
||||
{
|
||||
HDFsetInfo *dataPtr;
|
||||
dataPtr = (HDFsetInfo *)data;
|
||||
/*==============================================================*
|
||||
// save the time value temporarily in top of stack *
|
||||
// When the end record is received, the duration can be *
|
||||
// computed. *
|
||||
//==============================================================*/
|
||||
/*===================================================================*
|
||||
// save the time value temporarily in top of stack *
|
||||
// When the end record is received, the duration can be *
|
||||
// computed. *
|
||||
//===================================================================*/
|
||||
CallStack->lastIOtime = seconds;
|
||||
/*==============================================================*
|
||||
// get useful info from the structure pointed to by dataPtr. *
|
||||
cases, this is the file ID. For mpiOpen, it is the *
|
||||
/*===================================================================*
|
||||
// get useful info from the structure pointed to by dataPtr. *
|
||||
// Form most cases, this is the file ID. For mpiOpen, it is the *
|
||||
// name of the file. For mpiDelete, no information is of any *
|
||||
// use. *
|
||||
//==============================================================*/
|
||||
//===================================================================*/
|
||||
if ( dataLen == 0 ) return;
|
||||
CallStack->record.hdfID = dataPtr->setID;
|
||||
switch ( eventType )
|
||||
@ -766,7 +756,7 @@ void EndMPIOEventRecord ( int eventType,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
#endif /* H5_HAVE_MPIOTRACE */
|
||||
/*======================================================================*
|
||||
// BeginHDFEventRecord: *
|
||||
// This function puts a trace record on the stack corresponding to *
|
||||
@ -1087,17 +1077,18 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex )
|
||||
char buff[1024];
|
||||
char *Packet;
|
||||
HDFnode_t *Q;
|
||||
struct {
|
||||
int packetLen,
|
||||
packetType,
|
||||
packetTag,
|
||||
eventID;
|
||||
double Seconds,
|
||||
IncDur,
|
||||
ExcDur;
|
||||
long HDFid,
|
||||
XREFid;
|
||||
} Header;
|
||||
struct
|
||||
{
|
||||
int packetLen;
|
||||
int packetType;
|
||||
int packetTag;
|
||||
int eventID;
|
||||
double Seconds;
|
||||
double IncDur;
|
||||
double ExcDur;
|
||||
long HDFid;
|
||||
long XREFid;
|
||||
} Header;
|
||||
|
||||
Header.packetLen = sizeof(Header)
|
||||
+ sizeof(int) /* n Calls */
|
||||
@ -1109,8 +1100,7 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex )
|
||||
+ nByteFields*sizeof(int) /* bytes array */
|
||||
+ nHistFields*sizeof(int) /* array lens */
|
||||
+ nHistFields*nBkts*sizeof(int) /* byte hist */
|
||||
+ sizeof(int) /* nodeID */
|
||||
+ sizeof(int) ; /* Name len */
|
||||
+ sizeof(int); /* nodeID */
|
||||
Header.packetTag = HDF_SUMMARY_FAMILY +
|
||||
( procIndex + 1 )*8 + RECORD_TRACE ;
|
||||
Header.packetType = PKT_DATA;
|
||||
@ -1186,7 +1176,8 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex )
|
||||
// copy length of historgram arrays and arrays to Packet. *
|
||||
//===========================================================*/
|
||||
arrayLen = nBkts;
|
||||
for ( i = 0; i < nByteFields; ++i ) {
|
||||
for ( i = 0; i < nHistFields; ++i )
|
||||
{
|
||||
memcpy( Packet, &arrayLen, sizeof(int) );
|
||||
Packet += sizeof(int);
|
||||
memcpy( Packet, P->record.Hists[i], nBkts*sizeof(int) );
|
||||
@ -1194,9 +1185,9 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex )
|
||||
}
|
||||
memcpy( Packet, &nodeID, sizeof(int) );
|
||||
Packet += sizeof(int);
|
||||
arrayLen = 0; /* name length */
|
||||
memcpy( Packet, &arrayLen, sizeof(int) );
|
||||
putBytes( buff, Header.packetLen );
|
||||
arrayLen = Packet-buff;
|
||||
memcpy(buff,&arrayLen,sizeof(int));
|
||||
putBytes( buff, Packet-buff );
|
||||
P = Q;
|
||||
}
|
||||
}
|
||||
@ -1205,7 +1196,7 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex )
|
||||
//======================================================================*/
|
||||
void HDFnodeInit ( HDFnode_t *S )
|
||||
{
|
||||
*S = InitNode;
|
||||
*S = InitNode;
|
||||
}
|
||||
/*======================================================================*
|
||||
// Compute IO totals, exclusive durations of the input record T *
|
||||
@ -1213,27 +1204,34 @@ void HDFnodeInit ( HDFnode_t *S )
|
||||
//======================================================================*/
|
||||
void HDFrecordSum ( HDFrec_t *S, HDFrec_t *T )
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
S->nCalls += T->nCalls;
|
||||
if ( clockCompare ( S->lastCall, T->lastCall ) < 0 ) {
|
||||
S->lastCall = T->lastCall ;
|
||||
}
|
||||
S->incDur = clockAdd ( S->incDur, T->incDur );
|
||||
for ( j = 0; j < nTallyFields; ++j ) {
|
||||
S->times[j] = clockAdd( S->times[j] , T->times[j] ) ;
|
||||
}
|
||||
for ( j = 0; j < nTallyFields; ++j ) {
|
||||
S->counts[j] += T->counts[j] ;
|
||||
}
|
||||
for ( j = 0; j < nByteFields; ++j ) {
|
||||
S->bytes[j] += T->bytes[j] ;
|
||||
}
|
||||
for ( j = 0; j < nHistFields; ++j ) {
|
||||
for ( i = 0; i < nBkts; ++i ) {
|
||||
S->Hists[j][i] += T->Hists[j][i] ;
|
||||
}
|
||||
}
|
||||
S->nCalls += T->nCalls;
|
||||
if ( clockCompare ( S->lastCall, T->lastCall ) < 0 )
|
||||
{
|
||||
S->lastCall = T->lastCall ;
|
||||
}
|
||||
S->incDur = clockAdd ( S->incDur, T->incDur );
|
||||
for ( j = 0; j < nTallyFields; ++j )
|
||||
{
|
||||
S->times[j] = clockAdd( S->times[j] , T->times[j] ) ;
|
||||
}
|
||||
for ( j = 0; j < nTallyFields; ++j )
|
||||
{
|
||||
S->counts[j] += T->counts[j] ;
|
||||
}
|
||||
for ( j = 0; j < nByteFields; ++j )
|
||||
{
|
||||
S->bytes[j] += T->bytes[j] ;
|
||||
}
|
||||
for ( j = 0; j < nHistFields; ++j )
|
||||
{
|
||||
for ( i = 0; i < nBkts; ++i )
|
||||
{
|
||||
S->Hists[j][i] += T->Hists[j][i] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*======================================================================*
|
||||
// Return the field index corresponding to an IO event ID. The fields *
|
||||
@ -1498,7 +1496,7 @@ void _hdfDescriptorRT( char *recordName, char *recordDescription,
|
||||
/*==================================================================*
|
||||
// The record field count *
|
||||
//==================================================================*/
|
||||
sddfWriteInteger( &hdfRecordPointer, 17 );
|
||||
sddfWriteInteger( &hdfRecordPointer, 16 );
|
||||
WRITE_HDF_FIELD( "Event Identifier",
|
||||
"Event ID",
|
||||
"Corresponding Event",
|
||||
@ -1563,10 +1561,6 @@ void _hdfDescriptorRT( char *recordName, char *recordDescription,
|
||||
"Node",
|
||||
"Processor number",
|
||||
INTEGER, 0 );
|
||||
WRITE_HDF_FIELD( "HDF Name",
|
||||
"HDF Name",
|
||||
"Name of File,Data Set or Dim accessed",
|
||||
CHARACTER, 1 );
|
||||
/*===================================================================
|
||||
// The entire record descriptor packet has been written. *
|
||||
// Compute and update the record length. *
|
||||
@ -1586,17 +1580,6 @@ void _hdfDescriptorRT( char *recordName, char *recordDescription,
|
||||
//======================================================================*/
|
||||
void writeHDFRecDescrptrsRT( void )
|
||||
{
|
||||
/*
|
||||
char HDFprocNames[][40] = {
|
||||
"noName",
|
||||
"noName",
|
||||
"noName",
|
||||
"noName",
|
||||
"noName",
|
||||
# include "HDFentryNames.h"
|
||||
"HDF_Last_Entry"
|
||||
};
|
||||
*/
|
||||
int j, FAMILY;
|
||||
char BUF1[256], BUF2[256] ;
|
||||
_hdfNameDescriptor(); /* Descriptor for named identifiers */
|
||||
@ -1646,10 +1629,10 @@ void _hdfNameDescriptor( void )
|
||||
static char recordBuffer[ 4096 ];
|
||||
int recordLength;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef PABLODEBUG
|
||||
fprintf( debugFile, "_hdfExitTraceDescriptor entered\n" );
|
||||
fflush( debugFile );
|
||||
#endif /* DEBUG */
|
||||
#endif /* PABLODEBUG */
|
||||
hdfRecordPointer = recordBuffer;
|
||||
/********************************************************************/
|
||||
/* Allow space at the beginning of the record for the packet */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -99,7 +99,7 @@ LAST_TRACE_TYPE=MPI_SUMMARY_TRACE,
|
||||
NUM_HDF_IDS
|
||||
} ;
|
||||
|
||||
#define SUPPRESS_MPIO_TRACE 2
|
||||
#define SUPPRESS_MPIO_TRACE 6
|
||||
#define ID_HDF_Last_Entry ID_ALLHDF
|
||||
|
||||
void HDFinitTrace( const char *, int trace_id, ... );
|
||||
|
Loading…
Reference in New Issue
Block a user