Commit e20037eb authored by Kevin Dugan's avatar Kevin Dugan
Browse files

Clearing out old app

parent 51647a0e
This diff is collapsed.
Giraffe
=======
[![build status](https://xgitlab.cels.anl.gov/nek5000/giraffe/badges/develop/build.svg)](https://xgitlab.cels.anl.gov/nek5000/giraffe/commits/develop)
Giraffe uses the [MOOSE](http://www.mooseframework.org/) framework to implement multiphysics coupling with [Nek5000](https://nek5000.mcs.anl.gov/) CFD simulations. The project is a collaboration between [Idaho National Laboratory](https://www.inl.gov/) and [Argonne National Laboratory](https://www.inl.gov/) with contributions from [MIT](https://www.berkeley.edu/) and [UC-Berkeley](https://web.mit.edu/).
Requirements
------------
Giraffe requires the MOOSE environment (including PETSc, libmesh, and MOOSE). This can be installed according to the [MOOSE installation instructions](http://mooseframework.com/getting-started/). After installation you must define the following environment variables:
* `LIBMESH_DIR`: The top-level directory of your libmesh installation. If you follow the MOOSE installation instructions, this should already be set in your environment. A typical command is:
``` Shell
export $LIBMESH_DIR="$HOME/projects/moose/libmesh/installed"
```
* `MOOSE_DIR`: The top-level directory of your MOOSE installation. For Giraffe, this must be additionally set in your environment. A typical command is:
``` Shell
export $MOOSE_DIR="$HOME/projects/moose/"
```
Building Example Problems
-------------------------
### Basic compilation
Giraffe must be separately compiled for each specific problem, since Nek5000 uses static memory allocations that are specific to the problem setup. To build an example problem:
1. In the top-level Giraffe, directory use the `bootstrap` script to generate a `configure` script.
2. In the subdirectory for the example problem, run the `configure` script.
3. In the subdirctory for the example problem, run `make`.
The complete steps for the `integration_example` problem are:
``` Shell
$ cd giraffe
$ ./bootstrap
$ cd examples/integration_example
$ ../../configure
$ make
```
A successful compilation will create libraries and executables in the top-level Giraffe directory (in this case, `giraffe/lib/lib-giraffe-opt.so` and `giraffe/giraffe-opt`). **Note that, even though the libraries and executables are problem specific, they are not output to the problem's director.**
### Additional compilation options
To perform custom compilations, the `configure` script may be run with additional options. Run `./configure --help` to see a complete list of the available options and variables. Some of the most useful are:
* `CASENAME`: Specfies the basename of the Nek5000 `.usr` file. For example, if you were compiling with `integration_example.usr`, then you would specify `CASENAME="integration_example"`. The default value of `CASENAME` is the name of the example subdirectory.
* `MOOSE_DIR`: Inherited from the environment. If it is specified here, it will override the environment's value.
* `LIBMESH_DIR`: Inherited from the environment. If it is specified here, it will override the environment's value.
For the majority of situations, it is not recommended to directly specify compilers and compiler/linker flags to configure script (`CC`, `CFLAGS`, `LDFLAGS`, etc). This is because, by default, the compilers and flags are detected from the libmesh installation, which ensures a consistent compilation of Giraffe.
### Running Example Problems
``` Shell
$ cd giraffe/examples/integration_example
$ ../../giraffe-opt -i coefficient_integration.i
```
The Giraffe executable is output to the top-level Giraffe directory (in this case, `giraffe/giraffe-opt`) but must be run in the example subdirectory. To run the simulation, use:
``` Shell
$ cd examples/integration example/
$ ../../giraffe-opt -i coefficient_integration.i
```
Upon repeated runs, Nek5000 may raise an error if an output `.sch` file is present. If so, delete the `.sch` file and rerun Giraffe.
Developing Giraffe
------------------
Giraffe is ensured to be compatable with the current [MOOSE master branch](https://github.com/idaholab/moose/tree/master). However, Giraffee is **not** necessarily compatable with a current or previous version [Nek5000 master branc](https://github.com/Nek5000/Nek5000/tree/master). Hence, Giraffe includes Nek5000 as a Git **subtree** rather than a submodule.
The use of a subtree means that developers may freely modify Nek5000 as if it were a normal part of the Giraffe repo. For routine commits, pushes, and pulls to the Giraffe repository, no extra Git commands are necessary for changing `giraffe/Nek5000`. With some additional Git commands, developers may also merge upstream changes from [https://github.com/Nek5000/Nek5000](https://github.com/Nek5000/Nek5000) into `giraffe/Nek5000`. Finally, developers may also request to merge changes from `giraffe/Nek5000` to [https://github.com/Nek5000/Nek5000](https://github.com/Nek5000/Nek5000). This [blog post](http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/) from Atlassian gives a brief rundown of these operations.
#!/bin/sh
autoreconf --install
automake --add-missing --copy >/dev/null 2>&1
###############################################################################
# GIRAFFE MAKEFILE
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# FRAMEWORK_DIR - Location of the MOOSE framework
#
###############################################################################
GIRAFFE_DIR := @abs_srcdir@
MOOSE_DIR := @MOOSE_DIR@
FRAMEWORK_DIR := @MOOSE_DIR@/framework
###############################################################################
# framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
SOLID_MECHANICS := no
CONTACT := no
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := no
MISC := no
PHASE_FIELD := no
XFEM := no
include $(MOOSE_DIR)/modules/modules.mk
################################## GIRAFFE ####################################
# nek
include giraffe.mk
APPLICATION_DIR := $(GIRAFFE_DIR)
APPLICATION_NAME := giraffe
MAIN_DIR := $(APPLICATION_DIR)/src
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py integration_example)
include $(FRAMEWORK_DIR)/app.mk
###############################################################################
# Additional special case targets should be added here
@CASENAME@
@abs_builddir@
# == Source and destination directories ============================================================
VPATH := @srcdir@/Nek5000/core:@srcdir@/Nek5000/core/cmt:@srcdir@/Nek5000/core/3rd_party:@srcdir@/Nek5000/jl:@srcdir@/src_nek
srcdir := @srcdir@
builddir := @builddir@
nek_objdir := @builddir@/nek_obj
nek_includedir := @builddir@/include
# == Discovered by autoconf script
CASENAME := @CASENAME@
nek_CFLAGS := @CFLAGS@
nek_INCLUDES := -I$(builddir) -I$(nek_includedir) -I$(srcdir)/Nek5000/core -I$(srcdir)/Nek5000/core/cmt -I$(srcdir)/Nek5000/core/3rd_party -I$(srcdir)/Nek5000/jl -I$(srcdir)/src_nek
nek_CPPFLAGS := @CPPFLAGS@ @DEFS@ @nek_DEFS@ $(nek_INCLUDES)
nek_LDFLAGS := @LDFLAGS@
nek_LIBS := @LIBS@
nek_FFLAGS := @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@ @nek_DEFS@) $(nek_INCLUDES)
nek_FLIBS := @FLIBS@
nek_debug_flags := @nek_debug_flags@
nek_opt_flags := @nek_opt_flags@
nek_real8_flags := @nek_real8_flags@
jl_prefix := @jl_prefix@
# == FORTRAN objects ===============================================================================
nek_drive_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), drive))
nek_core_f_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), \
drive1 drive2 plan4 bdry coef conduct connect1 connect2 \
dssum edgec eigsolv gauss genxyz navier1 makeq navier0 \
navier2 navier3 navier4 prepost speclib map2 turb mvmesh ic \
ssolv planx mxm_wrapper hmholtz gfdm_par gfdm_op gfdm_solve \
subs1 subs2 genbox gmres hsmg convect induct perturb navier5 \
navier6 navier7 navier8 fast3d fasts calcz postpro \
cvode_driver vprops qthermal cvode_aux makeq_aux papi nek_in_situ \
readat_new nek_moose @CASENAME@))
nek_math_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), math))
nek_blas_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_blas_obj@)) # blas.o | null
nek_cmt_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_cmt_obj@)) # drive1_cmt.o ... | cmt_dummy.o
nek_lapack_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_lapack_obj@)) # dsygv.o ssygv.o | null
nek_mpi_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_mpi_obj@)) # byte_mpi.o comm_mpi.o | byte_mpi.o comm_mpi.o mpi_dummy.o
nek_mxm_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_mxm_obj@)) # mxm_std.o | mxm_std.o mxm_bgq.o
nek_neknek_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_neknek_obj@)) # singlmesh.o | multimesh.o
nek_flib_obj := $(nek_core_f_obj) $(nek_math_obj) $(nek_blas_obj) $(nek_cmt_obj) \
$(nek_lapack_obj) $(nek_mpi_obj) $(nek_mxm_obj) $(nek_neknek_obj)
# == C objects =====================================================================================
nek_core_c_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), \
byte chelpers nek_comm finiparser iniparser dictionary))
jl_core_obj := $(addprefix $(nek_objdir)/, $(patsubst %, $(jl_prefix)%.$(obj-suffix), \
gs sort sarray_transfer sarray_sort gs_local crystal comm tensor fail fcrystal))
jl_interp_obj := $(addprefix $(nek_objdir)/, $(patsubst %, $(jl_prefix)%.$(obj-suffix), \
findpts findpts_local obbox poly lob_bnd findpts_el_3 findpts_el_2))
jl_cgs_obj := $(addprefix $(nek_objdir)/, $(patsubst %, $(jl_prefix)%.$(obj-suffix), @jl_cgs_obj@))
nek_clib_obj := $(nek_core_c_obj) $(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj)
# == MOOSE app flags and objects ==================================================================
# Recursive definition (= rather than :=) is probably the right usage, since they're probably
# defined here after they're referenced by MOOSE makefile
ADDITIONAL_CPPFLAGS = @CPPFLAGS@ @DEFS@ # Used by pattern rules in moose/framework/build.mk
ADDITIONAL_INCLUDES = $(nek_INCLUDES) # Used by pattern rules in moose/framework/build.mk (through app_INCLUDES)
ADDITIONAL_LIBS = $(nek_LIBS) $(nek_FLIBS) # Used during linking in moose/framework/app.mk
ADDITIONAL_APP_OBJECTS = $(nek_flib_obj) $(nek_clib_obj) # Added to dependencies in moose/framework/app.mk
# == Rules =========================================================================================
nek5000: $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj)
@echo "Linking Executable "$@"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link \
$(libmesh_F77) $(libmesh_FFLAGS) -o $@ $^ $(libmesh_LIBS) $(libmesh_LDFLAGS) $(nek_LIBS) $(nek_LDFLAGS) $(nek_FLIBS)
$(nek_drive_obj) $(nek_core_f_obj) $(nek_cmt_obj) $(nek_math_obj) $(nek_mxm_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_mpi_obj) $(nek_neknek_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE mpiheader | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_core_c_obj): $(nek_objdir)/%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
$(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj): $(nek_objdir)/$(jl_prefix)%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
mpiheader: | $(nek_includedir)
ifneq ($(findstring mpi_dummy.o, $(nek_mpi_obj)),)
cp $(srcdir)/Nek5000/core/mpi_dummy.h $(nek_includedir)/mpif.h
else
rm -rf $(srcdir)/Nek5000/core/mpif.h $(nek_includedir)/mpif.h
endif
$(nek_objdir) $(nek_includedir):
mkdir -p $@
PHONY: mpiheader
AC_PREREQ([2.69])
AC_INIT([Nek5000], [16.0.0], [nek5000-users@lists.mcs.anl.gov])
AC_PROG_INSTALL
#AM_INIT_AUTOMAKE
#LT_PREREQ([2.2])
#LT_INIT([dlopen])
#AC_CONFIG_SRCDIR([Nek5000/core/drive1.f])
#AC_CONFIG_HEADERS([config.h])
###############################################################################
# COMMAND-LINE OPTS
###############################################################################
AC_ARG_VAR([CASENAME], [the Nek5000 case name (i.e., the name of the .usr and .rea files)])
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--disable-debug], [compile without debug flags (-g) @<:@default: enabled@:>@])],
[debug="$enableval"], [debug="yes"])
AC_ARG_ENABLE([opt],
[AC_HELP_STRING([--enable-opt], [compile with optimization flags (-O3) @<:@default: disabled@:>@])],
[opt="$enableval"], [opt="no"])
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--disable-mpi], [compile without mpi @<:@default: enabled@:>@])],
[mpi=${enableval}], [mpi=yes])
AC_ARG_ENABLE([amg],
[AS_HELP_STRING([--enable-amg], [compile without AMG coarse-grid solver @<:@default: disabled@:>@])],
[amg=${enableval}], [amg=no])
AC_ARG_ENABLE([amg-dump],
[AS_HELP_STRING([--enable-amg-dump], [if using AMG, dump setup @<:@default: disabled@:>@])],
[amg_dump=${enableval}], [amg_dump=no])
AC_ARG_ENABLE([cmt],
[AS_HELP_STRING([--enable-cmt], [compile with compressible multiphase turbulence support @<:@default: disabled@:>@])],
[cmt=${enableval}], [cmt=no])
AC_ARG_ENABLE([timer],
[AS_HELP_STRING([--disable-timer], [disable runtime statistics @<:@default: enabled@:>@])],
[timer=${enableval}], [timer=yes])
AC_ARG_ENABLE([mpi-timer],
[AS_HELP_STRING([--enable-mpi-timer], [enable MPI runtime statistics @<:@default: disabled@:>@])],
[mpi_timer=${enableval}], [mpi_timer=no])
AC_ARG_ENABLE([mpi-io],
[AS_HELP_STRING([--enable-mpi-io], [use MPI-IO I/O kernel @<:@default: disabled@:>@])],
[mpi_io=${enableval}], [mpi_io=no])
AC_ARG_ENABLE([bgq],
[AS_HELP_STRING([--enable-bgq], [enable Blue Gene optimizations (BG/Q) @<:@default: disabled@:>@])],
[bgq=${enableval}], [bgq=no])
AC_ARG_ENABLE([cvode],
[AS_HELP_STRING([--enable-cvode], [use ODE solver from Sundials to solve for IFIELD>1 @<:@default: disabled@:>@])],
[cvode=${enableval}], [cvode=no])
AC_ARG_ENABLE([moab],
[AS_HELP_STRING([--enable-moab], [enable MOAB/CUBIT support @<:@default: disabled@:>@])],
[moab=${enableval}], [moab=no])
AC_ARG_ENABLE([neknek],
[AS_HELP_STRING([--enable-neknek], [enable multidomain support @<:@default: disabled@:>@])],
[neknek=${enableval}], [neknek=no])
AC_ARG_ENABLE([nek-lapack],
[AS_HELP_STRING([--enable-nek-lapack], [enable Nek-supplied LAPACK routines @<:@default: disabled@:>@])],
[nek_lapack=${enableval}], [nek_lapack=no])
AC_ARG_ENABLE([nek-blas],
[AS_HELP_STRING([--enable-nek-blas], [enable Nek-supplied BLAS routines @<:@default: disabled@:>@])],
[nek_blas=${enableval}], [nek_blas=no])
AC_ARG_ENABLE([xsmm],
[AS_HELP_STRING([--enable-xsmm], [use libxsmm for mxm @<:@default: disabled@:>@])],
[xsmm=${enableval}], [xsmm=no])
AC_ARG_ENABLE([extbar],
[AS_HELP_STRING([--enable-extbar], [adds underscore to exit call(for BGQ) @<:@default: disabled@:>@])],
[extbar=${enableval}], [extbar=no])
AC_ARG_ENABLE([libmesh],
[AS_HELP_STRING([--enable-libmesh], [configure with compilers and flags from an existing libmesh installation @<:@default: enabled@:>@])],
[libmesh=${enableval}], [libmesh=yes])
AC_ARG_VAR([MOOSE_DIR], [directory of moose installation @<:@default: giraffe/moose/@:>@])
AC_ARG_VAR([LIBMESH_DIR], [directory of libmesh installation @<:@default: \$MOOSE_DIR/libmesh/installed/@:>@])
###############################################################################
# GET COMPILERS AND FLAGS FROM LIBMESH
###############################################################################
# Default values for $MOOSE_DIR and $LIBMESH_DIR
: "${MOOSE_DIR=$srcdir/moose}"
: "${LIBMESH_DIR=$MOOSE_DIR/libmesh/installed}"
# If libmesh is enabled, get compilers and flags from libmesh-config
# Adapted from moose/framework/build.mk
if test "x$libmesh" = "xyes"; then
# First, see if installed libmesh-config exists
libmesh_config="$LIBMESH_DIR/bin/libmesh-config"
AC_MSG_CHECKING([if $libmesh_config exists])
if test -x $libmesh_config; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
# If not, see if uninstalled libmesh-config exists
libmesh_config="$LIBMESH_DIR/contrib/bin/libmesh-config"
AC_MSG_CHECKING([if $libmesh_config exists])
if test -x $libmesh_config; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find libmesh-config script. Ensure that LIBMESH_DIR and/or MOOSE_DIR are correctly set.])
fi
fi
AC_MSG_NOTICE([getting compilers and flags from $libmesh_config])
CC="$($libmesh_config --cc)"
CFLAGS="$($libmesh_config --cflags) $CFLAGS"
CPPFLAGS="$($libmesh_config --cppflags) $CPPFLAGS"
LDFLAGS="$($libmesh_config --ldflags) $LDFLAGS"
LIBS="$($libmesh_config --libs) $LIBS"
F77="$($libmesh_config --fc)"
FFLAGS="$($libmesh_config --fflags) $FFLAGS"
fi
###############################################################################
# GET CASENAME
###############################################################################
if test "x$CASENAME" = "x"; then
CASENAME="$(basename $(pwd))"
fi
###############################################################################
# BUILT-IN CHECKS
###############################################################################
# C compiler checks
: ${CFLAGS=""} # Do not use autconf's default "-g -O2"
AC_PROG_CC # Validate C Compiler
AC_PROG_CC_C_O # Necessary for automake
AC_CHECK_SIZEOF([int *]) # Get sizeof int*, set SIZEOF_INT_P. If SIZEOF_INT_P == 8, then Nek needs -DPTRSIZE8
AC_CHECK_SIZEOF([long int]) # Get sizeof long int, set SIZEOF_LONG_INT
# Fortran compiler checks
: ${FFLAGS="$FFLAGS"} # Do not use autconf's default "-g -O2"
: ${FCFLAGS="$FCFLAGS"} # Do not use autconf's default "-g -O2"
AC_PROG_F77 # Validate F77 compiler
AC_PROG_F77_C_O # Necessary for automake
AC_F77_LIBRARY_LDFLAGS # Determine -l and -L flags, append to $FLIBS
AC_F77_WRAPPERS # Discover how to call F77 funcs from C, set F77_FUNC macro. If underscore, then Nek needs -DUNDERSCORE
# Discover flags for Fortran preprocessing
fc_old="$F77"; FC="$F77"
AC_FC_PP_SRCEXT([f]) # Discover what flags are needed to preprocess .f files, define FCFLAGS_f
AC_FC_PP_DEFINE # Discover the flag (eg, -D, -Df) is used to define PP symbols, define FC_DEFINE
FC="$fc_old"
###############################################################################
# FIND F77 FLAG FOR DEFAULT 8-BYTE FLOATS
###############################################################################
AC_LANG_PUSH([Fortran 77])
fflags_old="$FFLAGS"
nek_real8_flags=""
for flag in dnl
"-r8 -fpconstant" dnl Intel
"-r8" dnl PGI, some others
"-fdefault-real-8 -fdefault-double-8" dnl GNU
"-qrealsize=8 -qdpc=e" dnl IBM
"-s default64"; dnl Cray
do
FFLAGS="$flag"
AC_MSG_CHECKING([if Fortran 77 compiler accepts $flag])
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(, [[ real foo]],),
AC_MSG_RESULT([yes]) && nek_real8_flags="$flag" && break,
AC_MSG_RESULT([no])
)
done
AC_LANG_POP([Fortran 77])
FFLAGS="$fflags_old"
if test "x$nek_real8_flags" = "x"; then
AC_MSG_FAILURE([could not determine Fortran flag for 8-byte floats])
fi
AC_SUBST([nek_real8_flags])
###############################################################################
# SET NEK's PREPROCESSOR MACROS
###############################################################################
nek_DEFS=""
# Enable debug flags
if test "x$debug" = "xyes"; then
nek_debug_flags="-g"
fi
AC_SUBST([nek_debug_flags])
# Enable optimization flags
if test "x$opt" = "xyes" || test "x$bgq" = "xyes"; then
nek_opt_flags="-O3"
else
nek_opt_flags="-O2"
fi
AC_SUBST([nek_opt_flags])
# Check if pointer size == 8
if test "$ac_cv_sizeof_int_p" -eq 8; then
nek_DEFS="-DPTRSIZE8 $nek_DEFS"
fi
# See if 'underscore' is in mangling scheme.
if echo "$ac_cv_f77_mangling"| tr -d @<:@:blank:@:>@ | grep '\<underscore\>' > /dev/null ; then
nek_DEFS="-DUNDERSCORE $nek_DEFS"
fi
# See if MPI is enabled
if test "x$mpi" = "xyes"; then
nek_DEFS="-DMPI $nek_DEFS"
nek_mpi_obj="byte_mpi comm_mpi"
else
nek_mpi_obj="byte_mpi comm_mpi mpi_dummy"
fi
AC_SUBST([nek_mpi], [$mpi])
AC_SUBST([nek_mpi_obj])
# Always define jl_prefix
AC_SUBST([jl_prefix], [jl_])
nek_DEFS="-DPREFIX=jl_ $nek_DEFS"
# See if AMG is enabled
if test "x$amg" = "xyes"; then
jl_cgs_obj="amg fcrs"
else
jl_cgs_obj="sparse_cholesky xxt fcrs"
fi
AC_SUBST([jl_cgs_obj])
# See if AMG_DUMP is enabled
if test "x$amg_dump" = "xyes"; then
nek_DEFS="-DAMG_DUMP $nek_DEFS"
fi
# See if CMT is enabled
if test "x$cmt" = "xyes"; then
nek_DEFS="-DCMT $nek_DEFS"
nek_cmt_obj="drive1_cmt drive2_cmt driver3_cmt face ausm MixtPerf intpdiff diffusive_cmt eqnsolver_cmt surface_fluxes bc inflow_bc outflow_bc wall_bc step filters_cmt diagnostics"
else
nek_cmt_obj="cmt_dummy"
fi
AC_SUBST([nek_cmt_obj])
# Check if sizeof long int == 8
if test "$ac_cv_sizeof_long_int" -eq 8; then
nek_DEFS="-DLONGINT8 $nek_DEFS"
fi
# See if timer is enabled
if test "x$timer" = "xno"; then
nek_DEFS="-DNOTIMER $nek_DEFS"
fi
# Always set GLOBAL_LONG_LONG
nek_DEFS="-DGLOBAL_LONG_LONG $nek_DEFS"
# TODO: Set defs for MOAB
# See if neknek is enabled
if test "x$neknek" = "xyes"; then
nek_DEFS="-DNEKNEK $nek_DEFS"
nek_neknek_obj="multimesh"
else
nek_neknek_obj="singlmesh"
fi
AC_SUBST([nek_neknek_obj])
# TODO: Set defs for CVODE
# TODO: Set defs for AMG_DUMP
# TODO: Set defs for BLAS_MXM
# == BLAS and MXM handling =====================================================
# TODO:
# * Set -O3 flag if $bgq = yes
# * Consistency check between options
# * If automake, AM_CONDITIONAL([BGQ], [test "x$bgq" = "xyes"]), etc.
if test "x$bgq" = "xyes"; then
nek_DEFS="-DBGQ $nek_DEFS"
nek_blas_obj=""
nek_mxm_obj="mxm_std mxm_bgq"
else
if test "x$xsmm" = "xyes"; then
nek_DEFS="-DXSMM $nek_DEFS"
nek_blas_obj="blas"
nek_mxm_obj="mxm_std"
else
if test "x$nek_blas" = "xyes"; then
nek_blas_obj="blas"
nek_mxm_obj="mxm_std"
else
nek_DEFS="-DBLAS_MXM $nek_DEFS"
nek_blas_obj=""
nek_mxm_obj="mxm_std"
fi
fi
fi
AC_SUBST([nek_blas_obj])
AC_SUBST([nek_mxm_obj])
# == LAPACK handling ==========================================================
# TODO:
# * if automake, AM_CONDITIONAL([NO_LAPACK], [test "x$nek_lapack" = "xno"])
if test "x$nek_lapack" = "xyes"; then
nek_lapack_obj="dsygv ssygv"
else
nek_DEFS="-DNO_LAPACK $nek_DEFS"
nek_lapack_obj=""
fi
AC_SUBST([nek_lapack_obj])
AC_SUBST([nek_DEFS])
###############################################################################
# SIZE FILE HANDLING
###############################################################################
AC_CHECK_FILE([SIZE], , AC_MSG_ERROR([could not find SIZE file in current directory]))
AC_MSG_NOTICE([tweaking SIZE file])
# == General subroutines ======================================================
cat SIZE | grep -i 'lxo' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' parameter(lxo = lx1) ! max output grid size (lxo>=lx1)' >>SIZE
fi
cat SIZE | grep -i 'lpart' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' parameter(lpart = 1 ) ! max number of particles/proc' >>SIZE
fi
cat SIZE | grep -i 'ax1' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' integer ax1,ay1,az1,ax2,ay2,az2' >> SIZE
echo ' parameter (ax1=lx1,ay1=ly1,az1=lz1,ax2=lx2,ay2=ly2,az2=lz2) ! running averages' >> SIZE
fi
cat SIZE | grep -i 'lys=lxs' >/dev/null
if test $? -ne 0; then
cat SIZE | grep -iv lxs > SIZE.x; mv SIZE.x SIZE # Clean existing SIZE file of old version
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' parameter (lxs=1,lys=lxs,lzs=(lxs-1)*(ldim-2)+1) !New Pressure Preconditioner' >> SIZE
fi
cat SIZE | grep -i 'lfdm' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' parameter (lfdm=0) ! == 1 for fast diagonalization method' >> SIZE
fi
cat SIZE | grep -i 'nio' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' common/IOFLAG/nio ! for logfile verbosity control' >> SIZE
fi
# == CVODE subroutines ========================================================
if test "x$cvode" = "xyes"; then
cat SIZE | grep -i 'cv_maxl' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' integer cv_maxl' >> SIZE
echo ' parameter(cv_maxl = 20 ) ! Size of Krylov Space' >>SIZE
fi
cat SIZE | grep -i 'cv_delt' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' real cv_delt' >> SIZE
echo ' parameter(cv_delt = 0.1 ) ! linear convergence factor ' >>SIZE
fi
cat SIZE | grep -i 'cv_sigs' >/dev/null
if test $? -ne 0; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' real cv_sigs' >> SIZE
echo ' parameter(cv_sigs = 0.01) ! Jacobian DQ perturbation scaling factor' >>SIZE
fi
fi
# == CMT subroutines ==========================================================
cat SIZE | grep -i 'toteq' >/dev/null
if test $? -ne 0; then
if test "x$cmt" = "xyes"; then
echo >>SIZE
echo 'c automatically added by makenek' >>SIZE
echo ' integer toteq' >> SIZE