1
1

- fixed buffer overflow which occurred if marker or event comment records generated

- fixed bug in MPI-I/O tracing: tracking MPI file handles even if MPI_File_open isn't recorded
- fixed compiler warnings in the PAPI component
- incremented version number to 5.8.2

This commit was SVN r23074.
Этот коммит содержится в:
Matthias Jurenz 2010-04-30 10:04:26 +00:00
родитель c62418d76d
Коммит 29f02d88c6
7 изменённых файлов: 59 добавлений и 38 удалений

Просмотреть файл

@ -1,3 +1,9 @@
5.8.2openmpi
- fixed buffer overflow which occurred if marker or event comment
records generated
- fixed bug in MPI-I/O tracing: tracking MPI file handles even if
MPI_File_open isn't recorded
5.8.1openmpi
- updated version of internal OTF to 1.6.5openmpi
(see extlib/otf/ChangeLog)

Просмотреть файл

@ -1 +1 @@
5.8.1openmpi
5.8.2openmpi

Просмотреть файл

@ -62,7 +62,7 @@ body {font-family: sans-serif;}
<P>
<P>
<B><BIG CLASS="XHUGE">VampirTrace 5.8.1 User Manual</BIG></B>
<B><BIG CLASS="XHUGE">VampirTrace 5.8.2 User Manual</BIG></B>
<BR>
<BR>
<BR>

Двоичные данные
ompi/contrib/vt/vt/doc/UserManual.pdf

Двоичный файл не отображается.

Просмотреть файл

@ -66,18 +66,18 @@ struct metric
uint32_t props;
};
typedef struct eventmap_t // we need an eventset for each component
typedef struct eventmap_t /* we need an eventset for each component */
{
int EventId; // eventset id
long_long Values[VT_METRIC_MAXNUM]; // return values for the eventsets
int nEvents; // number of recorded events in this set
int EventId; /* eventset id */
long_long Values[VT_METRIC_MAXNUM]; /* return values for the eventsets */
int nEvents; /* number of recorded events in this set */
int ComponentId;
}eventmap_t;
struct vt_metv
{
struct eventmap_t * EventSet[VT_METRIC_MAXNUM]; // a struct for each active component
long_long * Values[VT_METRIC_MAXNUM]; // for each counter a pointer, that points to the eventsets return values
struct eventmap_t * EventSet[VT_METRIC_MAXNUM]; /* a struct for each active component */
long_long * Values[VT_METRIC_MAXNUM]; /* for each counter a pointer, that points to the eventsets return values */
};
/*
@ -339,16 +339,17 @@ static void metric_test(void)
EventSet[i] = NULL;
for (i=0; i < nmetrics; i++) {
#ifdef PAPIC
// Preset-counter belong to Component 0!
/* Preset-counter belong to Component 0! */
component = PAPI_COMPONENT_INDEX(metricv[i]->papi_code);
#else
component = 0;
#endif
/* search for the eventset that matches the counter */
j=0;
while (EventSet[j]!=NULL && j < VT_METRIC_MAXNUM && EventSet[j]->ComponentId!=component){ // search for the eventset that matches the counter
while (EventSet[j]!=NULL && j < VT_METRIC_MAXNUM && EventSet[j]->ComponentId!=component){
j++;
}
if (EventSet[j]==NULL) // create eventset, if no matching found
if (EventSet[j]==NULL) /* create eventset, if no matching found */
{
EventSet[j] = malloc(sizeof(eventmap_t));
EventSet[j]->EventId=PAPI_NULL;
@ -366,7 +367,8 @@ static void metric_test(void)
}
vt_cntl_msg(2, "Event %s added to event set", metricv[i]->name);
}
for (i=0; i < VT_METRIC_MAXNUM && EventSet[i]!=NULL; i++) // foreach used eventset
/* foreach used eventset */
for (i=0; i < VT_METRIC_MAXNUM && EventSet[i]!=NULL; i++)
{
retval = PAPI_cleanup_eventset(EventSet[i]->EventId);
if ( retval != PAPI_OK )
@ -391,6 +393,7 @@ int vt_metric_open()
int forceprop;
PAPI_event_info_t info;
metricmap_t* mapv = NULL;
metricmap_t* map;
/* read environment variable "VT_METRICS". Return if
uset and no PAPI timer used. */
@ -431,7 +434,7 @@ int vt_metric_open()
else
forceprop=0;
/* search metricmap for a suitable definition */
metricmap_t* map = mapv;
map = mapv;
/*printf("Token%d: <%s>\n", nmetrics, token);*/
while (map != NULL) {
if ( strcmp(map->event_name, token) == 0 ) {
@ -535,24 +538,26 @@ struct vt_metv* vt_metric_create()
metv = (struct vt_metv*)malloc(sizeof(struct vt_metv));
if ( metv == NULL )
vt_error();
/* create event set */
for (i=0; i<VT_METRIC_MAXNUM; i++)
metv->EventSet[i] = NULL;
for (i=0; i < nmetrics; i++)
{
struct eventmap_t *eventset;
#ifdef PAPIC
component = PAPI_COMPONENT_INDEX(metricv[i]->papi_code);
#else
component = 0;
#endif
/* search for the eventset that matches the counter */
j=0;
while (metv->EventSet[j]!=NULL && j < VT_METRIC_MAXNUM && metv->EventSet[j]->ComponentId!=component){ // search for the eventset that matches the counter
while (metv->EventSet[j]!=NULL && j < VT_METRIC_MAXNUM && metv->EventSet[j]->ComponentId!=component){
j++;
}
if (metv->EventSet[j]==NULL) // no event of this component yet!
if (metv->EventSet[j]==NULL) /* no event of this component yet! */
{
metv->EventSet[j] = (struct eventmap_t*)malloc(sizeof(eventmap_t));
metv->EventSet[j]->EventId=PAPI_NULL;
@ -562,17 +567,19 @@ struct vt_metv* vt_metric_create()
metric_error(retval, "PAPI_create_eventset");
metv->EventSet[j]->ComponentId=component;
}
struct eventmap_t *eventset = metv->EventSet[j];
eventset = metv->EventSet[j];
/* add event to event set */
retval = PAPI_add_event(eventset->EventId, metricv[i]->papi_code);
if ( retval != PAPI_OK )
metric_error(retval, "PAPI_add_event");
metv->Values[i] = &(eventset->Values[eventset->nEvents]); // for demux the values from eventset -> returnvector
/* for demux the values from eventset -> returnvector */
metv->Values[i] = &(eventset->Values[eventset->nEvents]);
eventset->nEvents++;
}
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++) // foreach used eventset
/* foreach used eventset */
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++)
{
retval = PAPI_start(metv->EventSet[i]->EventId);
if ( retval != PAPI_OK )
@ -592,7 +599,8 @@ void vt_metric_free(struct vt_metv* metv)
/* treat PAPI failures at this point as non-fatal */
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++) // foreach used eventset
/* foreach used eventset */
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++)
{
retval = PAPI_stop(metv->EventSet[i]->EventId, papi_vals);
if ( retval != PAPI_OK ) {
@ -640,7 +648,9 @@ void vt_metric_read(struct vt_metv* metv, uint64_t offsets[],
if ( metv == NULL )
return;
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++) // foreach used eventset
/* foreach used eventset */
for (i=0; i < VT_METRIC_MAXNUM && metv->EventSet[i]!=NULL; i++)
{
retval = PAPI_read(metv->EventSet[i]->EventId, metv->EventSet[i]->Values );
if ( retval != PAPI_OK )

Просмотреть файл

@ -4201,15 +4201,18 @@ VT_MPI_INT MPI_File_open( MPI_Comm comm,
if (IS_MPI_TRACE_ON)
{
uint32_t fid;
MPIIO_ENTER_IO_W_HANDLE(VT__MPI_FILE_OPEN);
CALL_PMPI_5(MPI_File_open, comm, filename, amode, info, fh, result,
0, was_recorded, &time);
time = vt_pform_wtime();
fid = vt_mpifile_create(*fh, filename);
if (was_recorded)
{
uint32_t fid = vt_mpifile_create(*fh, filename);
if (result == MPI_SUCCESS)
{
vt_ioend(&time, fid, handleid, VT_IOOP_OPEN, 0);

Просмотреть файл

@ -40,28 +40,28 @@
if (gen == NULL) vt_error_msg("Abort: Uninitialized trace buffer")
#define VTGEN_ALLOC_DEF(gen, bytes) \
if ((uint64_t)(gen->buf->pos - gen->buf->mem) > \
(uint64_t)(gen->buf->size - (bytes))) \
VTGen_flush(gen, 0, vt_pform_wtime(), NULL);
if ((uint64_t)((gen)->buf->pos - (gen)->buf->mem) > \
(uint64_t)((gen)->buf->size - (bytes))) \
VTGen_flush((gen), 0, vt_pform_wtime(), NULL);
#define VTGEN_ALLOC_EVENT(gen, bytes) \
if ((uint64_t)(gen->buf->pos - gen->buf->mem) > \
(uint64_t)(gen->buf->size - (bytes))) { \
VTGen_flush(gen, 0, *time, time); \
if(gen->flushcntr == 0) return; \
if ((uint64_t)((gen)->buf->pos - (gen)->buf->mem) > \
(uint64_t)((gen)->buf->size - (bytes))) { \
VTGen_flush((gen), 0, *time, time); \
if((gen)->flushcntr == 0) return; \
}
#define VTGEN_ALIGN_LENGTH(bytes) \
( bytes % SIZEOF_VOIDP ) ? \
( bytes / SIZEOF_VOIDP + 1 ) * SIZEOF_VOIDP : bytes
( (bytes) % SIZEOF_VOIDP ) ? \
( (bytes) / SIZEOF_VOIDP + 1 ) * SIZEOF_VOIDP : (bytes)
#define VTGEN_JUMP(gen, bytes) \
gen->buf->pos += length
gen->buf->pos += (bytes)
#define VTGEN_IS_TRACE_ON(gen) (gen->mode & VT_MODE_TRACE) != 0
#define VTGEN_IS_SUM_ON(gen) (gen->mode & VT_MODE_STAT) != 0
#define VTGEN_IS_TRACE_ON(gen) ((gen)->mode & VT_MODE_TRACE) != 0
#define VTGEN_IS_SUM_ON(gen) ((gen)->mode & VT_MODE_STAT) != 0
#define VTGEN_IS_SUM_PROP_ON(gen, prop) \
(VTGEN_IS_SUM_ON(gen) && (gen->sum_props & prop) != 0)
(VTGEN_IS_SUM_ON((gen)) && ((gen)->sum_props & (prop)) != 0)
/*
*-----------------------------------------------------------------------------
@ -1993,7 +1993,8 @@ void VTGen_write_COMMENT(VTGen* gen, uint64_t* time,
VTBuf_Entry_Comment* new_entry;
uint32_t length =
VTGEN_ALIGN_LENGTH(sizeof(VTBuf_Entry_Comment));
VTGEN_ALIGN_LENGTH((sizeof(VTBuf_Entry_Comment) +
(strlen(comment) * sizeof(char))));
VTGEN_ALLOC_EVENT(gen, length);
@ -2020,7 +2021,8 @@ void VTGen_write_MARKER(VTGen* gen, uint64_t* time, uint32_t mid,
VTBuf_Entry_Marker* new_entry;
uint32_t length =
VTGEN_ALIGN_LENGTH(sizeof(VTBuf_Entry_Marker));
VTGEN_ALIGN_LENGTH((sizeof(VTBuf_Entry_Marker) +
(strlen(mtext) * sizeof(char))));
VTGEN_ALLOC_EVENT(gen, length);