Commit fd8f3626 authored by Jerry Clarke's avatar Jerry Clarke
Browse files

first addtion

parent 9e4801d2
.git* export-ignore
CreateConverters.tcl crlf=input
JavaWrap.tcl crlf=input
SwigIt crlf=input
This diff is collapsed.
<?xml version="1.0" ?>
<!DOCTYPE XdmfCodes SYSTEM "xdmfcodes.dtd" [
]>
<XdmfCodes>
<Vector
Name="DISPL"
Center="Node">
<Component
Name="DISPLX" />
<Component
Name="DISPLY" />
<Component
Name="DISPLZ" />
</Vector>
</XdmfCodes>
##########################################################
#
# Friday December 29, 2000
#
##########################################################
SHELL=/bin/sh
#
# Defined values passed from "configure"
#
prefix=@prefix@
exec_prefix=@exec_prefix@
srcdir=@srcdir@
ICE_ROOT=@ICE_ROOT@
ICE_HOST=@ICE_HOST@
ICE_SUPPORT_ROOT=@ICE_SUPPORT_ROOT@
ICE_RELEASE_ROOT=@ICE_RELEASE_ROOT@
CC=@CC@
CFLAGS=@CFLAGS@
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
F77=@F77@
FFLAGS=@FFLAGS@
JAVAC=@JAVAC@
JAVAINCLUDE=@JAVAINCLUDE@
SHLIB_LD=@SHLIB_LD@
SHLIB_LDFLAGS=@SHLIB_LDFLAGS@
SHLIB_SUFFIX=@SHLIB_SUFFIX@
AR=@AR@
RANLIB=@RANLIB@
STD_INCLUDES=@STD_INCLUDES@
DEFS =@DEFS@
LDFLAGS =@LDFLAGS@
ICE_SYSTEM_LIBS=@ICE_SYSTEM_LIBS@
ICE_X11_LIBS=@ICE_X11_LIBS@
ICE_OPENGL_LIBS=@ICE_OPENGL_LIBS@
ICE_CURSES_LIBS=@ICE_CURSES_LIBS@
VPATH=${srcdir}
.SUFFIXES: .c .f .cxx
#
# Generic Defines
#
ICE_DEFINE_FLAGS =-D$(ICE_HOST)
ICE_INCLUDES = \
$(STD_INCLUDES) \
-I$(srcdir)/../libsrc \
-I$(ICE_SUPPORT_ROOT)/$(ICE_HOST)/include \
-I$(ICE_RELEASE_ROOT)/$(ICE_HOST)/include/Ndgm \
-I$(exec_prefix)/include/vtk
ICE_COMPILE_FLAGS = \
$(ICE_DEFINE_FLAGS) \
$(ICE_INCLUDES)
ICE_LDFLAGS = \
-L../libsrc \
-L$(ICE_SUPPORT_ROOT)/$(ICE_HOST)/lib \
-L$(exec_prefix)/lib \
-lXdmfFormat -lexpat -lhdf5 -lndgm \
$(ICE_SYSTEM_LIBS)
EXEC = \
SpeedTest \
XdmfFormatExample
all : $(EXEC)
clean :
rm -f $(EXEC)
rm -f *.o
rm -f *.a
rm -f *.so
rm -f core*
#
# Special
#
FromExoII : FromExoII.cxx
$(CXX) \
-o $@ \
$(CFLAGS) \
$(ICE_COMPILE_FLAGS) \
-I/unsupported/ICE/CSM/Access/inc \
$(srcdir)/FromExoII.cxx \
$(ICE_LDFLAGS) \
-L/unsupported/ICE/CSM/Access/lib \
-lexoIIv2c -lnetcdf \
$(LIBS )
#
# How To Compile
#
.cxx :
$(CXX) \
-o $@ \
$(CFLAGS) \
$(ICE_COMPILE_FLAGS) \
$< \
$(ICE_LDFLAGS) \
$(LIBS )
##########################################################
#
# Friday December 29, 2000
#
##########################################################
SHELL=/bin/sh
#
# Defined values passed from "configure"
#
prefix=@prefix@
exec_prefix=@exec_prefix@
srcdir=@srcdir@
ICE_ROOT=@ICE_ROOT@
ICE_HOST=@ICE_HOST@
ICE_SUPPORT_ROOT=@ICE_SUPPORT_ROOT@
ICE_RELEASE_ROOT=@ICE_RELEASE_ROOT@
CC=@CC@
CFLAGS=@CFLAGS@
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
F77=@F77@
FFLAGS=@FFLAGS@
JAVAC=@JAVAC@
JAVAINCLUDE=@JAVAINCLUDE@
SHLIB_LD=@SHLIB_LD@
SHLIB_LDFLAGS=@SHLIB_LDFLAGS@
SHLIB_SUFFIX=@SHLIB_SUFFIX@
AR=@AR@
RANLIB=@RANLIB@
STD_INCLUDES=@STD_INCLUDES@
DEFS =@DEFS@
LDFLAGS =@LDFLAGS@
ICE_SYSTEM_LIBS=@ICE_SYSTEM_LIBS@
ICE_X11_LIBS=@ICE_X11_LIBS@
ICE_OPENGL_LIBS=@ICE_OPENGL_LIBS@
ICE_CURSES_LIBS=@ICE_CURSES_LIBS@
VPATH=${srcdir}
.SUFFIXES: .c .f .cxx
#
# Generic Defines
#
ICE_DEFINE_FLAGS =-D$(ICE_HOST)
ICE_INCLUDES = \
$(STD_INCLUDES) \
-I$(srcdir)/../libsrc \
-I$(ICE_RELEASE_ROOT)/$(ICE_HOST)/include \
-I$(ICE_RELEASE_ROOT)/include \
-I$(ICE_SUPPORT_ROOT)/$(ICE_HOST)/include \
-I$(ICE_SUPPORT_ROOT)/include \
-I$(exec_prefix)/include \
-I$(prefix)/include
ICE_COMPILE_FLAGS = \
$(ICE_DEFINE_FLAGS) \
$(ICE_INCLUDES)
ICE_LDFLAGS = \
-L../libsrc \
-L$(ICE_SUPPORT_ROOT)/$(ICE_HOST)/lib \
-L$(ICE_RELEASE_ROOT)/$(ICE_HOST)/lib \
-L$(exec_prefix)/lib \
-lXdmf -lexpat -lhdf5 \
$(ICE_SYSTEM_LIBS)
EXEC = \
XdmfFormatExample
all : $(EXEC)
install : ice
cp ice $(ICE_ROOT)
chmod 755 $(ICE_ROOT)/ice
clean :
rm -f $(EXEC)
rm -f *.o
rm -f *.a
rm -f *.so
rm -f core*
#
# How To Compile
#
.cxx :
$(CXX) \
-o $@ \
$(CFLAGS) \
$(ICE_COMPILE_FLAGS) \
$< \
$(ICE_LDFLAGS) \
$(LIBS )
/*******************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : Id */
/* Date : $Date$ */
/* Version : $Revision$ */
/* */
/* Author: */
/* Jerry A. Clarke */
/* clarke@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2002 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*******************************************************************/
#include <Xdmf.h>
int
main( int argc, char **argv ){
XdmfDOM *DOM = new XdmfDOM();
// XdmfFormatMulti *Formatter = new XdmfFormatMulti();
XdmfTransform *Formatter = new XdmfTransform();
XdmfFormatHDF *HFormatter = new XdmfFormatHDF();
XdmfDataDesc *Desc;
XdmfXNode *Node;
XdmfArray *Array;
XdmfHDF *LowLevelH5 = new XdmfHDF();
XdmfString Attribute;
XdmfInt32 Rank, NData;
XdmfInt64 Bytes, Dimensions[ XDMF_MAX_DIMENSION ];
int n, i;
double Total = 0, Start, Now;
if( argc < 2 ) {
XdmfErrorMessage("Usage : " << argv[0] << " Filename.xml");
exit(1);
}
// Open the XML file
// DOM->SetGlobalDebugOn();
DOM->SetInputFileName( argv[ argc - 1 ] );
DOM->Parse();
NData = DOM->FindNumberOfElements("DataTransform");
cout << "Found " << NData << " DataTransform(s)" << endl;
// Find the DataTransform Desciptor
Node = DOM->FindElement( "DataTransform", 0 );
if( !Node ){
XdmfErrorMessage("Can't get node");
exit(1);
}
Formatter->SetDOM( DOM );
Desc = Formatter->ElementToDataDesc( Node );
cout << "Rank = " << Desc->GetRank() << " Shape " << Desc->GetShapeAsString() << endl;
cout << Desc->GetSelectionSize() << " Element Selected" << endl;
cout << "HyperSlab = " << Desc->GetHyperSlabAsString() << endl;
// Create the Data if it doesn't exist
Rank = Desc->GetShape( Dimensions );
Array = new XdmfArray( Desc->GetNumberType() );
Array->SetShape( Rank, Dimensions );
Array->Generate( 1, Desc->GetNumberOfElements() );
// Get the actual dataset
Node = DOM->FindElement( "DataStructure", 1 );
Attribute = DOM->Get( Node, "CData");
XDMF_WORD_TRIM(Attribute);
cout << "Dataset refers to \"" << Attribute << "\"" << endl;
HFormatter->SetDOM( DOM );
HFormatter->ArrayToElement( Array, Attribute, Node );
//Change the Shape of the Array
Array->SetNumberOfElements( Desc->GetSelectionSize() );
// Timing Loop
LowLevelH5->Open( Attribute, "rw" );
LowLevelH5->CopySelection( Desc );
cout << "Accessing " << Desc->GetSelectionSize() << " of " <<
Desc->GetNumberOfElements() << " elements" << endl;
n = 10;
for ( i = 0 ; i < n ; i++ ){
Start = ndgm_time_now();
LowLevelH5->Write( Array );
// LowLevelH5->Read( Array );
Now = ndgm_time_now();
Total += Now - Start;
Array->Generate( 0, 1 );
Start = ndgm_time_now();
LowLevelH5->Read( Array );
// LowLevelH5->Write( Array );
Now = ndgm_time_now();
Total += Now - Start;
Array->Generate( 1, 0 );
}
LowLevelH5->Close();
// Total = Now - Start;
Bytes = Array->GetSelectionSize() * Array->GetElementSize();
cout << Bytes << " Bytes x " << n << " x 2 (Read/Write) in "<< Total << " Seconds" << endl;
cout << ( Bytes * n * 2 ) / Total << endl;
exit( 0 );
}
/*******************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : Id */
/* Date : $Date$ */
/* Version : $Revision$ */
/* */
/* Author: */
/* Jerry A. Clarke */
/* clarke@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2002 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*******************************************************************/
#include <Xdmf/Xdmf.h>
using namespace std;
// Usage : XdmfFormatExample [ DataSetName ]
int
main( int argc, char **argv ) {
XdmfHDF *ExternalDataSet;
XdmfArray *InCoreData;
XdmfArray *InCoreSection;
XdmfArray *InCoreCoordinates;
XdmfInt32 Rank = 3;
// All Dimenions are "slowest changing first" : K,J,I
// and zero based
XdmfInt64 Dimensions[] = { 10, 20, 30 };
char *DataSetName;
int i, k;
double *DataFromSomewhereElse;
if(argc > 1 ) {
// i.e. NDGM:TestFile.h5:/TestDataSets/Values1
DataSetName = argv[1];
} else {
// Domain:FileName:/HDF5Directory/..../HDF5DataSetName
// Domains : FILE, NDGM, GASS (Globus), CORE (malloc)
DataSetName = "FILE:TestFile.h5:/TestDataSets/Values1";
}
// Create Some Data
// XdmfArray and XdmfHDF ( and some others ) are derived
// classes from XdmfDataDesc. XdmfDataDesc has number type,
// number shape (rank and dimensions), and number selection.
// Selection is which "part" of the entire dataset we're
// dealing with. i.e WE could have a shape of [ 100, 200, 300 ]
// but just dealing with a block of [10, 20, 30 ] somewhere in
// the middle. By default Selction == Shape ... the whole thing.
InCoreData = new XdmfArray();
InCoreData->SetNumberType( XDMF_FLOAT64_TYPE );
InCoreData->SetShape( Rank, Dimensions );
InCoreData->Generate( 0, 5999 );
// Convenience for :
// for( i = 0 ; i < InCoreData->GetNumberOfElements() ; i++ ){
// InCoreData->SetValue( i, i );
// }
//
// Create an external dataset if it doesn't exist
ExternalDataSet = new XdmfHDF();
ExternalDataSet->CopyType( InCoreData );
ExternalDataSet->CopyShape( InCoreData );
// In am MPI app the External Dataset would
// probable be much bigger that each node's InCore.
// i.e. ExternalDataSet->SetShape( 3, GloablDomainDimensions )
// but here we'll deal with just the InCore dataset size.
ExternalDataSet->Open( DataSetName, "rw" );
// Write the Data
ExternalDataSet->Write( InCoreData );
ExternalDataSet->Close();
// Now Read in 4 values from the "corners"
InCoreCoordinates = new XdmfArray();
// Most Methods have a "FromString" convenience method.
// This makes wrapping for Python/Tcl/Java easier
InCoreCoordinates->SetNumberTypeFromString( "XDMF_FLOAT64_TYPE" );
InCoreCoordinates->SetShapeFromString("4");
// This is just the same dataset we wrote
// number type and shape get (re)set on Open
// ExternalDataSet->Open( DataSetName, "r" );
// Selections can be :
// HyperSlab - Start, Stride, Count for Each Dimension
// Coordinate - Parametric Coordinates
// Function - Lex/Yacc stuff .... $0 * $1 / 1.2
ExternalDataSet->Open( DataSetName, "r" );
ExternalDataSet->SelectCoordinatesFromString("0 0 0 0 0 29 9 19 0 9 19 29");
ExternalDataSet->Read( InCoreCoordinates );
ExternalDataSet->Close();
cout << endl;
cout << "4 of the Corners == ";
DataFromSomewhereElse = (double *)InCoreCoordinates->GetDataPointer();
for( k = 0 ; k < 4 ; k++ ){
cout << " " << *DataFromSomewhereElse++;
}
cout << endl;
InCoreSection = new XdmfArray();
// Instead of allocating itself, use
// an external pointer : core dumps are
// your fault !!
DataFromSomewhereElse = new double( 150 );
InCoreSection->SetDataPointer( DataFromSomewhereElse );
InCoreSection->SetNumberTypeFromString( "XDMF_FLOAT64_TYPE" );
// Make a 2D array to read back a section of the data
// We'll read in one "J" PLane
InCoreSection->SetShapeFromString("10 15");
ExternalDataSet->Open( DataSetName, "r" );
ExternalDataSet->SelectHyperSlabFromString("0 9 0", "1 1 2", "10 1 15");
// So from a 10x20x30 data set, start at 0,9,0. Stride 2 in Idim
// and read in 10 K x 1 J x ( 30 / 2 ) = 15 I ... a slice
ExternalDataSet->Read( InCoreSection );
cout << endl;
for( k = 0 ; k < 10 ; k++ ){
cout << "k = " << k << ":";
for( i = 0 ; i < 15 ; i++ ){
cout << " " << *DataFromSomewhereElse++;
}
cout << endl;
}
exit(0);
}
#!/bin/ksh
# Defaults
IceCmd=`whence $0`
IceCmdDir=`dirname $IceCmd`
StableVersion=02.05
use64="Yes"
version=$StableVersion
args=""
prefix=@prefix@
exec_prefix=@exec_prefix@
ICE_ROOT=@ICE_ROOT@
ICE_SUPPORT_ROOT=@ICE_SUPPORT_ROOT@
ICE_RELEASE_ROOT=@ICE_RELEASE_ROOT@
# Parse Comand Line
while [ $# -gt 0 ]
do
case $1 in
-use32bit | -32 | -32bit )
use64=""
;;
-use64bit | -64 | -64bit )
use64="Yes"
;;
-version | -v )
shift
version=$1
;;
-h | -help | --help )
echo Usage : `$0` "[ -64 -32 -version ##.## ] commands"
exit
;;
*)
nw=`echo $1 | wc -w`
if [ $nw -gt 1 ]
then
args="$args \"$1\""
else
args="$args $1"
fi
;;
esac
shift
done
ICE_ROOT=${ICE_ROOT:-""}
if [ "$ICE_ROOT" = "" ]
then
ICE_ROOT=$IceCmdDir
fi
# ICE_ROOT Must Be Set By Now
ICE_ROOT=${ICE_ROOT:?"Environment Variable Unset : Exiting"}
#
# Set the Support and Release Directories
#
ICE_SUPPORT_ROOT=${ICE_SUPPORT_ROOT:-""}
if [ "$ICE_SUPPORT_ROOT" = "" ]
then
ICE_SUPPORT_ROOT=$ICE_ROOT/Support$version
fi
ICE_RELEASE_ROOT=${ICE_RELEASE_ROOT:-""}
if [ "$ICE_RELEASE_ROOT" = "" ]
then
ICE_RELEASE_ROOT=$ICE_ROOT/Release$version
fi
if test -r $ICE_SUPPORT_ROOT
then
set Status="OK"
else
echo "Unusable Support Directory $ICE_SUPPORT_ROOT"
exit
fi
if test -r $ICE_RELEASE_ROOT
then
set Status="OK"
else
echo "Unusable Release Directory $ICE_RELEASE_ROOT"
exit
fi
PATH=${PATH-""}
LD_LIBRARY_PATH=${LD_LIBRARY_PATH-""}
LD_LIBRARYN32_PATH=${LD_LIBRARYN32_PATH-""}
LD_LIBRARY64_PATH=${LD_LIBRARY64_PATH-""}
PATH=$ICE_ROOT:$PATH
PATH=$ICE_SUPPORT_ROOT/bin:$PATH
PATH=$ICE_RELEASE_ROOT/bin:$PATH
PATH=$ICE_RELEASE_ROOT/lib/python:$PATH
PATH=$prefix/bin:$PATH
PATH=$exec_prefix/bin:$PATH
ICE_HOST=${ICE_HOST:-`uname -s`}
case $ICE_HOST in
IRIX64 )
Version=`uname -r`
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib/vtk
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_RELEASE_ROOT/IRIXN32/lib
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$prefix/lib
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$exec_prefix/lib
LD_LIBRARY64_PATH=$LD_LIBRARY64_PATH:$ICE_SUPPORT_ROOT/IRIX64/lib
LD_LIBRARY64_PATH=$LD_LIBRARY64_PATH:$ICE_SUPPORT_ROOT/IRIX64/lib/vtk
LD_LIBRARY64_PATH=$LD_LIBRARY64_PATH:$ICE_RELEASE_ROOT/IRIX64/lib
LD_LIBRARYN32_PATH=$LD_LIBRARY64_PATH:$prefix/lib
LD_LIBRARYN32_PATH=$LD_LIBRARY64_PATH:$exec_prefix/lib
if [ "$use64" = "Yes" ]
then
PATH=$ICE_SUPPORT_ROOT/IRIXN32/bin:$PATH
PATH=$ICE_SUPPORT_ROOT/IRIX64/bin:$PATH
PATH=$ICE_RELEASE_ROOT/IRIXN32/bin:$PATH
PATH=$ICE_RELEASE_ROOT/IRIX64/bin:$PATH
else
ICE_HOST=IRIXN32
PATH=$ICE_SUPPORT_ROOT/IRIX64/bin:$PATH
PATH=$ICE_SUPPORT_ROOT/IRIXN32/bin:$PATH
PATH=$ICE_RELEASE_ROOT/IRIX64/bin:$PATH
PATH=$ICE_RELEASE_ROOT/IRIXN32/bin:$PATH
fi
;;
IRIX )
Version=`uname -r`
if test $Version -lt 6; then
ICE_HOST=IRIX32
fi
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib/n32
LD_LIBRARY_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib
LD_LIBRARY_PATH=$LD_LIBRARYN32_PATH:$ICE_SUPPORT_ROOT/IRIXN32/lib/vtk
LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:$ICE_RELEASE_ROOT/IRIXN32/lib
LD_LIBRARY_PATH=$LD_LIBRARYN32_PATH:$ICE_RELEASE_ROOT/IRIXN32/lib
LD_LIBRARYN32_PATH=$LD_LIBRARY64_PATH:$prefix/lib
LD_LIBRARYN32_PATH=$LD_LIBRARY64_PATH:$exec_prefix/lib
LD_LIBRARY_PATH=$LD_LIBRARY64_PATH:$prefix/lib
LD_LIBRARY_PATH=$LD_LIBRARY64_PATH:$exec_prefix/lib