Skip to content
Snippets Groups Projects
Commit 4c56a713 authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Experimental (commented out and not used) code for block-wise
allocation of DOFs.
parent 65996c37
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,32 @@ AC_CONFIG_COMMANDS([demo],
find demo -exec chmod u+rwX \{\} \;
fi])
AC_CONFIG_COMMANDS([dof_free_bit.h],
[: ${TMPDIR=/tmp}
TARGET_NEW=${TMPDIR}/dof_free_bit.h
TARGET=alberta/src/Common/dof_free_bit.h
${SHELL} ${srcdir}/mkdoffreemasks.sh ${BITS} 1 > ${TARGET_NEW}
if test -f ${TARGET} && cmp ${TARGET} ${TARGET_NEW} > /dev/null 2>&1 ; then
AC_MSG_NOTICE([${TARGET} is unchanged])
else
AC_MSG_NOTICE([Creating ${TARGET}])
mv -f ${TARGET_NEW} ${TARGET}
fi],
[BITS=$(( ${ac_cv_sizeof_long} * 8 ))])
dnl AC_CONFIG_COMMANDS([dof_stride_free_bit.h],
dnl [: ${TMPDIR=/tmp}
dnl TARGET_NEW=${TMPDIR}/dof_stride_free_bit.h
dnl TARGET=alberta/src/Common/dof_stride_free_bit.h
dnl ${SHELL} ${srcdir}/mkdoffreemasks.sh ${BITS} ${BITS} > ${TARGET_NEW}
dnl if test -f ${TARGET} && cmp ${TARGET} ${TARGET_NEW} > /dev/null 2>&1 ; then
dnl AC_MSG_NOTICE([${TARGET} is unchanged])
dnl else
dnl AC_MSG_NOTICE([Creating ${TARGET}])
dnl mv -f ${TARGET_NEW} ${TARGET}
dnl fi],
dnl [BITS=$(( ${ac_cv_sizeof_long} * 8 ))])
# Collect the demo programs
DEMOSOURCES=
escsrcdir="`echo ${srcdir}|sed -e 's|\.|\\\\.|g'`"
......@@ -333,13 +359,14 @@ AC_DEFINE([_SVID_SOURCE], 1, [Define to get SVID stuff, e.g. strdup])
#
# check for some functions we need ... add more as needed.
#
AC_CHECK_FUNCS([pow sqrt strdup strchr strstr rand srand xdr_int32_t xdr_int64_t xdr_int],,
AC_CHECK_FUNCS([ffsl pow sqrt strdup strchr strstr rand srand \
xdr_int32_t xdr_int64_t xdr_int],,
[AC_MSG_ERROR([Sorry, these are needed..])])
#
# check whether we also have declarations for those functions
#
AC_CHECK_DECLS([alarm, isfinite, pow, sqrt,
AC_CHECK_DECLS([alarm, ffsl, isfinite, pow, sqrt,
strdup, strchr, strstr, rand, srand,
xdr_int32_t, xdr_int64_t, xdr_int],,,
[#include <string.h>
......
#! /bin/sh
DOF_FREE_SIZE=$1
MAX_STRIDE=$2
FW=$(( ${DOF_FREE_SIZE} / 4 ))
ALLBITS=$(( (1 << ${DOF_FREE_SIZE}) - 1 ))
if test ${ALLBITS} -eq 0; then
ALLBITS=$(( ~0 ))
fi
WRAP=$(( (80-4) / (${FW} + 4) ))
if test ${MAX_STRIDE} -gt 1; then
cat <<EOF
/* automatically generated by configure, do not edit */
#ifndef _ALBERTA_STRIDE_DOF_FREE_BIT_H_
#define _ALBERTA_STRIDE_DOF_FREE_BIT_H_
EOF
echo -n -e '\n#define MAX_STRIDE '"${MAX_STRIDE}"'\n\n'
cat <<EOF
const DOF_FREE_UNIT dof_stride_free_bit[MAX_STRIDE][DOF_FREE_SIZE] = {
EOF
else
cat <<EOF
/* automatically generated by configure, do not edit */
#ifndef _ALBERTA_DOF_FREE_BIT_H_
#define _ALBERTA_DOF_FREE_BIT_H_
const DOF_FREE_UNIT dof_free_bit[DOF_FREE_SIZE] = {
EOF
fi
STRIDE=1
while test ${STRIDE} -le ${MAX_STRIDE}; do
MASK=0
BIT=0
while test ${BIT} -lt ${STRIDE}; do
MASK=$(( ${MASK} | (1 << ${BIT}) ))
BIT=$(( ${BIT} + 1 ))
done
BIT=0
if test ${MAX_STRIDE} -gt 1; then
echo -n -e ' {\n '
else
echo -n -e ' '
fi
while test ${BIT} -lt ${DOF_FREE_SIZE}; do
VALUE=$(( (${MASK} << ${BIT}) & ${ALLBITS} ))
printf '0x%0'${FW}'x' ${VALUE}
BIT=$(( ${BIT} + 1 ))
if test ${BIT} -lt $(( ${DOF_FREE_SIZE} + ${MAX_STRIDE} - 1 )); then
if test $(( ${BIT} % ${WRAP} )) -eq 0; then
if test ${MAX_STRIDE} -gt 1; then
echo -n -e ',\n '
else
echo -n -e ',\n '
fi
else
echo -n -e ', '
fi
fi
done
if test ${MAX_STRIDE} -gt 1; then
echo -n -e '\n }'
fi
if test ${STRIDE} -lt ${MAX_STRIDE}; then
echo -n -e ',\n'
else
echo -n -e '\n'
fi
STRIDE=$(( ${STRIDE} + 1 ))
done
if test ${MAX_STRIDE} -gt 1; then
cat <<EOF
};
#endif /* _ALBERTA_DOF_STRIDE_FREE_BIT_H_ */
EOF
else
cat <<EOF
};
#endif /* _ALBERTA_DOF_FREE_BIT_H_ */
EOF
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment