[svn-r12126] Purpose:

bug fix

Description:
the compare check for the datatype sign was not done in the correct place, causing invalid
comparisons to be made

Solution:
put it on the correct place

Platforms tested:
linux 32, 64
AIX

Misc. update:
This commit is contained in:
Pedro Vicente Nunes
2006-03-21 11:01:42 -05:00
parent 2db47ff504
commit bd73819e26
5 changed files with 267 additions and 322 deletions

View File

@@ -165,16 +165,7 @@ const char* get_type(int type);
const char* get_class(H5T_class_t tclass);
const char* get_sign(H5T_sign_t sign);
void print_dims( int r, hsize_t *d );
void print_pos( int *ph,
int per,
hsize_t curr_pos,
hsize_t *acc,
hsize_t *pos,
int rank,
const char *obj1,
const char *obj2 );
int print_objname(diff_opt_t *options, hsize_t nfound);
int print_objname(diff_opt_t *options, hsize_t nfound);
#if defined (H5DIFF_DEBUG)

File diff suppressed because it is too large Load Diff

View File

@@ -234,6 +234,42 @@ hsize_t diff_datasetid( hid_t dset1_id,
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* memory type and sizes
*-------------------------------------------------------------------------
*/
if ((m_type1=h5tools_get_native_type(f_type1))<0)
goto error;
if ((m_type2=h5tools_get_native_type(f_type2))<0)
goto error;
m_size1 = H5Tget_size( m_type1 );
m_size2 = H5Tget_size( m_type2 );
#if defined (H5DIFF_DEBUG)
if (obj1_name)
print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2);
#endif
/*-------------------------------------------------------------------------
* check for different signed/unsigned types
*-------------------------------------------------------------------------
*/
sign1=H5Tget_sign(m_type1);
sign2=H5Tget_sign(m_type2);
if ( sign1 != sign2 )
{
if (options->m_verbose && obj1_name) {
parallel_print("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
cmp=0;
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* only attempt to compare if possible
*-------------------------------------------------------------------------
@@ -260,42 +296,6 @@ hsize_t diff_datasetid( hid_t dset1_id,
/* only assert if the space is the same */
assert(nelmts1==nelmts2);
/*-------------------------------------------------------------------------
* memory type and sizes
*-------------------------------------------------------------------------
*/
if ((m_type1=h5tools_get_native_type(f_type1))<0)
goto error;
if ((m_type2=h5tools_get_native_type(f_type2))<0)
goto error;
m_size1 = H5Tget_size( m_type1 );
m_size2 = H5Tget_size( m_type2 );
#if defined (H5DIFF_DEBUG)
if (obj1_name)
print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2);
#endif
/*-------------------------------------------------------------------------
* check for different signed/unsigned types
*-------------------------------------------------------------------------
*/
sign1=H5Tget_sign(m_type1);
sign2=H5Tget_sign(m_type2);
if ( sign1 != sign2 )
{
if (options->m_verbose && obj1_name) {
parallel_print("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
cmp=0;
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* "upgrade" the smaller memory size
*-------------------------------------------------------------------------

View File

@@ -89,70 +89,6 @@ printf("Result: bytes_written=%ld, OUTBUFF_SIZE-outBuffOffset=%ld\n", (long)byte
va_end(ap);
}
/*-------------------------------------------------------------------------
* Function: print_pos
*
* Purpose: convert an array index position to matrix notation
*
* Return: pos matrix array
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
* Date: May 9, 2003
*
*-------------------------------------------------------------------------
*/
void print_pos( int *ph,
int per,
hsize_t curr_pos,
hsize_t *acc,
hsize_t *pos,
int rank,
const char *obj1,
const char *obj2 )
{
int i;
/* print header */
if ( *ph==1 )
{
*ph=0;
if (per)
{
parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
"position",
(obj1!=NULL) ? obj1 : " ",
(obj2!=NULL) ? obj2 : " ",
"difference",
"relative");
parallel_print("------------------------------------------------------------------------\n");
}
else
{
parallel_print("%-15s %-15s %-15s %-20s\n",
"position",
(obj1!=NULL) ? obj1 : " ",
(obj2!=NULL) ? obj2 : " ",
"difference");
parallel_print("------------------------------------------------------------\n");
}
}
for ( i = 0; i < rank; i++)
{
pos[i] = curr_pos/acc[i];
curr_pos -= acc[i]*pos[i];
}
assert( curr_pos == 0 );
parallel_print("[ " );
for ( i = 0; i < rank; i++)
{
/* HDfprintf(stdout,"%Hu ", pos[i] ); */
parallel_print("%"H5_PRINTF_LL_WIDTH"u ", (unsigned long_long)pos[i]);
}
parallel_print("]" );
}
/*-------------------------------------------------------------------------
* Function: print_dims