2003-10-23 05:30:19 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
|
|
|
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
#include "h5diff.h"
|
2005-01-27 07:03:29 +08:00
|
|
|
#include "ph5diff.h"
|
2003-12-03 22:26:51 +08:00
|
|
|
#include "H5private.h"
|
|
|
|
|
2005-02-01 12:13:42 +08:00
|
|
|
/* global variables */
|
2005-02-03 07:01:42 +08:00
|
|
|
int g_nTasks = 1;
|
|
|
|
unsigned char g_Parallel = 0; /*0 for serial, 1 for parallel */
|
2005-02-01 12:13:42 +08:00
|
|
|
char outBuff[OUTBUFF_SIZE];
|
2005-08-18 03:21:36 +08:00
|
|
|
int outBuffOffset;
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
FILE* overflow_file = NULL;
|
2003-10-23 05:30:19 +08:00
|
|
|
|
2005-01-27 07:03:29 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: parallel_print
|
|
|
|
*
|
|
|
|
* Purpose: wrapper for printf for use in parallel mode.
|
|
|
|
*
|
|
|
|
* Programmer: Leon Arber
|
|
|
|
*
|
|
|
|
* Date: December 1, 2004
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
void parallel_print(const char* format, ...)
|
|
|
|
{
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
int bytes_written;
|
2005-01-27 07:03:29 +08:00
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, format);
|
|
|
|
|
2005-02-03 07:01:42 +08:00
|
|
|
if(!g_Parallel)
|
2005-08-14 04:53:35 +08:00
|
|
|
vprintf(format, ap);
|
2005-01-27 07:03:29 +08:00
|
|
|
else
|
2005-02-08 13:42:49 +08:00
|
|
|
{
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
|
|
|
|
if(overflow_file == NULL) /*no overflow has occurred yet */
|
|
|
|
{
|
2005-08-18 03:21:36 +08:00
|
|
|
#if 0
|
|
|
|
printf("calling HDvsnprintf: OUTBUFF_SIZE=%ld, outBuffOffset=%ld, ", (long)OUTBUFF_SIZE, (long)outBuffOffset);
|
|
|
|
#endif
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
bytes_written = HDvsnprintf(outBuff+outBuffOffset, OUTBUFF_SIZE-outBuffOffset, format, ap);
|
2005-08-18 03:21:36 +08:00
|
|
|
#if 0
|
|
|
|
printf("bytes_written=%ld\n", (long)bytes_written);
|
|
|
|
#endif
|
2005-03-14 07:38:11 +08:00
|
|
|
va_end(ap);
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
va_start(ap, format);
|
|
|
|
|
2005-08-18 03:21:36 +08:00
|
|
|
#if 0
|
|
|
|
printf("Result: bytes_written=%ld, OUTBUFF_SIZE-outBuffOffset=%ld\n", (long)bytes_written, (long)OUTBUFF_SIZE-outBuffOffset);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if ((bytes_written < 0) ||
|
2005-03-14 08:22:35 +08:00
|
|
|
#ifdef H5_VSNPRINTF_WORKS
|
2005-08-18 03:21:36 +08:00
|
|
|
(bytes_written >= (OUTBUFF_SIZE-outBuffOffset))
|
2005-03-14 07:38:11 +08:00
|
|
|
#else
|
2005-08-18 03:21:36 +08:00
|
|
|
((bytes_written+1) == (OUTBUFF_SIZE-outBuffOffset))
|
2005-08-14 04:53:35 +08:00
|
|
|
#endif
|
2005-08-18 03:21:36 +08:00
|
|
|
)
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
{
|
2005-04-26 03:15:22 +08:00
|
|
|
/* Terminate the outbuff at the end of the previous output */
|
|
|
|
outBuff[outBuffOffset] = '\0';
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
|
|
overflow_file = HDtmpfile();
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
if(overflow_file == NULL)
|
2005-06-29 03:20:56 +08:00
|
|
|
fprintf(stderr, "Warning: Could not create overflow file. Output may be truncated.\n");
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
else
|
|
|
|
bytes_written = HDvfprintf(overflow_file, format, ap);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
outBuffOffset += bytes_written;
|
|
|
|
}
|
|
|
|
else
|
2005-08-14 04:53:35 +08:00
|
|
|
bytes_written = HDvfprintf(overflow_file, format, ap);
|
[svn-r10170] Purpose:
Bug Fixes
Description:
Fixes for several bugs, including dumping of excess output to a temporary file, fix for printing
hsize_t datatype, and the long awaited fix for intermixed output.
Solution:
Fix 1: Overflow file
Previously, any output that a worker task made was buffered locally in memory, up to a point. Any
output beyond the size of the buffer (used to be 10k) was discarded. Now, the memory buffer size has been
changed to 1k and any output beyond this amount is sent a temporary file. This way, no output is lost
and memory usage is kept under control. The temporary file is deleted as soon as a worker task finishes
sending its contents to the manager.
Fix 2: hsize_t printing
Printing of the hsize_t datatype used to be handled by %Hu passed to HDfprintf. However, there is no corresponding HDvsnprintf that
is able to print hsize_t types. These are now printed with the aid of H5_PRINTF_LL_WIDTH.
Fix 3: Intermixed output fix
Intermixed output would occur on some machines (although I haven't seen it happen for a while) due to the unpredictability of the underlying network
and the speed at which various message would travel. This has been fixed by having all output send to the manager
for printing. The worker tasks no longer print the output themselves upon receipt of a token, but instead
send that data to the manager.
Platforms tested:
heping, eirene, tg-login (the only place that seems to still experience intermixed output every now and then)
Misc. update:
2005-03-10 02:38:36 +08:00
|
|
|
|
2005-02-08 13:42:49 +08:00
|
|
|
}
|
2005-01-27 07:03:29 +08:00
|
|
|
va_end(ap);
|
|
|
|
}
|
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2005-08-14 04:53:35 +08:00
|
|
|
void print_pos( int *ph,
|
|
|
|
int per,
|
|
|
|
hsize_t curr_pos,
|
|
|
|
hsize_t *acc,
|
|
|
|
hsize_t *pos,
|
|
|
|
int rank,
|
|
|
|
const char *obj1,
|
2003-12-03 07:13:27 +08:00
|
|
|
const char *obj2 )
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* print header */
|
|
|
|
if ( *ph==1 )
|
|
|
|
{
|
|
|
|
*ph=0;
|
2003-12-03 07:13:27 +08:00
|
|
|
if (per)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2005-08-14 04:53:35 +08:00
|
|
|
parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
|
|
|
|
"position",
|
|
|
|
(obj1!=NULL) ? obj1 : " ",
|
2003-12-03 07:13:27 +08:00
|
|
|
(obj2!=NULL) ? obj2 : " ",
|
2005-08-14 04:53:35 +08:00
|
|
|
"difference",
|
2003-10-23 05:30:19 +08:00
|
|
|
"relative");
|
2005-01-27 07:03:29 +08:00
|
|
|
parallel_print("------------------------------------------------------------------------\n");
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-08-14 04:53:35 +08:00
|
|
|
parallel_print("%-15s %-15s %-15s %-20s\n",
|
|
|
|
"position",
|
|
|
|
(obj1!=NULL) ? obj1 : " ",
|
2003-12-03 07:13:27 +08:00
|
|
|
(obj2!=NULL) ? obj2 : " ",
|
|
|
|
"difference");
|
2005-01-27 07:03:29 +08:00
|
|
|
parallel_print("------------------------------------------------------------\n");
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( i = 0; i < rank; i++)
|
|
|
|
{
|
|
|
|
pos[i] = curr_pos/acc[i];
|
|
|
|
curr_pos -= acc[i]*pos[i];
|
|
|
|
}
|
|
|
|
assert( curr_pos == 0 );
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
parallel_print("[ " );
|
2003-10-23 05:30:19 +08:00
|
|
|
for ( i = 0; i < rank; i++)
|
|
|
|
{
|
2005-11-15 10:55:39 +08:00
|
|
|
/* HDfprintf(stdout,"%Hu ", pos[i] ); */
|
|
|
|
parallel_print("%"H5_PRINTF_LL_WIDTH"u ", (unsigned long_long)pos[i]);
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
2005-01-27 07:03:29 +08:00
|
|
|
parallel_print("]" );
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: print_dims
|
|
|
|
*
|
|
|
|
* Purpose: print dimensions
|
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
void print_dims( int r, hsize_t *d )
|
|
|
|
{
|
|
|
|
int i;
|
2005-08-14 04:53:35 +08:00
|
|
|
parallel_print("[ " );
|
|
|
|
for ( i=0; i<r; i++ )
|
2005-11-15 10:55:39 +08:00
|
|
|
parallel_print("%"H5_PRINTF_LL_WIDTH"u ",(unsigned long_long)d[i] );
|
2005-01-27 07:03:29 +08:00
|
|
|
parallel_print("] " );
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2003-10-29 01:40:05 +08:00
|
|
|
* Function: print_type
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose: Print name of datatype
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2003-10-29 01:40:05 +08:00
|
|
|
* Return: void
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
|
|
|
* Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2003-10-29 01:40:05 +08:00
|
|
|
void print_type(hid_t type)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
2005-08-14 04:53:35 +08:00
|
|
|
switch (H5Tget_class(type))
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
case H5T_INTEGER:
|
|
|
|
if (H5Tequal(type, H5T_STD_I8BE)) {
|
|
|
|
printf("H5T_STD_I8BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I8LE)) {
|
|
|
|
printf("H5T_STD_I8LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I16BE)) {
|
|
|
|
printf("H5T_STD_I16BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I16LE)) {
|
|
|
|
printf("H5T_STD_I16LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I32BE)) {
|
|
|
|
printf("H5T_STD_I32BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I32LE)) {
|
|
|
|
printf("H5T_STD_I32LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I64BE)) {
|
|
|
|
printf("H5T_STD_I64BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_I64LE)) {
|
|
|
|
printf("H5T_STD_I64LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U8BE)) {
|
|
|
|
printf("H5T_STD_U8BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U8LE)) {
|
|
|
|
printf("H5T_STD_U8LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U16BE)) {
|
|
|
|
printf("H5T_STD_U16BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U16LE)) {
|
|
|
|
printf("H5T_STD_U16LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U32BE)) {
|
|
|
|
printf("H5T_STD_U32BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U32LE)) {
|
|
|
|
printf("H5T_STD_U32LE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U64BE)) {
|
|
|
|
printf("H5T_STD_U64BE");
|
|
|
|
} else if (H5Tequal(type, H5T_STD_U64LE)) {
|
|
|
|
printf("H5T_STD_U64LE");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_SCHAR)) {
|
|
|
|
printf("H5T_NATIVE_SCHAR");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
|
|
|
|
printf("H5T_NATIVE_UCHAR");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_SHORT)) {
|
|
|
|
printf("H5T_NATIVE_SHORT");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_USHORT)) {
|
|
|
|
printf("H5T_NATIVE_USHORT");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_INT)) {
|
|
|
|
printf("H5T_NATIVE_INT");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_UINT)) {
|
|
|
|
printf("H5T_NATIVE_UINT");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_LONG)) {
|
|
|
|
printf("H5T_NATIVE_LONG");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_ULONG)) {
|
|
|
|
printf("H5T_NATIVE_ULONG");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_LLONG)) {
|
|
|
|
printf("H5T_NATIVE_LLONG");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_ULLONG)) {
|
|
|
|
printf("H5T_NATIVE_ULLONG");
|
|
|
|
} else {
|
|
|
|
printf("undefined integer");
|
|
|
|
}
|
|
|
|
break;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
case H5T_FLOAT:
|
|
|
|
if (H5Tequal(type, H5T_IEEE_F32BE)) {
|
|
|
|
printf("H5T_IEEE_F32BE");
|
|
|
|
} else if (H5Tequal(type, H5T_IEEE_F32LE)) {
|
|
|
|
printf("H5T_IEEE_F32LE");
|
|
|
|
} else if (H5Tequal(type, H5T_IEEE_F64BE)) {
|
|
|
|
printf("H5T_IEEE_F64BE");
|
|
|
|
} else if (H5Tequal(type, H5T_IEEE_F64LE)) {
|
|
|
|
printf("H5T_IEEE_F64LE");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_FLOAT)) {
|
|
|
|
printf("H5T_NATIVE_FLOAT");
|
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) {
|
|
|
|
printf("H5T_NATIVE_DOUBLE");
|
2005-07-23 09:55:12 +08:00
|
|
|
#if H5_SIZEOF_LONG_DOUBLE !=0
|
2003-10-23 05:30:19 +08:00
|
|
|
} else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) {
|
|
|
|
printf("H5T_NATIVE_LDOUBLE");
|
2005-07-23 09:55:12 +08:00
|
|
|
#endif
|
2003-10-23 05:30:19 +08:00
|
|
|
} else {
|
|
|
|
printf("undefined float");
|
|
|
|
}
|
|
|
|
break;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
}/*switch*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2003-10-29 01:40:05 +08:00
|
|
|
* Function: diff_basename
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose: Returns a pointer to the last component absolute name
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
const char*
|
2003-10-29 01:40:05 +08:00
|
|
|
diff_basename(const char *name)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
|
|
|
size_t i;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2005-06-14 04:06:47 +08:00
|
|
|
if (name==NULL)
|
2005-06-29 00:25:42 +08:00
|
|
|
return NULL;
|
2005-06-14 04:06:47 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
/* Find the end of the base name */
|
|
|
|
i = strlen(name);
|
|
|
|
while (i>0 && '/'==name[i-1])
|
|
|
|
--i;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
/* Skip backward over base name */
|
|
|
|
while (i>0 && '/'!=name[i-1])
|
|
|
|
--i;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
return(name+i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_type
|
|
|
|
*
|
|
|
|
* Purpose: Returns the type as a string
|
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
const char*
|
|
|
|
get_type(int type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case H5G_DATASET:
|
|
|
|
return("H5G_DATASET");
|
|
|
|
case H5G_GROUP:
|
|
|
|
return("H5G_GROUP");
|
|
|
|
case H5G_TYPE:
|
|
|
|
return("H5G_TYPE");
|
|
|
|
case H5G_LINK:
|
|
|
|
return("H5G_LINK");
|
|
|
|
default:
|
|
|
|
return("user defined type");
|
2005-08-14 04:53:35 +08:00
|
|
|
}
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_sign
|
|
|
|
*
|
|
|
|
* Purpose: Returns the sign as a string
|
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Comments:
|
2003-10-23 05:30:19 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
const char*
|
|
|
|
get_sign(H5T_sign_t sign)
|
|
|
|
{
|
|
|
|
switch (sign)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return("H5T_SGN_ERROR");
|
|
|
|
case H5T_SGN_NONE:
|
|
|
|
return("H5T_SGN_NONE");
|
|
|
|
case H5T_SGN_2:
|
|
|
|
return("H5T_SGN_2");
|
2005-08-14 04:53:35 +08:00
|
|
|
}
|
2003-10-23 05:30:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: get_class
|
|
|
|
*
|
|
|
|
* Purpose: Returns the class as a string
|
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
|
|
|
*
|
|
|
|
* Date: May 9, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
const char*
|
|
|
|
get_class(H5T_class_t tclass)
|
|
|
|
{
|
2005-08-14 04:53:35 +08:00
|
|
|
switch (tclass)
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
return("Invalid class");
|
|
|
|
case H5T_TIME:
|
|
|
|
return("H5T_TIME");
|
|
|
|
case H5T_INTEGER:
|
|
|
|
return("H5T_INTEGER");
|
|
|
|
case H5T_FLOAT:
|
|
|
|
return("H5T_FLOAT");
|
|
|
|
case H5T_STRING:
|
|
|
|
return("H5T_STRING");
|
|
|
|
case H5T_BITFIELD:
|
|
|
|
return("H5T_BITFIELD");
|
|
|
|
case H5T_OPAQUE:
|
|
|
|
return("H5T_OPAQUE");
|
|
|
|
case H5T_COMPOUND:
|
|
|
|
return("H5T_COMPOUND");
|
|
|
|
case H5T_REFERENCE:
|
|
|
|
return("H5T_REFERENCE");
|
|
|
|
case H5T_ENUM:
|
|
|
|
return("H5T_ENUM");
|
|
|
|
case H5T_VLEN:
|
|
|
|
return("H5T_VLEN");
|
|
|
|
case H5T_ARRAY:
|
|
|
|
return("H5T_ARRAY");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-21 03:21:03 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: print_found
|
|
|
|
*
|
|
|
|
* Purpose: print number of differences found
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
void print_found(hsize_t nfound)
|
|
|
|
{
|
2005-02-08 13:42:49 +08:00
|
|
|
if(g_Parallel)
|
2005-11-15 10:55:39 +08:00
|
|
|
parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long_long)nfound);
|
2005-02-08 13:42:49 +08:00
|
|
|
else
|
|
|
|
HDfprintf(stdout,"%Hu differences found\n",nfound);
|
2004-07-21 03:21:03 +08:00
|
|
|
}
|
|
|
|
|
2003-10-23 05:30:19 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: print_sizes
|
|
|
|
*
|
|
|
|
* Purpose: Print datatype sizes
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#if defined (H5DIFF_DEBUG)
|
|
|
|
void print_sizes( const char *obj1, const char *obj2,
|
|
|
|
hid_t f_type1, hid_t f_type2,
|
2005-08-14 04:53:35 +08:00
|
|
|
hid_t m_type1, hid_t m_type2 )
|
2003-10-23 05:30:19 +08:00
|
|
|
{
|
|
|
|
size_t f_size1, f_size2; /* size of type in file */
|
|
|
|
size_t m_size1, m_size2; /* size of type in memory */
|
|
|
|
|
|
|
|
f_size1 = H5Tget_size( f_type1 );
|
|
|
|
f_size2 = H5Tget_size( f_type2 );
|
|
|
|
m_size1 = H5Tget_size( m_type1 );
|
|
|
|
m_size2 = H5Tget_size( m_type2 );
|
|
|
|
|
|
|
|
printf("\n");
|
|
|
|
printf("------------------\n");
|
|
|
|
printf("sizeof(char) %u\n", sizeof(char) );
|
|
|
|
printf("sizeof(short) %u\n", sizeof(short) );
|
|
|
|
printf("sizeof(int) %u\n", sizeof(int) );
|
|
|
|
printf("sizeof(long) %u\n", sizeof(long) );
|
|
|
|
printf("<%s> ------------------\n", obj1);
|
|
|
|
printf("type on file ");
|
2003-10-29 01:40:05 +08:00
|
|
|
print_type(f_type1);
|
2003-10-23 05:30:19 +08:00
|
|
|
printf("\n");
|
|
|
|
printf("size on file %u\n", f_size1 );
|
|
|
|
|
|
|
|
printf("type on memory ");
|
2003-10-29 01:40:05 +08:00
|
|
|
print_type(m_type1);
|
2003-10-23 05:30:19 +08:00
|
|
|
printf("\n");
|
|
|
|
printf("size on memory %u\n", m_size1 );
|
|
|
|
|
|
|
|
printf("<%s> ------------------\n", obj2);
|
|
|
|
printf("type on file ");
|
2003-10-29 01:40:05 +08:00
|
|
|
print_type(f_type2);
|
2003-10-23 05:30:19 +08:00
|
|
|
printf("\n");
|
|
|
|
printf("size on file %u\n", f_size2 );
|
|
|
|
|
|
|
|
printf("type on memory ");
|
2003-10-29 01:40:05 +08:00
|
|
|
print_type(m_type2);
|
2003-10-23 05:30:19 +08:00
|
|
|
printf("\n");
|
|
|
|
printf("size on memory %u\n", m_size2 );
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
#endif /* H5DIFF_DEBUG */
|
|
|
|
|
|
|
|
|