[svn-r865] Modifications required for 64 bit longs.

This commit is contained in:
Dan Wells 1998-11-03 14:48:54 -05:00
parent 3039dac9dc
commit 09a871339d
3 changed files with 30 additions and 33 deletions

View File

@ -836,8 +836,8 @@ int HDFtraceFPUTS( const char *s, FILE *stream )
void *HDFtraceMALLOC(size_t bytes ) void *HDFtraceMALLOC(size_t bytes )
{ {
void *ptr; void *ptr;
size_t byte_req; int byte_req;
byte_req = bytes; byte_req = (int)bytes;
if ( IOtracingEnabled ) { if ( IOtracingEnabled ) {
HDFtraceIOEvent ( ID_malloc, NULL, 0 ); HDFtraceIOEvent ( ID_malloc, NULL, 0 );
} }
@ -845,7 +845,7 @@ void *HDFtraceMALLOC(size_t bytes )
ptr = malloc( bytes ); ptr = malloc( bytes );
if ( IOtracingEnabled ) { if ( IOtracingEnabled ) {
HDFtraceIOEvent ( -ID_malloc, &byte_req, sizeof(size_t) ); HDFtraceIOEvent ( -ID_malloc, &byte_req, sizeof(int) );
} }
return ptr ; return ptr ;

View File

@ -188,7 +188,7 @@ int initproctracert_( void );
int initHDFProcTrace_RT( void ); int initHDFProcTrace_RT( void );
void HDFtraceEvent_RT( int , char *, unsigned ) ; void HDFtraceEvent_RT( int , char *, unsigned ) ;
void BeginIOEventRecord ( int, double , void * ); void BeginIOEventRecord ( int, double , void * );
void EndIOEventRecord ( int , double , void *); void EndIOEventRecord ( int , double , void * );
void BeginMPIOEventRecord ( int, double, void * ); void BeginMPIOEventRecord ( int, double, void * );
void EndMPIOEventRecord ( int , double , void *); void EndMPIOEventRecord ( int , double , void *);
void BeginHDFEventRecord( int , double ); void BeginHDFEventRecord( int , double );
@ -266,7 +266,7 @@ void HDFinitTrace_RT( char *fileName, unsigned procTraceMask )
// RETURNS * // RETURNS *
// None. * // None. *
//======================================================================*/ //======================================================================*/
void HDFendTrace_RT( ) void HDFendTrace_RT( void )
{ {
int j, numSetIDs; int j, numSetIDs;
HDFnode_t *P; HDFnode_t *P;
@ -367,7 +367,7 @@ int initHDFProcTrace_RT( void )
// each HDF procedure. Each queue will be a list of summary * // each HDF procedure. Each queue will be a list of summary *
// records distinquished by file type and * // records distinquished by file type and *
//==============================================================*/ //==============================================================*/
size = numProcs*sizeof( HDFnode_t * ); size = (int)(numProcs*sizeof( HDFnode_t * ));
HDFQueues = (HDFnode_t **)malloc( size ); HDFQueues = (HDFnode_t **)malloc( size );
if ( HDFQueues == NULL ) { if ( HDFQueues == NULL ) {
fprintf(stderr,"Failed to allocate HDFQueues in initHDFProcTrace\n"); fprintf(stderr,"Failed to allocate HDFQueues in initHDFProcTrace\n");
@ -415,7 +415,7 @@ void HDFtraceEvent_RT( int eventType, char *dataPtr, unsigned dataLen )
EndMPIOEventRecord ( eventType, seconds, dataPtr ); EndMPIOEventRecord ( eventType, seconds, dataPtr );
#endif /* HAVE_PARALLEL */ #endif /* HAVE_PARALLEL */
} else { } else {
fprintf(stderr,"eventType %d, dataLen = %d\n",eventType,dataLen); fprintf(stderr,"eventType %d, dataLen = %u\n",eventType,dataLen);
} }
TRunlock( criticalSection ); TRunlock( criticalSection );
} }
@ -498,7 +498,7 @@ void EndIOEventRecord ( int eventType, double secs, void *dataPtr )
case fopenEndID: case fopenEndID:
case openEndID: case openEndID:
openInfo.setName = openName; openInfo.setName = openName;
openInfo.setID = *((long *)dataPtr); openInfo.setID = (int)(*((long *)dataPtr));
CallStack->record.hdfID = openInfo.setID; CallStack->record.hdfID = openInfo.setID;
HDFrecordFileName ( &openInfo ); HDFrecordFileName ( &openInfo );
break; break;
@ -707,11 +707,6 @@ void EndHDFEventRecord ( int eventID, double seconds, void *dataPtr )
HDFnode_t *HDFrec; HDFnode_t *HDFrec;
double incSecs; double incSecs;
static int dummyIDs = -4; static int dummyIDs = -4;
int procIndex;
/*==============================================================*
// Find the procIndex in the table. *
//==============================================================*/
procIndex = ProcIndexForHDFExit( eventID );
/*==============================================================* /*==============================================================*
// pop record from top of the stack, compute inclusive duration * // pop record from top of the stack, compute inclusive duration *
// and set the corresponding record field and increment nCalls. * // and set the corresponding record field and increment nCalls. *
@ -798,7 +793,8 @@ void HDFassignPabloIDs( int *nSetIDs, char ***Names )
{ {
fileRec_t *F, *G; fileRec_t *F, *G;
HDFnode_t *P; HDFnode_t *P;
int j, hdfID, xRef, PabloID = 1; int j, PabloID = 1;
long hdfID, xRef;
char *fName, **T; char *fName, **T;
F = HDFfileList; F = HDFfileList;
@ -902,10 +898,10 @@ void writeHDFNamePacketsRT( char **Names, int numSetIDs )
//==============================================================*/ //==============================================================*/
for ( j = 1; j <= numSetIDs; ++j ) { for ( j = 1; j <= numSetIDs; ++j ) {
fName = Names[j]; fName = Names[j];
NamePkt.packetLength = sizeof(NamePkt) + strlen(fName) ; NamePkt.packetLength = (int)(sizeof(NamePkt) + strlen(fName));
NamePkt.fileType = 0; /* not currently used */ NamePkt.fileType = 0; /* not currently used */
NamePkt.fileID = j; NamePkt.fileID = j;
NamePkt.nameLen = strlen(fName) ; NamePkt.nameLen = (int)strlen(fName) ;
if ( buffSize < NamePkt.packetLength ) { if ( buffSize < NamePkt.packetLength ) {
free((void *)BUFF) ; free((void *)BUFF) ;
buffSize = NamePkt.packetLength + 80; buffSize = NamePkt.packetLength + 80;
@ -926,10 +922,10 @@ void writeHDFNamePacketsRT( char **Names, int numSetIDs )
// This routine takes the records after they have been tagged and adds * // This routine takes the records after they have been tagged and adds *
// their fields to the apporopriate position in the HDFQueues structure * // their fields to the apporopriate position in the HDFQueues structure *
//======================================================================*/ //======================================================================*/
void HDFupdateProcLists( ) void HDFupdateProcLists( void )
{ {
HDFnode_t *P, *Q; HDFnode_t *P, *Q;
int hdfID; long hdfID;
hdfID = TagQueue->record.hdfID; hdfID = TagQueue->record.hdfID;
P = TagQueue; P = TagQueue;
@ -949,7 +945,8 @@ void HDFupdateProcLists( )
//======================================================================*/ //======================================================================*/
void HDFupdateProcs( HDFnode_t *P ) void HDFupdateProcs( HDFnode_t *P )
{ {
int procIndex, hdfID, xRef, eventID; int procIndex, eventID;
long hdfID, xRef;
HDFnode_t *Q; HDFnode_t *Q;
eventID = P->eventID; eventID = P->eventID;
procIndex = ProcIndexForHDFEntry( eventID ); procIndex = ProcIndexForHDFEntry( eventID );
@ -1361,7 +1358,7 @@ void _hdfDescriptorRT( char *recordName, char *recordDescription,
// Compute and update the record length. * // Compute and update the record length. *
// Write the completed record. * // Write the completed record. *
//==================================================================*/ //==================================================================*/
recordLength = hdfRecordPointer - recordBuffer; recordLength = (int)(hdfRecordPointer - recordBuffer);
hdfRecordPointer = recordBuffer; hdfRecordPointer = recordBuffer;
sddfWriteInteger( &hdfRecordPointer, recordLength ); sddfWriteInteger( &hdfRecordPointer, recordLength );
@ -1373,7 +1370,7 @@ void _hdfDescriptorRT( char *recordName, char *recordDescription,
// Internal Routine: writeHDFRecDescrptrsRT * // Internal Routine: writeHDFRecDescrptrsRT *
// Writes record descriptors for the HDF events. * // Writes record descriptors for the HDF events. *
//======================================================================*/ //======================================================================*/
void writeHDFRecDescrptrsRT() void writeHDFRecDescrptrsRT( void )
{ {
char HDFProcNames[][40] = { char HDFProcNames[][40] = {
# include "HDFentryNames.h" # include "HDFentryNames.h"
@ -1423,7 +1420,7 @@ void printFileMappingsRT( char *mapFile, char **Names, int nPabloIDs )
/* Generate a SDDF binary format record descriptor for the */ /* Generate a SDDF binary format record descriptor for the */
/* named identifiers used during execution. */ /* named identifiers used during execution. */
/************************************************************************/ /************************************************************************/
void _hdfNameDescriptor() void _hdfNameDescriptor( void )
{ {
static char recordBuffer[ 4096 ]; static char recordBuffer[ 4096 ];
int recordLength; int recordLength;
@ -1469,7 +1466,7 @@ void _hdfNameDescriptor()
"HDF Name", "Name of File, Data Set or Dim", "HDF Name", "Name of File, Data Set or Dim",
CHARACTER, 1 ); CHARACTER, 1 );
recordLength = hdfRecordPointer - recordBuffer; recordLength = (int)(hdfRecordPointer - recordBuffer);
hdfRecordPointer = recordBuffer; hdfRecordPointer = recordBuffer;
sddfWriteInteger( &hdfRecordPointer, recordLength ); sddfWriteInteger( &hdfRecordPointer, recordLength );

View File

@ -83,7 +83,7 @@ TR_RECORD *HDFprocEventRecord( int, TR_EVENT *, CLOCK, HDFsetInfo *, unsigned );
TR_RECORD *miscEventRecord( int , TR_EVENT *, CLOCK, void *, unsigned ); TR_RECORD *miscEventRecord( int , TR_EVENT *, CLOCK, void *, unsigned );
void _hdfMiscDescriptor( void ); void _hdfMiscDescriptor( void );
void _hdfProcNameDescriptor( void ); void _hdfProcNameDescriptor( void );
int setEventRecordFunction( int, void * ); int setEventRecordFunction( int, void *(*)() );
void HDFtraceIOEvent( int, void *, unsigned ); void HDFtraceIOEvent( int, void *, unsigned );
void initIOTrace( void ); void initIOTrace( void );
void enableIOdetail( void ); void enableIOdetail( void );
@ -225,6 +225,7 @@ void HDFinitTrace_SDDF( char *traceFileName, uint32 procTraceMask )
// tracing is available, this will be initialized also. * // tracing is available, this will be initialized also. *
//==============================================================*/ //==============================================================*/
#ifdef HAVE_PARALLEL #ifdef HAVE_PARALLEL
int myNode;
/*=============================================================== /*===============================================================
// in the parallel case, initialize MPI-IO tracing. This will * // in the parallel case, initialize MPI-IO tracing. This will *
// initialize the traceFileName and set the I/O tracing * // initialize the traceFileName and set the I/O tracing *
@ -269,6 +270,7 @@ void HDFinitTrace_SDDF( char *traceFileName, uint32 procTraceMask )
//======================================================================*/ //======================================================================*/
void HDFendTrace_SDDF(void) void HDFendTrace_SDDF(void)
{ {
HDFfinalTimeStamp();
#ifdef HAVE_MPIOTRACE #ifdef HAVE_MPIOTRACE
/*=============================================================== /*===============================================================
// termintate MPI-IO tracing in the parallel case. This will * // termintate MPI-IO tracing in the parallel case. This will *
@ -279,7 +281,6 @@ void HDFendTrace_SDDF(void)
/*=============================================================== /*===============================================================
// terminate tracing * // terminate tracing *
//==============================================================*/ //==============================================================*/
HDFfinalTimeStamp();
endIOTrace(); endIOTrace();
endTracing(); endTracing();
#endif #endif
@ -333,9 +334,9 @@ int initHDFProcTrace( int numProcs, int *procEntryID )
procEvents[ procIndex ].exitID = -procEntryID[ procIndex ]; procEvents[ procIndex ].exitID = -procEntryID[ procIndex ];
setEventRecordFunction( procEntryID[ procIndex ], setEventRecordFunction( procEntryID[ procIndex ],
HDFprocEventRecord ); (void *(*)())HDFprocEventRecord );
setEventRecordFunction( -procEntryID[ procIndex ], setEventRecordFunction( -procEntryID[ procIndex ],
HDFprocEventRecord ); (void *(*)())HDFprocEventRecord );
procEntryCalled[ procIndex ] = 0; procEntryCalled[ procIndex ] = 0;
} }
@ -347,12 +348,12 @@ int initHDFProcTrace( int numProcs, int *procEntryID )
//==============================================================*/ //==============================================================*/
procEvents[ numProcs ].entryID = ID_malloc; procEvents[ numProcs ].entryID = ID_malloc;
procEvents[ numProcs ].exitID = -ID_malloc; procEvents[ numProcs ].exitID = -ID_malloc;
setEventRecordFunction( ID_malloc, miscEventRecord ); setEventRecordFunction( ID_malloc, (void *(*)())miscEventRecord );
setEventRecordFunction( -ID_malloc, miscEventRecord ); setEventRecordFunction( -ID_malloc, (void *(*)())miscEventRecord );
procEvents[ numProcs+1 ].entryID = ID_free; procEvents[ numProcs+1 ].entryID = ID_free;
procEvents[ numProcs+1 ].exitID = -ID_free; procEvents[ numProcs+1 ].exitID = -ID_free;
setEventRecordFunction( ID_free, miscEventRecord ); setEventRecordFunction( ID_free, (void *(*)())miscEventRecord );
setEventRecordFunction( -ID_free, miscEventRecord ); setEventRecordFunction( -ID_free, (void *(*)())miscEventRecord );
return SUCCESS; return SUCCESS;
} }
@ -580,11 +581,10 @@ TR_RECORD *miscEventRecord( int recordType,
break; break;
case -ID_malloc: case -ID_malloc:
case -ID_free: case -ID_free:
miscRecord.bytes = *(size_t *)dataPointer; miscRecord.bytes = *(int *)dataPointer;
miscRecord.duration = clockToSeconds( timeStamp) miscRecord.duration = clockToSeconds( timeStamp)
- miscRecord.seconds; - miscRecord.seconds;
return &traceRecord; /* generate trace record */ return &traceRecord; /* generate trace record */
break;
default: default:
fprintf( stderr, "miscEventRecord: unknown eventID %d\n", eventID ); fprintf( stderr, "miscEventRecord: unknown eventID %d\n", eventID );
break; break;