Commit 060f4b00 authored by gsell's avatar gsell

changesets 3713,3714,3725 merged from sandbox

parent c3f6a514
......@@ -2,7 +2,6 @@
/AUTHORS -text
/COPYING -text
/ChangeLog -text
/GNUmakefile.orig -text
/Makefile.am -text
/NEWS -text
/README -text
......
UNAME := $(shell uname | perl -pe 's/(sn\d\d\d\d|jsimpson)/UNICOS\/mk/')
# for host specific options
HOST := $(shell hostname)
# for processor-specific options
ifeq ($(UNAME), Linux)
PROC := $(shell uname -p)
endif
CXX = c++
CC = cc
H5HOME = /usr/local/hdf5
CFLAGS = -g -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -lz -lm
# MacOS-X Serial
ifeq ($(UNAME), Darwin)
ifeq ($(PARALLEL), yes)
CXX = g++
CC = mpicc
H5HOME = /usr/local
CFLAGS = -O -g -I$(H5HOME)/include -DPARALLEL_IO
LDFLAGS = -L$(H5HOME)/lib -lmpich -lpmpich -lhdf5 -lz -lm
else
CXX = c++
CC = cc
F90 = xlf
H5HOME = /usr/local
CFLAGS = -O -g -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -lz -lm
endif
endif
# SGI MIPS/Irix
ifeq ($(UNAME), IRIX64)
CXX = CC
CC = cc
F90 = f90
ifeq ($(PARALLEL), yes)
H5HOME = $(HDF5_DIR)
CFLAGS = -64 -O3 -I$(H5HOME)/include -DPARALLEL_IO
LDFLAGS = -64 -O3 -L$(H5HOME)/lib -lhdf5 -lz -lmpi -lm
else
H5HOME = /usr/local
CFLAGS = -O3 -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -lz -lm
endif
endif
# AIX/SP-2 Parallel/serial : Seaborg
ifeq ($(UNAME), AIX)
ifeq ($(PARALLEL), yes) # parallel
CXX = mpCC_r
CC = mpxlc_r
# H5HOME = /usr/common/usg/hdf5_64/1.4.5-post2/parallel
H5HOME = /usr/common/usg/hdf5_64/1.6.1/parallel
# /usr/common/usg/hdf5/1.4.4/parallel
H4HOME = /usr/common/usg/hdf/default
OPT = -qarch=auto -qtune=auto-qcache=auto -O3 -qhot
CFLAGS = -q64 -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -L$(H4HOME)/lib -lz -lsz -lm
else # serial
CXX = xlC
CC = xlc
H5HOME = /usr/common/usg/hdf5/1.4.4/serial
H4HOME = /usr/common/usg/hdf/default
OPT = -qarch=auto -qtune=auto-qcache=auto -O3 -qhot
CFLAGS = -g -bmaxdata:800000000 -bmaxstack:256000000 -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -L$(H4HOME)/lib -lz -lm
endif
endif
# Linux
ifeq ($(UNAME), Linux)
# if this machine is NERSC/Davinci Altix system
ifeq ($(PROC), ia64)
CC = icc
CXX = icc
ifeq ($(PARALLEL), yes)
# IA64 Linux Parallel
ifeq ($(HOST), davinci)
H5HOME = $(HDF5_PAR)
MPILIB = -lmpi
else
H5HOME = /usr/local
HDF5_PAR_LIB = -L$(H5HOME)/lib -lhdf5 -lz -lm
HDF5_PAR_INCLUDE = -I$(H5HOME)/include
MPIHOME = /usr/local
MPILIB = -lmpich
endif # HOST
CFLAGS = -O3 -DPARALLEL_IO -DH5_HAVE_PARALLEL $(HDF5_PAR_INCLUDE)
LDFLAGS = $(HDF5_PAR_LIB) $(MPILIB)
else # IA64 Linux Serial
CFLAGS = -O3 $(HDF5_INCLUDE)
LDFLAGS = $(HDF5_LIB) -lm
endif # PARALLEL
# else this is standard IA32 linux
else
ifeq ($(PARALLEL), yes)
# Linux Parallel
CC = gcc
CXX = g++
H5HOME = /usr/local
MPIHOME = /usr/local
CFLAGS = -O -g -DPARALLEL_IO -DH5_HAVE_PARALLEL -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -lmpich -lrt -lz -lm
else # Linux Serial
CXX = g++
CC = gcc
CFLAGS = -O -g -I$(H5HOME)/include
LDFLAGS = -L$(H5HOME)/lib -lhdf5 -lz -lm
endif # !PARALLEL
endif # PROC!ia64
endif # !Linux
ifeq ($(PARALLEL), yes) #parallel
ifdef F90
all: H5PartTest H5PartTest.o H5Part.o H5PartTestParallel H5PartAndreasTest H5PartF.o
else
all: H5PartTest H5PartTest.o H5Part.o H5PartTestParallel H5PartAndreasTest
endif
else
ifdef F90
all: H5PartTest H5PartTest.o H5Part.o H5PartF.o
else
all: H5PartTest H5PartTest.o H5Part.o
endif
endif
include rules.make
......@@ -105,18 +105,18 @@ h5priv_find_idlist (
if (!list) {
H5_PRIV_API_LEAVE (-1);
}
register h5_loc_idx_t low = 0;
register h5_loc_idx_t high = list->num_items - 1;
register h5_loc_id_t diff;
register h5_loc_id_t mid;
const h5_loc_id_t face_idx = h5tpriv_get_face_idx(item);
const h5_loc_id_t elem_idx = h5tpriv_get_elem_idx(item);
register size_t low = 0;
register size_t mid;
register size_t high = list->num_items - 1;
register h5_loc_idx_t diff;
const h5_loc_id_t face_id = h5tpriv_get_face_id(item);
const h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx(item);
while (low <= high) {
mid = (low + high) / 2;
diff = h5tpriv_get_elem_idx(list->items[mid]) - elem_idx;
// if element indices are equal, we decide on the face indices
if (diff == 0) {
diff = h5tpriv_get_face_idx(list->items[mid]) - face_idx;
diff = h5tpriv_get_face_id (list->items[mid]) - face_id;
}
if ( diff > 0 )
high = mid - 1;
......
......@@ -57,19 +57,22 @@
#define H5T_FACE_MASK (0x0f)
#define H5T_TYPE_MASK (0x70)
#define h5tpriv_set_entity_type( type, elem_idx ) \
(((type) << (BITS_OF(elem_idx)-4)) | (elem_idx))
#define h5tpriv_get_entity_type( entity_id ) \
((entity_id >> (BITS_OF(entity_id)-8)) & H5T_TYPE_MASK)
#if 0
enum elem_types {
vertex = 1, // 1 vertex
edge, // 2 vertices
triangle, // 3 vertices
quadrangle, // 4 vertices
tetrahedron, // 4 vertices
pyramid, // 5 vertices
prism, // 6 vertices
hexahedron // 8 vertices
};
#endif
#define h5tpriv_build_entity_id( type, face_idx, elem_idx ) \
(((type) | (face_idx)) << (BITS_OF(elem_idx)-8) | (elem_idx))
#define h5tpriv_build_entity_id2( face_id, elem_idx ) \
(((face_id) << (BITS_OF(elem_idx)-8)) | \
(elem_idx))
#define h5tpriv_build_vertex_id( face_idx, elem_idx ) \
(h5tpriv_build_entity_id (H5T_TYPE_VERTEX, face_idx, elem_idx))
......@@ -82,6 +85,9 @@
#define h5tpriv_build_tet_id( face_idx, elem_idx ) \
(h5tpriv_build_entity_id (H5T_TYPE_TET, face_idx, elem_idx))
#define h5tpriv_get_entity_type( entity_id ) \
((entity_id >> (BITS_OF(entity_id)-8)) & H5T_TYPE_MASK)
#define h5tpriv_get_face_idx( entity_id ) \
(((entity_id) >> (BITS_OF(entity_id)-8)) & H5T_FACE_MASK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment