├── .gitignore ├── .travis.yml ├── README.md ├── docs ├── SNAP-brief-description.pdf ├── SNAP-overview-presentation-2015.pdf ├── SNAP-proxy-description.pdf └── SNAP-users-manual.pdf ├── ports ├── README.md ├── kc │ ├── Makefile │ ├── main.cpp │ └── snappy.hpp ├── kokkos-direct │ ├── Makefile │ ├── main.cpp │ └── snappy.hpp ├── kokkos-hp-opt │ ├── Makefile │ ├── main.cpp │ └── snappy.hpp ├── kokkos-hp │ ├── Makefile │ ├── main.cpp │ └── snappy.hpp ├── legion │ ├── LICENSE │ ├── README.md │ ├── input │ │ ├── base.in │ │ ├── huge_1K_1x1x1.in │ │ ├── huge_2K_1x1x1.in │ │ ├── huge_4K_1x1x1.in │ │ ├── huge_512_1x1x1.in │ │ ├── large_1K_1x1x1.in │ │ ├── large_2K_1x1x1.in │ │ ├── large_4K_1x1x1.in │ │ ├── large_512_1x1x1.in │ │ ├── medium_1K_1x1x1.in │ │ ├── medium_2K_1x1x1.in │ │ ├── medium_4K_1x1x1.in │ │ ├── medium_512_1x1x1.in │ │ ├── mms.in │ │ ├── simple.in │ │ ├── small_1K_1x1x1.in │ │ ├── small_2K_1x1x1.in │ │ ├── small_4K_1x1x1.in │ │ ├── small_512_1x1x1.in │ │ ├── test.in │ │ ├── tiny_1K_1x1x1.in │ │ ├── tiny_2K_1x1x1.in │ │ ├── tiny_4K_1x1x1.in │ │ └── tiny_512_1x1x1.in │ └── src │ │ ├── Makefile │ │ ├── convergence.cc │ │ ├── convergence.h │ │ ├── expxs.cc │ │ ├── expxs.h │ │ ├── gpu_expxs.cu │ │ ├── gpu_inner.cu │ │ ├── gpu_outer.cu │ │ ├── gpu_sweep.cu │ │ ├── init.cc │ │ ├── init.h │ │ ├── inner.cc │ │ ├── inner.h │ │ ├── main.cc │ │ ├── mapper.cc │ │ ├── mms.cc │ │ ├── mms.h │ │ ├── outer.cc │ │ ├── outer.h │ │ ├── snap.cc │ │ ├── snap.h │ │ ├── snap_cuda_help.h │ │ ├── snap_types.h │ │ ├── sweep.cc │ │ └── sweep.h ├── snap-c │ ├── LineCount │ ├── LineReport │ ├── Makefile │ ├── center_src │ │ ├── chkall │ │ ├── fin01 │ │ ├── fin02 │ │ ├── fin03 │ │ ├── fin04 │ │ ├── fin05 │ │ ├── fin06 │ │ ├── fin07 │ │ ├── fin08 │ │ ├── fin09 │ │ ├── fin10 │ │ ├── fin11 │ │ ├── fin12 │ │ ├── fout01 │ │ ├── fout02 │ │ ├── fout03 │ │ ├── fout04 │ │ ├── fout05 │ │ ├── fout06 │ │ ├── fout07 │ │ ├── fout08 │ │ ├── fout09 │ │ ├── fout10 │ │ ├── fout11 │ │ ├── fout12 │ │ ├── genall │ │ ├── in01 │ │ ├── in02 │ │ ├── in03 │ │ ├── in04 │ │ ├── in05 │ │ ├── in06 │ │ ├── in07 │ │ ├── in08 │ │ ├── in09 │ │ ├── in10 │ │ ├── in11 │ │ ├── in12 │ │ ├── mvnewtoold │ │ ├── out01 │ │ ├── out02 │ │ ├── out03 │ │ ├── out04 │ │ ├── out05 │ │ ├── out06 │ │ ├── out07 │ │ ├── out08 │ │ ├── out09 │ │ ├── out10 │ │ ├── out11 │ │ └── out12 │ ├── control.c │ ├── data.c │ ├── dealloc.c │ ├── dim1_sweep.c │ ├── dim3_sweep.c │ ├── expxs.c │ ├── geom.c │ ├── inner.c │ ├── input.c │ ├── mms.c │ ├── octsweep.c │ ├── outer.c │ ├── output.c │ ├── plib.c │ ├── setup.c │ ├── sn.c │ ├── snap.h │ ├── snap_main.c │ ├── solvar.c │ ├── sweep.c │ ├── time.c │ ├── translv.c │ ├── utils.c │ └── version.c ├── snap-kf │ ├── Makefile │ ├── README.md │ ├── analyze.f90 │ ├── control.f90 │ ├── data.f90 │ ├── dealloc.f90 │ ├── dim1_sweep.f90 │ ├── dim3_sweep.f90 │ ├── expxs.f90 │ ├── geom.f90 │ ├── global.f90 │ ├── gsnap │ ├── inner.f90 │ ├── input.f90 │ ├── kokkos_c_interface.cpp │ ├── kokkos_c_interface.hpp │ ├── kokkos_f_interface.f90 │ ├── mkba_sweep.f90 │ ├── mms.f90 │ ├── octsweep.f90 │ ├── outer.f90 │ ├── output.f90 │ ├── plib.F90 │ ├── setup.f90 │ ├── sn.f90 │ ├── snap_main.f90 │ ├── solvar.f90 │ ├── sweep.f90 │ ├── thrd_comm.f90 │ ├── time.F90 │ ├── translv.f90 │ ├── utils.f90 │ └── version.f90 └── viz │ ├── sweep_time.py │ └── viz_sweep.py ├── qasnap ├── Readme ├── benchmark │ ├── inp │ └── out ├── center_src │ ├── chkall │ ├── fin01 │ ├── fin02 │ ├── fin03 │ ├── fin04 │ ├── fin05 │ ├── fin06 │ ├── fin07 │ ├── fin08 │ ├── fin09 │ ├── fin10 │ ├── fin11 │ ├── fin12 │ ├── fin13 │ ├── fin14 │ ├── fout01 │ ├── fout02 │ ├── fout03 │ ├── fout04 │ ├── fout05 │ ├── fout06 │ ├── fout07 │ ├── fout08 │ ├── fout09 │ ├── fout10 │ ├── fout11 │ ├── fout12 │ ├── fout13 │ ├── fout14 │ ├── genall │ ├── in01 │ ├── in02 │ ├── in03 │ ├── in04 │ ├── in05 │ ├── in06 │ ├── in07 │ ├── in08 │ ├── in09 │ ├── in10 │ ├── in11 │ ├── in12 │ ├── in13 │ ├── in14 │ ├── mvnewtoold │ ├── old-iterations │ ├── out01 │ ├── out02 │ ├── out03 │ ├── out04 │ ├── out05 │ ├── out06 │ ├── out07 │ ├── out08 │ ├── out09 │ ├── out10 │ ├── out11 │ ├── out12 │ ├── out13 │ ├── out14 │ └── quick-check ├── mms_src │ ├── 1d_fixup_st.flux.old │ ├── 1d_fixup_st.inp │ ├── 1d_fixup_st.old │ ├── 1d_fixup_st.slgg.old │ ├── 1d_fixup_t1.inp │ ├── 1d_fixup_t1.old │ ├── 1d_fixup_t2.inp │ ├── 1d_fixup_t2.old │ ├── 1d_mms_st.flux.old │ ├── 1d_mms_st.inp │ ├── 1d_mms_st.old │ ├── 1d_mms_st.slgg.old │ ├── 1d_mms_t1.inp │ ├── 1d_mms_t1.old │ ├── 1d_mms_t2.inp │ ├── 1d_mms_t2.old │ ├── 2d_fixup_st.flux.old │ ├── 2d_fixup_st.inp │ ├── 2d_fixup_st.old │ ├── 2d_fixup_st.slgg.old │ ├── 2d_fixup_t1.inp │ ├── 2d_fixup_t1.old │ ├── 2d_fixup_t2.inp │ ├── 2d_fixup_t2.old │ ├── 2d_mms_st.flux.old │ ├── 2d_mms_st.inp │ ├── 2d_mms_st.old │ ├── 2d_mms_st.slgg.old │ ├── 2d_mms_t1.inp │ ├── 2d_mms_t1.old │ ├── 2d_mms_t2.inp │ ├── 2d_mms_t2.old │ ├── 3d_fixup_st.flux.old │ ├── 3d_fixup_st.inp │ ├── 3d_fixup_st.old │ ├── 3d_fixup_st.slgg.old │ ├── 3d_fixup_t1.inp │ ├── 3d_fixup_t1.old │ ├── 3d_fixup_t2.inp │ ├── 3d_fixup_t2.old │ ├── 3d_mms_st.flux.old │ ├── 3d_mms_st.inp │ ├── 3d_mms_st.old │ ├── 3d_mms_st.slgg.old │ ├── 3d_mms_t1.inp │ ├── 3d_mms_t1.old │ ├── 3d_mms_t2.inp │ ├── 3d_mms_t2.old │ ├── 3d_mod_fix_n.inp │ ├── 3d_mod_fix_n.old │ ├── 3d_mod_fixup.inp │ ├── 3d_mod_fixup.old │ ├── 3d_model.inp │ ├── 3d_model.old │ ├── 3d_model_n.inp │ ├── 3d_model_n.old │ ├── chkall │ ├── genall │ ├── mvnewtoold │ ├── old-iterations │ └── quick-check └── sample │ ├── inp │ └── out ├── snap_release_v105.txt ├── snap_release_v106.txt ├── snap_release_v107.txt ├── snap_release_v108.txt ├── snap_release_v109.txt ├── snap_release_v110.txt ├── snap_release_v111.txt ├── snap_release_v112.txt └── src ├── LineCount ├── LineReport ├── Lines ├── Makefile ├── analyze.f90 ├── control.f90 ├── data.f90 ├── dealloc.f90 ├── dim1_sweep.f90 ├── dim3_sweep.f90 ├── expxs.f90 ├── geom.f90 ├── global.f90 ├── inner.f90 ├── input.f90 ├── mainpage.dox ├── mkba_sweep.f90 ├── mms.f90 ├── octsweep.f90 ├── outer.f90 ├── output.f90 ├── plib.F90 ├── setup.f90 ├── sn.f90 ├── snap_main.f90 ├── solvar.f90 ├── sweep.f90 ├── thrd_comm.f90 ├── time.F90 ├── translv.f90 ├── utils.f90 └── version.f90 /.gitignore: -------------------------------------------------------------------------------- 1 | src/*.o 2 | src/*.mod 3 | src/gsnap 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | sudo: false 4 | 5 | addons: 6 | apt: 7 | sources: 8 | - ubuntu-toolchain-r-test 9 | packages: 10 | - ccache 11 | - gcc-5 12 | - g++-5 13 | - gfortran-5 14 | 15 | before_install: 16 | - export FC=gfortran-${GVER} CC=gcc-${GVER} CXX=g++-${GVER} 17 | - wget -qO- --no-check-certificate https://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-${OMPI}.tar.bz2 | tar -xj && 18 | cd openmpi-${OMPI} && mkdir build && cd build && ../configure CFLAGS="-w" --prefix=${HOME}/open-mpi 19 | --without-verbs --without-fca --without-mxm --without-ucx --without-portals4 --without-psm --without-psm2 --without-libfabric --without-usnic --without-udreg --without-ugni --without-xpmem --without-alps --without-munge --without-sge --without-loadleveler --without-tm 20 | --without-lsf --without-slurm --without-pvfs2 --without-plfs --without-cuda --disable-oshmem --enable-mpi-fortran --disable-oshmem-fortran --disable-libompitrace --disable-mpi-io --disable-io-romio --disable-static && 21 | make -j4 && make install && cd ../../ 22 | - export PATH="$HOME/open-mpi/bin:$PATH" 23 | 24 | env: 25 | global: 26 | - CCACHE_CPP2=yes 27 | - GVER=5 28 | - OMPI=1.10.2 29 | 30 | script: 31 | - make -C src -j2 && make -C src count 32 | - make -C ports/snap-c -j2 CC=mpicc CFLAGS="-O3 -std=c99 -fopenmp" LIBS="-lm" 33 | 34 | cache: 35 | - ccache 36 | 37 | compiler: 38 | - gcc 39 | -------------------------------------------------------------------------------- /docs/SNAP-brief-description.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/SNAP/e7ab43dfb0c16419d9a42d756141d5957ac526fc/docs/SNAP-brief-description.pdf -------------------------------------------------------------------------------- /docs/SNAP-overview-presentation-2015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/SNAP/e7ab43dfb0c16419d9a42d756141d5957ac526fc/docs/SNAP-overview-presentation-2015.pdf -------------------------------------------------------------------------------- /docs/SNAP-proxy-description.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/SNAP/e7ab43dfb0c16419d9a42d756141d5957ac526fc/docs/SNAP-proxy-description.pdf -------------------------------------------------------------------------------- /docs/SNAP-users-manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/SNAP/e7ab43dfb0c16419d9a42d756141d5957ac526fc/docs/SNAP-users-manual.pdf -------------------------------------------------------------------------------- /ports/README.md: -------------------------------------------------------------------------------- 1 | snap-c C port of SNAP 1.0 produced by Intel Corporation 2 | kokkos-direct "direct" Kokkos port of dim3_sweep produced by Geoff Womeldorff 3 | kokkos-hp hierarchical parallelism Kokkos port of dim3_sweep produced by Geoff Womeldorff 4 | kokkos-hp-opt and kc are further ports of the above. 5 | 6 | Both Kokkos versions are set to build with Kokkos from Trilinos, and use an environment variable TRILINOS_DIR to identify its location. To build with the GitHub version of Kokkos, please substitute the correct headers into snappy.hpp and main.cpp. 7 | 8 | snap-kf is a demonstration of Kokkos/C++/Fortran interoperability. 9 | -------------------------------------------------------------------------------- /ports/kc/Makefile: -------------------------------------------------------------------------------- 1 | #KOKKOS_PATH = /home/${USER}/kg-cuda-uvm-gnu 2 | #KOKKOS_PATH = /home/${USER}/kg-cuda-7.5-gnu-4.9.3 3 | KOKKOS_PATH = /home/${USER}/kg-cuda-uvm-gnu_5.3.0-release 4 | #KOKKOS_PATH = /home/${USER}/kg-cuda-uvm-intel 5 | #KOKKOS_PATH = /home/${USER}/kg-serial-intel 6 | #KOKKOS_PATH = /home/${USER}/kg-openmp-intel 7 | 8 | SRC = $(wildcard *.cpp) 9 | 10 | default: build 11 | echo "Start Build" 12 | 13 | CXX = $(KOKKOS_PATH)/config/nvcc_wrapper 14 | #CXX = icpc 15 | CXXFLAGS = -O3 16 | LINK = ${CXX} 17 | LINKFLAGS = 18 | EXE = snappy.cuda 19 | 20 | DEPFLAGS = -M 21 | 22 | OBJ = $(SRC:.cpp=.o) 23 | LIB = 24 | 25 | include $(KOKKOS_PATH)/Makefile.kokkos 26 | 27 | build: $(EXE) 28 | 29 | $(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) 30 | $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE) 31 | 32 | clean: kokkos-clean 33 | rm -f *.o *.cuda *.host 34 | 35 | # Compilation rules 36 | 37 | %.o:%.cpp $(KOKKOS_CPP_DEPENDS) 38 | $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< 39 | -------------------------------------------------------------------------------- /ports/kokkos-direct/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #ifeq ($(CUDA), yes) 3 | #CC = nvcc 4 | #CCFLAGS = -O3 -arch=sm_35 5 | #LINK = g++ 6 | #LINKFLAGS = 7 | #EXE = $(SRC:.cpp=.cuda) 8 | #else 9 | #CC = g++ 10 | #CCFLAGS = -O3 11 | #LINK = g++ 12 | #LINKFLAGS = 13 | #EXE = $(SRC:.cpp=.host) 14 | #endif 15 | 16 | TRILINOS_INSTALL_DIR=$(TRILINOS_DIR) 17 | include $(TRILINOS_INSTALL_DIR)/include/Makefile.export.Kokkos 18 | 19 | LDFLAGS = -L$(TRILINOS_INSTALL_DIR)/lib 20 | LDFLAGS += $(Kokkos_LIBRARIES) $(Kokkos_TPL_LIBRARIES) 21 | LDFLAGS += $(Teuchos_LIBRARIES) 22 | INCFLAGS = -I. -I$(TRILINOS_INSTALL_DIR)/include 23 | INCFLAGS += $(Kokkos_TPL_INCLUDE_DIRS) 24 | CXX = $(Kokkos_CXX_COMPILER) 25 | CXXFLAGS = $(Kokkos_CXX_FLAGS) 26 | #CXXFLAGS = $(Kokkos_CXX_FLAGS) -v -std=c++11 27 | 28 | #vtune 29 | #CXXFLAGS += -I$(VTUNE_AMPLIFIER_XE_2015_DIR)/include 30 | #LDFLAGS += -L$(VTUNE_AMPLIFIER_XE_2015_DIR)/lib64 -littnotify 31 | 32 | all: snappy.o 33 | 34 | snappy.o: main.cpp snappy.hpp 35 | $(CXX) $(CXXFLAGS) $(INCFLAGS) main.cpp $(LDFLAGS) -o snappy.x 36 | 37 | 38 | -------------------------------------------------------------------------------- /ports/kokkos-hp-opt/Makefile: -------------------------------------------------------------------------------- 1 | KOKKOS_PATH = ${HOME}/kokkos 2 | SRC = $(wildcard *.cpp) 3 | 4 | default: build 5 | echo "Start Build" 6 | 7 | CXX = g++ 8 | CXXFLAGS = -O3 9 | LINK = ${CXX} 10 | LINKFLAGS = 11 | EXE = snappy.x 12 | 13 | DEPFLAGS = -M 14 | 15 | OBJ = $(SRC:.cpp=.o) 16 | LIB = 17 | 18 | include $(KOKKOS_PATH)/Makefile.kokkos 19 | 20 | build: $(EXE) 21 | 22 | $(EXE): $(OBJ) $(KOKKOS_LINK_DEPENDS) 23 | $(LINK) $(KOKKOS_LDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(KOKKOS_LIBS) $(LIB) -o $(EXE) 24 | 25 | clean: kokkos-clean 26 | rm -f *.o *.cuda *.host 27 | 28 | # Compilation rules 29 | 30 | %.o:%.cpp $(KOKKOS_CPP_DEPENDS) 31 | $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $< 32 | -------------------------------------------------------------------------------- /ports/kokkos-hp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #ifeq ($(CUDA), yes) 3 | #CC = nvcc 4 | #CCFLAGS = -O3 -arch=sm_35 5 | #LINK = g++ 6 | #LINKFLAGS = 7 | #EXE = $(SRC:.cpp=.cuda) 8 | #else 9 | #CC = g++ 10 | #CCFLAGS = -O3 11 | #LINK = g++ 12 | #LINKFLAGS = 13 | #EXE = $(SRC:.cpp=.host) 14 | #endif 15 | 16 | TRILINOS_INSTALL_DIR=$(TRILINOS_DIR) 17 | include $(TRILINOS_INSTALL_DIR)/include/Makefile.export.Kokkos 18 | 19 | LDFLAGS = -L$(TRILINOS_INSTALL_DIR)/lib 20 | LDFLAGS += $(Kokkos_LIBRARIES) $(Kokkos_TPL_LIBRARIES) 21 | LDFLAGS += $(Teuchos_LIBRARIES) 22 | INCFLAGS = -I. -I$(TRILINOS_INSTALL_DIR)/include 23 | INCFLAGS += $(Kokkos_TPL_INCLUDE_DIRS) 24 | CXX = $(Kokkos_CXX_COMPILER) 25 | CXXFLAGS = $(Kokkos_CXX_FLAGS) 26 | #CXXFLAGS = $(Kokkos_CXX_FLAGS) -v -std=c++11 27 | 28 | #vtune 29 | #CXXFLAGS += -I$(VTUNE_AMPLIFIER_XE_2015_DIR)/include 30 | #LDFLAGS += -L$(VTUNE_AMPLIFIER_XE_2015_DIR)/lib64 -littnotify 31 | 32 | all: snappy.o 33 | 34 | snappy.o: main.cpp snappy.hpp 35 | $(CXX) $(CXXFLAGS) $(INCFLAGS) main.cpp $(LDFLAGS) -o snappy.x 36 | 37 | 38 | -------------------------------------------------------------------------------- /ports/legion/README.md: -------------------------------------------------------------------------------- 1 | # Legion-SNAP 2 | 3 | This is an implementation of the [SNAP](https://github.com/losalamos/SNAP) 4 | mini-application in Legion. This work was done by NVIDIA as part of the 5 | Fast Forward 2 project and was funded by the U.S. Department of Energy 6 | under subcontract B609478 with Lawrence Livermore National Security, LLC. 7 | The code is released under the Apache License, Version 2.0. A copy of the 8 | license can be found in this repository. 9 | 10 | Several notes on the code for this implementation of SNAP. 11 | 12 | * This version of SNAP only implements the mini-KBA sweep algorithm 13 | for performing the computation. It also only supports 3D computations. 14 | The Legion version issues index space launches for each stage of a 15 | sweep for each energy group and direction. This allows Legion to 16 | extract task parallelism from the different sweeps. This proves 17 | especially useful for the way Legion performs the GPU computation. 18 | The GPU implementation launches a single CTA per sweep and energy group 19 | and relies on task parallelism to launch multiple kernels onto the GPU 20 | to keep all the SMs on the GPU busy. This is unorthodox, but allows 21 | for a more efficient implementation that can store per-angle fluxes 22 | in the register file as the CTA sweeps through cells. 23 | 24 | * The Legion style of this implementation is designed to illustrate 25 | how code should be generated from a higher-level compiler or written 26 | for a domain specific library, with good application-specific 27 | abstractions and multiple different task variants for each logical 28 | task. This allows the application to specialize itself for different 29 | target architectures. The downside is that the code can appear to be 30 | verbose. This is not an artifact of Legion, but instead of what needs 31 | to be done to make a code portable across many different architectures. 32 | In general you will notice that there are very few places where Legion 33 | shows up in this code. There are fewer than 100 Legion runtime calls 34 | which represents less than 2% of all the code in the application. All 35 | of the task variants are highly tuned so it is possible to accurately 36 | gauge the runtime overhead that is incurred. 37 | 38 | * The Legion version of SNAP also demonstrates the use of custom projection 39 | functions when performing index space launches for the different sweeps. 40 | The custom projection functions for SNAP end up projecting from three 41 | dimensional points for the sweeps down to two dimensional points for 42 | handling the per-angle fluxes being passed from previous cells as each 43 | sweep progresses. 44 | 45 | * This version of SNAP is the first real Legion application that 46 | relies heavily upon using predication to handle the dynamic 47 | convergence tests needed in SNAP. This implementation shows 48 | how to chain together predicates to perform the convergence 49 | tests. It also demonstrates how to use Legion futures and 50 | tasks to construct a monad for performing accurate timing of 51 | tasks in a deferred execution environment (similar to how 52 | monads in Haskell are needed to handle the laziness of the 53 | execution model). Users can leverage this as a template for 54 | handling other kinds of predicated computations that need 55 | to be done in a deferred execution model. 56 | 57 | * Included in this version of SNAP is a custom mapper that 58 | demonstrates how a mapper can be specialized for a particular 59 | application by overriding specific calls from the default 60 | mapper implementation. An interesting observation is that 61 | the implementation of the mapper calls for a custom mapper 62 | are considerably simpler than the default mapper 63 | implementations. The reason for this is that with an 64 | application specific mapper the implementation can be 65 | tailored directly to the application and know exactly 66 | what layouts and locations to use for physical instances. 67 | 68 | -------------------------------------------------------------------------------- /ports/legion/input/base.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=2 4 | npez=2 5 | ichunk=2 6 | nthreads=2 7 | nnested=1 8 | ndimen=3 9 | nx=6 10 | lx=0.6 11 | ny=6 12 | ly=0.6 13 | nz=6 14 | lz=0.6 15 | nmom=1 16 | nang=10 17 | ng=4 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=30 21 | timedep=0 22 | tf=1.0 23 | nsteps=1 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=1 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/huge_1K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=1024 17 | ng=96 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/huge_2K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=1024 17 | ng=96 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/huge_4K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=1024 17 | ng=96 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/huge_512_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=8 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=1024 17 | ng=96 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/large_1K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=512 17 | ng=64 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/large_2K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=512 17 | ng=64 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/large_4K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=512 17 | ng=64 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/large_512_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=8 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=512 17 | ng=64 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/medium_1K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=256 17 | ng=48 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/medium_2K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=256 17 | ng=48 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/medium_4K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=256 17 | ng=48 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/medium_512_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=8 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=256 17 | ng=48 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/mms.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=2 4 | npez=2 5 | ichunk=2 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=16 17 | ng=4 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=2.0 23 | nsteps=2 24 | mat_opt=0 25 | src_opt=3 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=1 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=2 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/simple.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=32 10 | lx=0.6 11 | ny=32 12 | ly=0.6 13 | nz=32 14 | lz=0.6 15 | nmom=1 16 | nang=10 17 | ng=1 18 | epsi=1.0E-4 19 | iitm=2 20 | oitm=2 21 | timedep=0 22 | tf=1.0 23 | nsteps=1 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=1 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/small_1K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=128 17 | ng=32 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/small_2K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=128 17 | ng=32 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/small_4K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=128 17 | ng=32 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/small_512_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=8 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=128 17 | ng=32 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/test.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=2 4 | npez=2 5 | ichunk=2 6 | nthreads=2 7 | nnested=1 8 | ndimen=3 9 | nx=32 10 | lx=0.6 11 | ny=32 12 | ly=0.6 13 | nz=32 14 | lz=0.6 15 | nmom=1 16 | nang=10 17 | ng=4 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=30 21 | timedep=0 22 | tf=1.0 23 | nsteps=1 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=1 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/tiny_1K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=32 17 | ng=16 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/tiny_2K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=32 17 | ng=16 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/tiny_4K_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=16 10 | lx=0.6 11 | ny=16 12 | ly=0.6 13 | nz=16 14 | lz=0.6 15 | nmom=1 16 | nang=32 17 | ng=16 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/input/tiny_512_1x1x1.in: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=1 4 | npez=1 5 | ichunk=1 6 | nthreads=1 7 | nnested=1 8 | ndimen=3 9 | nx=8 10 | lx=0.6 11 | ny=8 12 | ly=0.6 13 | nz=8 14 | lz=0.6 15 | nmom=1 16 | nang=32 17 | ng=16 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=100 21 | timedep=1 22 | tf=10.0 23 | nsteps=10 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=0 31 | kplane=0 32 | popout=0 33 | swp_typ=1 34 | angcpy=0 35 | / 36 | -------------------------------------------------------------------------------- /ports/legion/src/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2017 NVIDIA Corporation 2 | # 3 | # The U.S. Department of Energy funded the development of this software 4 | # under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | 20 | ifndef LG_RT_DIR 21 | $(error LG_RT_DIR variable is not defined, aborting build) 22 | endif 23 | 24 | # Flags for directing the runtime makefile what to include 25 | DEBUG ?= 1 # Include debugging symbols 26 | OUTPUT_LEVEL ?= LEVEL_DEBUG # Compile time logging level 27 | SHARED_LOWLEVEL ?= 0 # Use shared-memory runtime (not recommended) 28 | USE_CUDA ?= 0 # Include CUDA support (requires CUDA) 29 | USE_GASNET ?= 0 # Include GASNet support (requires GASNet) 30 | USE_HDF ?= 0 # Include HDF5 support (requires HDF5) 31 | ALT_MAPPERS ?= 0 # Include alternative mappers (not recommended) 32 | 33 | # Put the binary file name here 34 | OUTFILE ?= snap 35 | # List all the application source files here 36 | GEN_SRC ?= main.cc \ 37 | snap.cc \ 38 | init.cc \ 39 | outer.cc \ 40 | inner.cc \ 41 | expxs.cc \ 42 | sweep.cc \ 43 | mms.cc \ 44 | mapper.cc\ 45 | convergence.cc # .cc files 46 | GEN_GPU_SRC ?= gpu_outer.cu \ 47 | gpu_inner.cu \ 48 | gpu_sweep.cu \ 49 | gpu_expxs.cu # .cu files 50 | 51 | # You can modify these variables, some will be appended to by the runtime makefile 52 | INC_FLAGS ?= 53 | CC_FLAGS ?= 54 | CC_FLAGS += -DSNAP_USE_RELAXED_COHERENCE # Do this until Realm supports multi-field reduction instances 55 | CC_FLAGS += -std=c++11 # Need this to deal with linkage issues 56 | NVCC_FLAGS ?= 57 | GASNET_FLAGS ?= 58 | LD_FLAGS ?= 59 | 60 | ifeq ($(strip $(USE_CUDA)),1) 61 | CC_FLAGS += -DUSE_GPU_KERNELS 62 | GPU_ARCH = kepler 63 | endif 64 | 65 | ########################################################################### 66 | # 67 | # Don't change anything below here 68 | # 69 | ########################################################################### 70 | 71 | include $(LG_RT_DIR)/runtime.mk 72 | 73 | -------------------------------------------------------------------------------- /ports/legion/src/convergence.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __SNAP_CONVERGENCE_H__ 20 | #define __SNAP_CONVERGENCE_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | using namespace Legion; 26 | 27 | // This class will issue a chain of single task launches 28 | // that when executed will emulate the execution of a 29 | // monad. We use them in SNAP to print out the convergence 30 | // and timing information for individual iterations of the 31 | // various loops of SNAP 32 | class ConvergenceMonad { 33 | public: 34 | // This is the type data actually stored in the Monad 35 | struct MonadData { 36 | public: 37 | long long step_start; 38 | long long outer_start; 39 | long long inner_start; 40 | int time_step_number; 41 | int inner_loop_number; 42 | int outer_loop_number; 43 | public: 44 | int total_inner_loops; 45 | int total_outer_loops; 46 | long long total_inner_time; 47 | long long total_outer_time; 48 | long long total_step_time; 49 | }; 50 | public: 51 | ConvergenceMonad(Context ctx, Runtime *runtime); 52 | ConvergenceMonad(const ConvergenceMonad &rhs); 53 | ~ConvergenceMonad(void); 54 | public: 55 | ConvergenceMonad& operator=(const ConvergenceMonad &rhs); 56 | public: 57 | void bind_inner(const Predicate &pred, const Future &inner_converged); 58 | void bind_outer(const Predicate &pred, const Future &outer_converged); 59 | public: 60 | const Context ctx; 61 | Runtime *const runtime; 62 | protected: 63 | Future monad_future; 64 | public: 65 | static void preregister_cpu_variants(void); 66 | public: 67 | static MonadData bind_inner_implementation(const Task *task, 68 | const std::vector ®ions, Context ctx, Runtime *runtime); 69 | static MonadData bind_outer_implementation(const Task *task, 70 | const std::vector ®ions, Context ctx, Runtime *runtime); 71 | static void summary_implementation(const Task *task, 72 | const std::vector ®ions, Context ctx, Runtime *runtime); 73 | }; 74 | 75 | #endif // __SNAP_CONVERGENCE_H__ 76 | 77 | -------------------------------------------------------------------------------- /ports/legion/src/expxs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __EXPXS_H__ 20 | #define __EXPXS_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | using namespace Legion; 26 | 27 | class ExpandCrossSection : public SnapTask { 29 | public: 30 | ExpandCrossSection(const Snap &snap, const SnapArray &sig, 31 | const SnapArray &mat, const SnapArray &xs, 32 | int group_start, int group_stop); 33 | public: 34 | const int group_start; 35 | const int group_stop; 36 | public: 37 | static void preregister_cpu_variants(void); 38 | static void preregister_gpu_variants(void); 39 | public: 40 | static void cpu_implementation(const Task *task, 41 | const std::vector ®ions, Context ctx, Runtime *runtime); 42 | static void fast_implementation(const Task *task, Context ctx, Runtime *runtime, 43 | const std::vector &sig_ptrs, const ByteOffset sig_offsets[1], 44 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 45 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3]); 46 | static void gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 47 | const std::vector &sig_ptrs, const ByteOffset sig_offsets[1], 48 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 49 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3]); 50 | }; 51 | 52 | class ExpandScatteringCrossSection : public SnapTask { 54 | public: 55 | ExpandScatteringCrossSection(const Snap &snap, const SnapArray &slgg, 56 | const SnapArray &mat, const SnapArray &s_xs, 57 | int group_start, int group_stop); 58 | public: 59 | const int group_start; 60 | const int group_stop; 61 | public: 62 | static void preregister_cpu_variants(void); 63 | static void preregister_gpu_variants(void); 64 | public: 65 | static void cpu_implementation(const Task *task, 66 | const std::vector ®ions, Context ctx, Runtime *runtime); 67 | static void fast_implementation(const Task *task, Context ctx, Runtime *runtime, 68 | const std::vector &slgg_ptrs, const ByteOffset slgg_offsets[2], 69 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 70 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3]); 71 | static void gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 72 | const std::vector &slgg_ptrs, const ByteOffset slgg_offsets[2], 73 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 74 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3]); 75 | }; 76 | 77 | class CalculateGeometryParam : public SnapTask { 79 | public: 80 | CalculateGeometryParam(const Snap &snap, const SnapArray &t_xs, 81 | const SnapArray &vdelt, const SnapArray &dinv, 82 | int group_start, int group_stop); 83 | public: 84 | const int group_start; 85 | const int group_stop; 86 | public: 87 | static void preregister_cpu_variants(void); 88 | static void preregister_gpu_variants(void); 89 | public: 90 | static void cpu_implementation(const Task *task, 91 | const std::vector ®ions, Context ctx, Runtime *runtime); 92 | static void fast_implementation(const Task *task, Context ctx, Runtime *runtime, 93 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3], 94 | const std::vector &vdelt_ptrs, const ByteOffset vdelt_offsets[1], 95 | const std::vector &dinv_ptrs, const ByteOffset dinv_offsets[3]); 96 | static void gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 97 | const std::vector &xs_ptrs, const ByteOffset xs_offsets[3], 98 | const std::vector &vdelt_ptrs, const ByteOffset vdelt_offsets[1], 99 | const std::vector &dinv_ptrs, const ByteOffset dinv_offsets[3]); 100 | }; 101 | 102 | #endif // __EXPXS_H__ 103 | 104 | -------------------------------------------------------------------------------- /ports/legion/src/init.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __INIT_H__ 20 | #define __INIT_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | using namespace Legion; 26 | 27 | class InitMaterial : public SnapTask { 29 | public: 30 | InitMaterial(const Snap &snap, const SnapArray &mat); 31 | public: 32 | static void preregister_cpu_variants(void); 33 | public: 34 | static void cpu_implementation(const Task *task, 35 | const std::vector ®ions, Context ctx, Runtime *runtime); 36 | }; 37 | 38 | class InitSource : public SnapTask { 39 | public: 40 | InitSource(const Snap &snap, const SnapArray &qi); 41 | public: 42 | static void preregister_cpu_variants(void); 43 | public: 44 | static void cpu_implementation(const Task *task, 45 | const std::vector ®ions, Context ctx, Runtime *runtime); 46 | }; 47 | 48 | class InitGPUSweep : public SnapTask { 49 | public: 50 | InitGPUSweep(const Snap &snap, const Rect<3> &launch_bounds); 51 | public: 52 | static void preregister_gpu_variants(void); 53 | public: 54 | static void gpu_implementation(const Task *task, 55 | const std::vector ®ions, Context ctx, Runtime *runtime); 56 | }; 57 | 58 | #endif // __INIT_H__ 59 | 60 | -------------------------------------------------------------------------------- /ports/legion/src/inner.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __INNER_H__ 20 | #define __INNER_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | using namespace Legion; 26 | 27 | class CalcInnerSource : public SnapTask { 29 | public: 30 | CalcInnerSource(const Snap &snap, const Predicate &pred, 31 | const SnapArray &s_xs, const SnapArray &flux0, 32 | const SnapArray &fluxm, const SnapArray &q2grp0, 33 | const SnapArray &q2grpm, const SnapArray &qtot); 34 | public: 35 | static void preregister_cpu_variants(void); 36 | static void preregister_gpu_variants(void); 37 | public: 38 | static void cpu_implementation(const Task *task, 39 | const std::vector ®ions, Context ctx, Runtime *runtime); 40 | static void fast_implementation(const Task *task, Context ctx, Runtime *runtime, 41 | const std::vector &sxs_ptrs, const ByteOffset sxs_offsets[3], 42 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 43 | const std::vector &q2grp0_ptrs, const ByteOffset q2grp0_offsets[3], 44 | const std::vector &qtot_ptrs, const ByteOffset qtot_offsets[3], 45 | const std::vector &fluxm_ptrs, const ByteOffset fluxm_offsets[3], 46 | const std::vector &q2grpm_ptrs, const ByteOffset q2grpm_offsets[3]); 47 | static void gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 48 | const std::vector &sxs_ptrs, const ByteOffset sxs_offsets[3], 49 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 50 | const std::vector &q2grp0_ptrs, const ByteOffset q2grp0_offsets[3], 51 | const std::vector &qtot_ptrs, const ByteOffset qtot_offsets[3], 52 | const std::vector &fluxm_ptrs, const ByteOffset fluxm_offsets[3], 53 | const std::vector &q2grpm_ptrs, const ByteOffset q2grpm_offsets[3]); 54 | }; 55 | 56 | class TestInnerConvergence : public SnapTask { 58 | public: 59 | TestInnerConvergence(const Snap &snap, const Predicate &pred, 60 | const SnapArray &flux0, const SnapArray &flux0pi, 61 | const Future &true_future, int group_start, int group_stop); 62 | public: 63 | static void preregister_cpu_variants(void); 64 | static void preregister_gpu_variants(void); 65 | public: 66 | static bool cpu_implementation(const Task *task, 67 | const std::vector ®ions, Context ctx, Runtime *runtime); 68 | static bool fast_implementation(const Task *task, Context ctx, Runtime *runtime, 69 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 70 | const std::vector &flux0pi_ptrs, const ByteOffset flux0pi_offsets[3]); 71 | static bool gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 72 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 73 | const std::vector &flux0pi_ptrs, const ByteOffset flux0pi_offsets[3]); 74 | }; 75 | 76 | #endif // __INNER_H__ 77 | -------------------------------------------------------------------------------- /ports/legion/src/main.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "snap.h" 20 | 21 | int main(int argc, char **argv) 22 | { 23 | Snap::parse_arguments(argc, argv); 24 | Snap::perform_registrations(); 25 | return Runtime::start(argc, argv); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /ports/legion/src/mms.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __MMS_H__ 20 | #define __MMS_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | class MMSInitFlux : public SnapTask { 26 | public: 27 | MMSInitFlux(const Snap &snap, const SnapArray &ref_flux, 28 | const SnapArray &ref_fluxm); 29 | public: 30 | static void preregister_cpu_variants(void); 31 | public: 32 | static void cpu_implementation(const Task *task, 33 | const std::vector ®ions, Context ctx, Runtime *runtime); 34 | }; 35 | 36 | class MMSInitSource : public SnapTask { 37 | public: 38 | MMSInitSource(const Snap &snap, const SnapArray &ref_flux, 39 | const SnapArray &ref_fluxm, const SnapArray &mat, 40 | const SnapArray &sigt, const SnapArray &slgg, 41 | const SnapArray &qim, int corner); 42 | public: 43 | const int corner; 44 | public: 45 | static void preregister_cpu_variants(void); 46 | public: 47 | static void cpu_implementation(const Task *task, 48 | const std::vector ®ions, Context ctx, Runtime *runtime); 49 | }; 50 | 51 | class MMSInitTimeDependent : public SnapTask { 53 | public: 54 | MMSInitTimeDependent(const Snap &snap, const SnapArray &vel, 55 | const SnapArray &ref_flux, const SnapArray &qi); 56 | public: 57 | static void preregister_cpu_variants(void); 58 | public: 59 | static void cpu_implementation(const Task *task, 60 | const std::vector ®ions, Context ctx, Runtime *runtime); 61 | }; 62 | 63 | class MMSScale : public SnapTask { 64 | public: 65 | MMSScale(const Snap &snap, const SnapArray &qim, double factor); 66 | public: 67 | const double scale_factor; 68 | public: 69 | static void preregister_cpu_variants(void); 70 | public: 71 | static void cpu_implementation(const Task *task, 72 | const std::vector ®ions, Context ctx, Runtime *runtime); 73 | }; 74 | 75 | class MMSCompare : public SnapTask { 76 | public: 77 | MMSCompare(const Snap &snap, const SnapArray &flux, const SnapArray &ref_flux); 78 | public: 79 | static void preregister_cpu_variants(void); 80 | public: 81 | static MomentTriple cpu_implementation(const Task *task, 82 | const std::vector ®ions, Context ctx, Runtime *runtime); 83 | }; 84 | 85 | class MMSReduction { 86 | public: 87 | static const Snap::SnapReductionID REDOP = Snap::MMS_REDUCTION_ID; 88 | public: 89 | typedef MomentTriple LHS; 90 | typedef MomentTriple RHS; 91 | static const MomentTriple identity; 92 | public: 93 | template static void apply(LHS &lhs, RHS rhs); 94 | template static void fold(RHS &rhs1, RHS rhs2); 95 | }; 96 | 97 | #endif // __MMS_H__ 98 | 99 | -------------------------------------------------------------------------------- /ports/legion/src/outer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __OUTER_H__ 20 | #define __OUTER_H__ 21 | 22 | #include "snap.h" 23 | #include "legion.h" 24 | 25 | using namespace Legion; 26 | 27 | class CalcOuterSource : public SnapTask { 29 | public: 30 | CalcOuterSource(const Snap &snap, const Predicate &pred, 31 | const SnapArray &qi, const SnapArray &slgg, 32 | const SnapArray &mat, const SnapArray &q2rgp0, 33 | const SnapArray &q2grpm, const SnapArray &flux0, 34 | const SnapArray &fluxm); 35 | public: 36 | static void preregister_cpu_variants(void); 37 | static void preregister_gpu_variants(void); 38 | public: 39 | static void cpu_implementation(const Task *task, 40 | const std::vector ®ions, Context ctx, Runtime *runtime); 41 | static void fast_implementation(const Task *task, Context ctx, Runtime *runtime, 42 | const std::vector &qi0_ptrs, const ByteOffset qi0_offsets[3], 43 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 44 | const std::vector &slgg_ptrs, const ByteOffset slgg_offsets[2], 45 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 46 | const std::vector &qo0_ptrs, const ByteOffset qo0_offsets[3], 47 | const std::vector &fluxm_ptrs, const ByteOffset fluxm_offsets[3], 48 | const std::vector &qom_ptrs, const ByteOffset qom_offsets[3]); 49 | static void gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 50 | const std::vector &qi0_ptrs, const ByteOffset qi0_offsets[3], 51 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 52 | const std::vector &slgg_ptrs, const ByteOffset slgg_offsets[2], 53 | const std::vector &mat_ptrs, const ByteOffset mat_offsets[3], 54 | const std::vector &qo0_ptrs, const ByteOffset qo0_offsets[3], 55 | const std::vector &fluxm_ptrs, const ByteOffset fluxm_offsets[3], 56 | const std::vector &qom_ptrs, const ByteOffset qom_offsets[3]); 57 | }; 58 | 59 | class TestOuterConvergence : public SnapTask { 61 | public: 62 | TestOuterConvergence(const Snap &snap, const Predicate &pred, 63 | const SnapArray &flux0, const SnapArray &flux0po, 64 | const Future &inner_converged, const Future &true_future, 65 | int group_start, int group_stop); 66 | public: 67 | static void preregister_cpu_variants(void); 68 | static void preregister_gpu_variants(void); 69 | public: 70 | static bool cpu_implementation(const Task *task, 71 | const std::vector ®ions, Context ctx, Runtime *runtime); 72 | static bool fast_implementation(const Task *task, Context ctx, Runtime *runtime, 73 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 74 | const std::vector &flux0po_ptrs, const ByteOffset flux0po_offsets[3]); 75 | static bool gpu_implementation(const Task *task, Context ctx, Runtime *runtime, 76 | const std::vector &flux0_ptrs, const ByteOffset flux0_offsets[3], 77 | const std::vector &flux0po_ptrs, const ByteOffset flux0po_offsets[3]); 78 | }; 79 | 80 | #endif // __OUTER_H__ 81 | 82 | -------------------------------------------------------------------------------- /ports/legion/src/snap_cuda_help.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "accessor.h" 20 | 21 | #include 22 | 23 | #ifndef __SNAP_CUDA_HELP_H__ 24 | #define __SNAP_CUDA_HELP_H__ 25 | 26 | __host__ 27 | static int gcd(int a, int b) 28 | { 29 | if (a < b) return gcd(a, b-a); 30 | if (a > b) return gcd(a-b, b); 31 | return a; 32 | } 33 | 34 | template 35 | struct PointerBuffer { 36 | public: 37 | __host__ 38 | PointerBuffer(const std::vector &ptrs) 39 | { 40 | for (unsigned idx = 0; idx < GROUPS; idx++) 41 | buffer[idx] = ptrs[idx]; 42 | } 43 | public: 44 | __host__ __device__ 45 | inline T* operator[](unsigned idx) const { return buffer[idx]; } 46 | public: 47 | T *buffer[GROUPS]; 48 | }; 49 | 50 | template 51 | struct ConstBuffer { 52 | public: 53 | __host__ 54 | ConstBuffer(const T buf[DIM]) 55 | { 56 | for (int idx = 0; idx < DIM; idx++) 57 | buffer[idx] = buf[idx]; 58 | } 59 | __host__ 60 | ConstBuffer(const std::vector &buf) 61 | { 62 | for (int idx = 0; idx < DIM; idx++) 63 | buffer[idx] = buf[idx]; 64 | } 65 | public: 66 | __host__ __device__ 67 | inline T& operator[](unsigned idx) { return buffer[idx]; } 68 | __host__ __device__ 69 | inline const T& operator[](unsigned idx) const { return buffer[idx]; } 70 | public: 71 | T buffer[DIM]; 72 | }; 73 | 74 | template 75 | struct ByteOffsetArray { 76 | public: 77 | __host__ 78 | ByteOffsetArray(const LegionRuntime::Accessor::ByteOffset offs[DIM]) 79 | { 80 | for (int idx = 0; idx < DIM; idx++) 81 | offsets[idx] = offs[idx]; 82 | } 83 | public: 84 | __host__ __device__ 85 | inline const LegionRuntime::Accessor::ByteOffset& operator[](unsigned idx) const 86 | { return offsets[idx]; } 87 | public: 88 | LegionRuntime::Accessor::ByteOffset offsets[DIM]; 89 | }; 90 | 91 | #endif 92 | 93 | -------------------------------------------------------------------------------- /ports/legion/src/snap_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 NVIDIA Corporation 2 | * 3 | * The U.S. Department of Energy funded the development of this software 4 | * under subcontract B609478 with Lawrence Livermore National Security, LLC 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __SNAP_TYPES_H__ 20 | #define __SNAP_TYPES_H__ 21 | 22 | #ifdef __CUDACC__ 23 | #define CUDAPREFIX __host__ __device__ 24 | #else 25 | #define CUDAPREFIX 26 | #endif 27 | 28 | // Put these here since we'll need them separately in CUDA code 29 | 30 | struct MomentTriple { 31 | public: 32 | CUDAPREFIX MomentTriple(double x = 0.0, double y = 0.0, double z = 0.0) 33 | { vals[0] = x; vals[1] = y; vals[2] = z; } 34 | public: 35 | CUDAPREFIX double& operator[](const int index) { return vals[index]; } 36 | CUDAPREFIX const double& operator[](const int index) const { return vals[index]; } 37 | public: 38 | double vals[3]; 39 | }; 40 | 41 | struct MomentQuad { 42 | public: 43 | CUDAPREFIX MomentQuad(double x = 0.0, double y = 0.0, double z = 0.0, double w = 0.0) 44 | { vals[0] = x; vals[1] = y; vals[2] = z; vals[3] = w; } 45 | public: 46 | CUDAPREFIX double& operator[](const int index) { return vals[index]; } 47 | CUDAPREFIX const double& operator[](const int index) const { return vals[index]; } 48 | public: 49 | double vals[4]; 50 | }; 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /ports/snap-c/LineCount: -------------------------------------------------------------------------------- 1 | # Count lines of code, omitting blanks and comments 2 | echo $1 line count is: `grep -cvE '^$|^[\!]' < $1` >> $2 3 | -------------------------------------------------------------------------------- /ports/snap-c/LineReport: -------------------------------------------------------------------------------- 1 | # Add up the number of lines 2 | BEGIN { LC = 0 } 3 | 4 | // { LC = LC + $5 } 5 | 6 | END { print "Total line count is: " LC } 7 | -------------------------------------------------------------------------------- /ports/snap-c/Makefile: -------------------------------------------------------------------------------- 1 | A_PREFIX=snap 2 | A_SUFFIX=_mkl_vml 3 | A_TARGET=$(A_PREFIX)$(A_SUFFIX) 4 | 5 | CC=mpiicc # C compiler command 6 | CFLAGS=-mkl -O3 -xAVX -std=c99 -fopenmp -parallel -DUSEMKL -DUSEVML # C compiler flags 7 | #CC=mpicc 8 | #CFLAGS=-O3 -std=c99 -fopenmp -lm #-wall # C compiler flags 9 | LDFLAGS= # Linker flags, e.g. -L if you have libraries in a nonstandard directory 10 | LIBS= # Libraries to pass to the linker, e.g. -l 11 | CPPFLAGS= # (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory 12 | CXX=icc # C++ compiler command 13 | CXXFLAGS=-O3 -std=c++11 -openmp # C++ compiler flags 14 | CXXCPP= # C++ preprocessor flags 15 | 16 | A_FILES := $(wildcard *.cpp) $(wildcard *.c) 17 | A_OBJS := $(sort $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(A_FILES)))) 18 | 19 | INPUT_FILE=scale_test_8_4.inp 20 | OUTPUT_PREFIX=snap_test 21 | OUTPUT_SUFFIX=.out 22 | OUTPUT_FILE=$(OUTPUT_PREFIX)$(OUTPUT_SUFFIX) 23 | 24 | SRCS = snap.h snap_main.c utils.c version.c plib.c geom.c \ 25 | sn.c data.c control.c input.c setup.c dealloc.c \ 26 | translv.c solvar.c outer.c expxs.c inner.c sweep.c \ 27 | octsweep.c dim1_sweep.c dim3_sweep.c output.c time.c mms.c 28 | 29 | 30 | all: $(A_TARGET) # Build all targets 31 | 32 | vars: # Show Makefile variable values 33 | @echo " CC "$(CC) 34 | @echo " A_TARGET "$(A_TARGET) 35 | @echo " CFLAGS "$(CFLAGS) 36 | @echo " LDFLAGS "$(LDFLAGS) 37 | @echo " LIBS "$(LIBS)@egrep "[a-z]\w+:" Makefile | sort 38 | 39 | clean: # Remove make build object and target files 40 | -rm -f *{.o,~} $(A_TARGET) 41 | 42 | cleanout: clean 43 | -rm -f $(OUTPUT_FILE) 44 | 45 | .PHONY: clean vars help install rebuild 46 | 47 | rebuild: clean $(A_TARGET) # Clean and build target 48 | 49 | install: # Build and install 50 | 51 | run: $(A_TARGET) 52 | ./$(A_TARGET) --fi $(INPUT_FILE) --fo $(OUTPUT_FILE) 53 | 54 | $(A_TARGET): $(A_OBJS) # Build target and its required object files 55 | $(CC) $(CFLAGS) $(CPPFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS) 56 | 57 | %.o: %.cpp 58 | $(CXX) $(CXXFLAGS) $(CXXCPP) -c $< -o $@ 59 | 60 | %: %.cpp 61 | $(CXX) $(CXXFLAGS) $(CXXCPP) -o $@ $< 62 | 63 | %.o: %.c 64 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ 65 | 66 | %: %.c 67 | $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< 68 | 69 | # 70 | # Count lines of code 71 | # 72 | count: 73 | rm -f Lines 74 | for file in $(SRCS); do ./LineCount $$file Lines; done 75 | gawk -f ./LineReport < Lines >> Lines 76 | cat Lines 77 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/chkall: -------------------------------------------------------------------------------- 1 | 2 | # No Fixup 3 | mpirun -cpus-per-proc 3 -np 4 $1 in01 nout01 4 | mpirun -cpus-per-proc 2 -np 6 $1 in02 nout02 5 | mpirun -cpus-per-proc 2 -np 6 $1 in03 nout03 6 | mpirun -cpus-per-proc 2 -np 4 $1 in04 nout04 7 | mpirun -cpus-per-proc 4 -np 4 $1 in05 nout05 8 | mpirun -cpus-per-proc 4 -np 4 $1 in06 nout06 9 | mpirun -cpus-per-proc 2 -np 8 $1 in07 nout07 10 | mpirun -cpus-per-proc 2 -np 8 $1 in08 nout08 11 | mpirun -cpus-per-proc 4 -np 4 $1 in09 nout09 12 | mpirun -cpus-per-proc 4 -np 4 $1 in10 nout10 13 | mpirun -cpus-per-proc 4 -np 4 $1 in11 nout11 14 | mpirun -cpus-per-proc 4 -np 4 $1 in12 nout12 15 | 16 | # Fixup 17 | mpirun -cpus-per-proc 3 -np 4 $1 fin01 nfout01 18 | mpirun -cpus-per-proc 2 -np 6 $1 fin02 nfout02 19 | mpirun -cpus-per-proc 2 -np 6 $1 fin03 nfout03 20 | mpirun -cpus-per-proc 2 -np 4 $1 fin04 nfout04 21 | mpirun -cpus-per-proc 4 -np 4 $1 fin05 nfout05 22 | mpirun -cpus-per-proc 4 -np 4 $1 fin06 nfout06 23 | mpirun -cpus-per-proc 2 -np 8 $1 fin07 nfout07 24 | mpirun -cpus-per-proc 2 -np 8 $1 fin08 nfout08 25 | mpirun -cpus-per-proc 4 -np 4 $1 fin09 nfout09 26 | mpirun -cpus-per-proc 4 -np 4 $1 fin10 nfout10 27 | mpirun -cpus-per-proc 4 -np 4 $1 fin11 nfout11 28 | mpirun -cpus-per-proc 4 -np 4 $1 fin12 nfout12 29 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin01: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=3 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin02: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=1 5 | npez=6 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=36 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin03: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=6 5 | npez=1 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=3 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin04: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=5 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin05: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=12 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin06: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin07: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=1.0 9 | ny=20 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=5 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin08: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=3 15 | nang=36 16 | ng=5 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin09: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin10: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.02 9 | ny=20 10 | ly=0.02 11 | nz=12 12 | lz=0.012 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=1 20 | it_det=0 21 | tf=0.01 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin11: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.1 10 | ny=20 11 | ly=0.1 12 | nz=12 13 | lz=0.1 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=0.1 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | / 31 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/fin12: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | / 31 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/genall: -------------------------------------------------------------------------------- 1 | 2 | # No Fixup 3 | mpirun -cpus-per-proc 3 -np 4 $1 in01 out01 4 | mpirun -cpus-per-proc 2 -np 6 $1 in02 out02 5 | mpirun -cpus-per-proc 2 -np 6 $1 in03 out03 6 | mpirun -cpus-per-proc 2 -np 4 $1 in04 out04 7 | mpirun -cpus-per-proc 4 -np 4 $1 in05 out05 8 | mpirun -cpus-per-proc 4 -np 4 $1 in06 out06 9 | mpirun -cpus-per-proc 2 -np 8 $1 in07 out07 10 | mpirun -cpus-per-proc 2 -np 8 $1 in08 out08 11 | mpirun -cpus-per-proc 4 -np 4 $1 in09 out09 12 | mpirun -cpus-per-proc 4 -np 4 $1 in10 out10 13 | mpirun -cpus-per-proc 4 -np 4 $1 in11 out11 14 | mpirun -cpus-per-proc 4 -np 4 $1 in12 out12 15 | 16 | # Fixup 17 | mpirun -cpus-per-proc 3 -np 4 $1 fin01 fout01 18 | mpirun -cpus-per-proc 2 -np 6 $1 fin02 fout02 19 | mpirun -cpus-per-proc 2 -np 6 $1 fin03 fout03 20 | mpirun -cpus-per-proc 2 -np 4 $1 fin04 fout04 21 | mpirun -cpus-per-proc 4 -np 4 $1 fin05 fout05 22 | mpirun -cpus-per-proc 4 -np 4 $1 fin06 fout06 23 | mpirun -cpus-per-proc 2 -np 8 $1 fin07 fout07 24 | mpirun -cpus-per-proc 2 -np 8 $1 fin08 fout08 25 | mpirun -cpus-per-proc 4 -np 4 $1 fin09 fout09 26 | mpirun -cpus-per-proc 4 -np 4 $1 fin10 fout10 27 | mpirun -cpus-per-proc 4 -np 4 $1 fin11 fout11 28 | mpirun -cpus-per-proc 4 -np 4 $1 fin12 fout12 29 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in01: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=3 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in02: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=1 5 | npez=6 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=36 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in03: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=6 5 | npez=1 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=3 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in04: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=5 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in05: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=12 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in06: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in07: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=1.0 9 | ny=20 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=5 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in08: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=3 15 | nang=36 16 | ng=5 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in09: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in10: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.02 9 | ny=20 10 | ly=0.02 11 | nz=12 12 | lz=0.012 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=1 20 | it_det=0 21 | tf=0.01 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | / 30 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in11: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.1 10 | ny=20 11 | ly=0.1 12 | nz=12 13 | lz=0.1 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=0.1 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | / 31 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/in12: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | / 31 | -------------------------------------------------------------------------------- /ports/snap-c/center_src/mvnewtoold: -------------------------------------------------------------------------------- 1 | mv -f nout01 out01 2 | mv -f nout02 out02 3 | mv -f nout03 out03 4 | mv -f nout04 out04 5 | mv -f nout05 out05 6 | mv -f nout06 out06 7 | mv -f nout07 out07 8 | mv -f nout08 out08 9 | mv -f nout09 out09 10 | mv -f nout10 out10 11 | mv -f nout11 out11 12 | mv -f nout12 out12 13 | 14 | mv -f nfout01 fout01 15 | mv -f nfout02 fout02 16 | mv -f nfout03 fout03 17 | mv -f nfout04 fout04 18 | mv -f nfout05 fout05 19 | mv -f nfout06 fout06 20 | mv -f nfout07 fout07 21 | mv -f nfout08 fout08 22 | mv -f nfout09 fout09 23 | mv -f nfout10 fout10 24 | mv -f nfout11 fout11 25 | mv -f nfout12 fout12 26 | -------------------------------------------------------------------------------- /ports/snap-c/control.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Module: control.c 3 | * This module contains the variables that control SNAP's solver 4 | * routines. This includes the time-dependent variables. 5 | ***********************************************************************/ 6 | #include "snap.h" 7 | 8 | void control_data_init ( control_data *control_vars ) 9 | { 10 | DT = 0; 11 | TOLR = 1.02E-12; 12 | DFMXI = NULL; 13 | DFMXO = -1; 14 | INRDONE = NULL; 15 | OTRDONE = false; 16 | } 17 | 18 | /*********************************************************************** 19 | * Allocate control module variables. 20 | ***********************************************************************/ 21 | void control_alloc ( input_data *input_vars, control_data *control_vars, int *ierr ) 22 | { 23 | int i; 24 | 25 | ALLOC_1D(DFMXI, NG, double, ierr); 26 | ALLOC_1D(INRDONE, NG, bool, ierr); 27 | 28 | if ( *ierr != 0 ) return; 29 | 30 | for ( i = 0; i < NG; i++ ) 31 | { 32 | INRDONE_1D(i) = false; 33 | DFMXI_1D(i) = -1; 34 | } 35 | 36 | DFMXO = -1; 37 | } 38 | 39 | /*********************************************************************** 40 | * Deallocate control module variables. 41 | ***********************************************************************/ 42 | void control_dealloc ( control_data *control_vars ) 43 | { 44 | FREE(DFMXI); 45 | FREE(INRDONE); 46 | } 47 | -------------------------------------------------------------------------------- /ports/snap-c/data.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * Module: data.c 4 | * This module contains the variables and setup subroutines for the mock 5 | * cross section data. It establishes the number of groups and constructs 6 | * the cross section arrays. 7 | *******************************************************************************/ 8 | #include "snap.h" 9 | 10 | /******************************************************************************* 11 | * Constructor for data_data type 12 | *******************************************************************************/ 13 | void data_data_init (data_data *data_vars ) 14 | { 15 | V = NULL; 16 | NMAT = 1; 17 | MAT = NULL; 18 | QI = NULL; 19 | QIM = NULL; 20 | SIGT = NULL; 21 | SIGA = NULL; 22 | SIGS = NULL; 23 | SLGG = NULL; 24 | VDELT = NULL; 25 | } 26 | 27 | /******************************************************************************* 28 | * Allocate data_module arrays. 29 | *******************************************************************************/ 30 | void data_allocate ( data_data *data_vars, input_data *input_vars, 31 | sn_data *sn_vars, int *ierr ) 32 | { 33 | /******************************************************************************* 34 | * Local variables 35 | *******************************************************************************/ 36 | int i,j,k; 37 | 38 | /******************************************************************************* 39 | * Establish number of materials according to mat_opt 40 | *******************************************************************************/ 41 | if ( MAT_OPT > 0 ) 42 | { 43 | NMAT = 2; 44 | } 45 | 46 | /******************************************************************************* 47 | * Allocate velocities 48 | *******************************************************************************/ 49 | if ( TIMEDEP == 1 ) 50 | { 51 | ALLOC_1D(V, NG, double, ierr); 52 | } 53 | 54 | if ( *ierr != 0 ) return; 55 | 56 | /******************************************************************************* 57 | * Allocate the material identifier array. ny and nz are 1 if not 58 | * 2-D/3-D. 59 | *******************************************************************************/ 60 | ALLOC_3D(MAT, NX, NY, NZ, int, ierr); 61 | 62 | if ( *ierr != 0 ) return; 63 | 64 | for ( k=0; k < NZ; k++ ) 65 | { 66 | for ( j=0; j < NY; j++ ) 67 | { 68 | for ( i=0; i < NX; i++ ) 69 | { 70 | MAT_3D(i, j, k) = 1; 71 | } 72 | } 73 | } 74 | 75 | /******************************************************************************* 76 | * Allocate the fixed source array. If src_opt < 3, allocate the qi 77 | * array, not the qim. Do the opposite (store the full angular copy) of 78 | * the source, qim, if src_opt>=3 (MMS). Allocate array not used to 0. 79 | * ny and nz are 1 if not 2-D/3-D. 80 | *******************************************************************************/ 81 | if ( SRC_OPT < 3 ) 82 | { 83 | ALLOC_4D(QI, NX, NY, NZ, NG, double, ierr); 84 | 85 | if ( *ierr != 0 ) return; 86 | } 87 | else 88 | { 89 | ALLOC_4D(QI, NX, NY, NZ, NG, double, ierr); 90 | ALLOC_6D(QIM, NANG, NX, NY, NZ, NOCT, NG, double, ierr); 91 | 92 | if ( *ierr != 0 ) return; 93 | } 94 | 95 | 96 | /******************************************************************************* 97 | * Allocate mock cross sections 98 | *******************************************************************************/ 99 | if (NMAT != 0 ) 100 | { 101 | ALLOC_2D(SIGT, NMAT, NG, double, ierr); 102 | ALLOC_2D(SIGA, NMAT, NG, double, ierr); 103 | ALLOC_2D(SIGS, NMAT, NG, double, ierr); 104 | ALLOC_4D(SLGG, NMAT, NMOM, NG, NG, double, ierr); 105 | 106 | if ( *ierr != 0 ) return; 107 | } 108 | else 109 | { 110 | ALLOC_1D(SIGT, NG, double, ierr); 111 | ALLOC_1D(SIGA, NG, double, ierr); 112 | ALLOC_1D(SIGS, NG, double, ierr); 113 | ALLOC_3D(SLGG, NMOM, NG, NG, double, ierr); 114 | 115 | if ( *ierr != 0 ) return; 116 | } 117 | 118 | 119 | /******************************************************************************* 120 | * Allocate the vdelt array 121 | *******************************************************************************/ 122 | ALLOC_1D(VDELT, NG, double, ierr); 123 | 124 | if ( *ierr != 0 ) return; 125 | } 126 | 127 | /******************************************************************************* 128 | * Deallocate the data module arrays 129 | *******************************************************************************/ 130 | void data_deallocate ( data_data *data_vars ) 131 | { 132 | FREE(V); 133 | FREE(MAT); 134 | FREE(QI); 135 | FREE(QIM); 136 | FREE(SIGT); 137 | FREE(SIGA); 138 | FREE(SIGS); 139 | FREE(SLGG); 140 | FREE(VDELT); 141 | } 142 | 143 | -------------------------------------------------------------------------------- /ports/snap-c/dealloc.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Controls the deallocation process of run-time arrays. 3 | ***********************************************************************/ 4 | #include "snap.h" 5 | 6 | /*********************************************************************** 7 | * Call for the data deallocation from individual deallocation 8 | * subroutines. Covers the allocations from input. 9 | ***********************************************************************/ 10 | void dealloc_input ( int selectFlag, sn_data *sn_vars, data_data *data_vars, 11 | mms_data *mms_vars ) 12 | { 13 | sn_deallocate ( sn_vars ); 14 | if ( selectFlag > 1 ) 15 | data_deallocate ( data_vars ); 16 | if ( selectFlag > 2 ) 17 | mms_deallocate ( mms_vars ); 18 | } 19 | 20 | /*********************************************************************** 21 | * Call for the data deallocation from individual deallocation 22 | * subroutines. Covers the allocations from input. 23 | ***********************************************************************/ 24 | void dealloc_solve ( int selectFlag, geom_data *geom_vars, 25 | solvar_data *solvar_vars, control_data *control_vars ) 26 | { 27 | geom_dealloc ( geom_vars ); 28 | if ( selectFlag > 1 ) 29 | solvar_dealloc ( solvar_vars ); 30 | if ( selectFlag > 2 ) 31 | control_dealloc ( control_vars ); 32 | } 33 | -------------------------------------------------------------------------------- /ports/snap-c/expxs.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Module: expxs.c 3 | * 4 | * This module contains the subroutines for expanding a cross section to 5 | * a full spatial map. 6 | ***********************************************************************/ 7 | #include "snap.h" 8 | 9 | #ifdef ROWORDER 10 | #define CS_3D(X, Y, Z) \ 11 | cs[ X * NY * NZ \ 12 | + Y * NZ \ 13 | + Z ] 14 | #else 15 | #define CS_3D(X, Y, Z) \ 16 | cs[ Z * NY * NX \ 17 | + Y * NX \ 18 | + X ] 19 | #endif 20 | 21 | #define MAP_3D(X, Y, Z) MAT_3D(X, Y, Z) 22 | 23 | #define XS_1D(MAT1) SLGG_4D(MAT1, (l_indx-1), (gp-1), (g-1)) 24 | 25 | /*********************************************************************** 26 | * Expand one of the sig*(nmat,ng) arrays to a spatial mapping. xs is the 27 | * a generic cross section array, map is the material map, and cs is the 28 | * cross section expanded to the mesh. 29 | ***********************************************************************/ 30 | void expxs_reg ( input_data *input_vars, data_data *data_vars, solvar_data *solvar_vars, 31 | double *cs, int g, int gp, int l_indx ) 32 | { 33 | /*********************************************************************** 34 | * Local variables 35 | ***********************************************************************/ 36 | int i, j, k; 37 | 38 | if ( !cs ) 39 | { 40 | for ( k = 1; k <= NZ; k++ ) 41 | { 42 | for ( j = 1; j <= NY; j++ ) 43 | { 44 | for ( i = 1; i <= NX; i++ ) 45 | { 46 | T_XS_4D((i-1),(j-1),(k-1),(g-1)) 47 | = SIGT_2D(MAT_3D((i-1),(j-1),(k-1)) - 1, (g-1)); 48 | A_XS_4D((i-1),(j-1),(k-1),(g-1)) 49 | = SIGA_2D(MAT_3D((i-1),(j-1),(k-1)) - 1, (g-1)); 50 | } 51 | } 52 | } 53 | } 54 | else 55 | { 56 | for ( k = 1; k <= NZ; k++ ) 57 | { 58 | for ( j = 1; j <= NY; j++ ) 59 | { 60 | for ( i = 1; i <= NX; i++ ) 61 | { 62 | CS_3D((i-1),(j-1),(k-1)) 63 | = XS_1D(MAP_3D((i-1),(j-1),(k-1)) - 1); 64 | } 65 | } 66 | } 67 | } 68 | } 69 | 70 | /*********************************************************************** 71 | * Expand the slgg(nmat,nmom,ng,ng) array to a spatial mapping. scat 72 | * is the slgg matrix for a single h->g group coupling, map is the 73 | * material map, and cs is the scattering matrix expanded to the mesh. 74 | ***********************************************************************/ 75 | void expxs_slgg ( input_data *input_vars, data_data *data_vars, 76 | solvar_data *solvar_vars, int g ) 77 | { 78 | /*********************************************************************** 79 | * Local variables 80 | ***********************************************************************/ 81 | int l, i, j, k; 82 | 83 | for ( k = 1; k <= NZ; k++ ) 84 | { 85 | for ( j = 1; j <= NY; j++ ) 86 | { 87 | for ( i = 1; i <= NX; i++ ) 88 | { 89 | for ( l = 1; l <= NMOM; l++ ) 90 | { 91 | S_XS_5D((l-1),(i-1),(j-1),(k-1),(g-1)) 92 | = SLGG_4D(MAT_3D((i-1),(j-1),(k-1))-1, (l-1), (g-1), (g-1)); 93 | } 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ports/snap-c/octsweep.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Module: octsweep_sweep.c 3 | * 4 | * This module controls the setup and calls for sweeping a single octant 5 | * pair. It calls for the actual sweep logic depending on the spatial 6 | * dimensionality of the problem. 7 | ***********************************************************************/ 8 | #include "snap.h" 9 | 10 | /*********************************************************************** 11 | * Call for the appropriate sweeper depending on the dimensionality. Let 12 | * the actual sweep routine know the octant info to get the order right. 13 | ***********************************************************************/ 14 | void octsweep ( input_data *input_vars, para_data *para_vars, geom_data *geom_vars, 15 | sn_data *sn_vars, data_data *data_vars, control_data *control_vars, 16 | solvar_data *solvar_vars, dim_sweep_data *dim_sweep_vars, 17 | int g, int iop, int jd, int kd, int jlo, int jhi, int jst, 18 | int klo, int khi, int kst, int *ierr ) 19 | { 20 | /*********************************************************************** 21 | * Local variables 22 | ***********************************************************************/ 23 | int id, oct, ich, d1, d2, d3, d4, i1, i2; 24 | 25 | /*********************************************************************** 26 | * Determine octant and chunk index. 27 | ***********************************************************************/ 28 | id = 1 + (iop-1)/NC; 29 | oct = id + 2*(jd-1) + 4*(kd-1); 30 | 31 | if ( id == 1 ) 32 | { 33 | ich = NC - iop + 1; 34 | } 35 | else 36 | { 37 | ich = iop - NC; 38 | } 39 | 40 | /*********************************************************************** 41 | * Send ptr_in and ptr_out dimensions dependent on timedep because they 42 | * are not allocated if static problem 43 | ***********************************************************************/ 44 | d1 = 0; 45 | d2 = 0; 46 | d3 = 0; 47 | d4 = 0; 48 | i1 = 1; 49 | i2 = 1; 50 | if ( TIMEDEP == 1 ) 51 | { 52 | d1 = NANG; 53 | d2 = NX; 54 | d3 = NY; 55 | d4 = NZ; 56 | i1 = oct; 57 | i2 = g; 58 | } 59 | 60 | /*********************************************************************** 61 | * Call for the actual sweeper. Ensure proper size/bounds of time-dep 62 | * arrays is given to avoid errors. 63 | ***********************************************************************/ 64 | if ( NDIMEN == 1 ) 65 | { 66 | dim1_sweep ( input_vars, geom_vars, sn_vars, data_vars, 67 | control_vars, solvar_vars, dim_sweep_vars, 68 | id, oct, d1, d2, d3, d4, i1, i2, g, ierr ); 69 | } 70 | else 71 | { 72 | dim3_sweep ( input_vars, para_vars, geom_vars, sn_vars, data_vars, 73 | control_vars, solvar_vars, dim_sweep_vars, ich, id, 74 | d1, d2, d3, d4, jd, kd, jlo, klo, jhi, khi, jst, kst, 75 | i1, i2, oct, g, ierr ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ports/snap-c/solvar.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Module: solvar.c 3 | * 4 | * This module contains several variables that are used in the solution 5 | * process, including their allocation and deallocation. Also includes 6 | * initialization of sweep parameters. 7 | ***********************************************************************/ 8 | #include "snap.h" 9 | 10 | void solvar_data_init ( solvar_data *solvar_vars ) 11 | { 12 | FLUX = NULL; 13 | FLUXPO = NULL; 14 | FLUXPI = NULL; 15 | T_XS = NULL; 16 | A_XS = NULL; 17 | PSII = NULL; 18 | PSIJ = NULL; 19 | PSIK = NULL; 20 | JB_IN = NULL; 21 | JB_OUT = NULL; 22 | KB_IN = NULL; 23 | KB_OUT = NULL; 24 | FLKX = NULL; 25 | FLKY = NULL; 26 | FLKZ = NULL; 27 | QTOT = NULL; 28 | Q2GRP = NULL; 29 | FLUXM = NULL; 30 | S_XS = NULL; 31 | PTR_IN = NULL; 32 | PTR_OUT = NULL; 33 | } 34 | 35 | /*********************************************************************** 36 | * Allocate solution arrays. 37 | ***********************************************************************/ 38 | void solvar_alloc ( input_data *input_vars, sn_data* sn_vars, 39 | solvar_data *solvar_vars, int *ierr ) 40 | { 41 | /*********************************************************************** 42 | * Allocate ptr_in/out if needed. Provide an initial condition of zero 43 | * This may be changed in the future if necessary. 44 | ***********************************************************************/ 45 | if ( TIMEDEP == 1 ) 46 | { 47 | ALLOC_6D(PTR_IN, NANG, NX, NY, NZ, NOCT, NG, double, ierr); 48 | ALLOC_6D(PTR_OUT, NANG, NX, NY, NZ, NOCT, NG, double, ierr); 49 | } 50 | 51 | /*********************************************************************** 52 | * Allocate the flux moments arrays. Keep an old copy. 53 | ***********************************************************************/ 54 | ALLOC_4D(FLUX, NX, NY, NZ, NG, double, ierr); 55 | ALLOC_4D(FLUXPO, NX, NY, NZ, NG, double, ierr); 56 | ALLOC_4D(FLUXPI, NX, NY, NZ, NG, double, ierr); 57 | 58 | if ( (CMOM-1) != 0 ) 59 | { 60 | ALLOC_5D(FLUXM, (CMOM-1), NX, NY, NZ, NG, double, ierr); 61 | } 62 | 63 | /*********************************************************************** 64 | * Allocate the source arrays. 65 | ***********************************************************************/ 66 | ALLOC_5D(Q2GRP, CMOM, NX, NY, NZ, NG, double, ierr); 67 | ALLOC_5D(QTOT, CMOM, NX, NY, NZ, NG, double, ierr); 68 | 69 | /*********************************************************************** 70 | * Allocate the cross section expanded to spatial mesh arrays 71 | ***********************************************************************/ 72 | ALLOC_4D(T_XS, NX, NY, NZ, NG, double, ierr); 73 | ALLOC_4D(A_XS, NX, NY, NZ, NG, double, ierr); 74 | ALLOC_5D(S_XS, NMOM, NX, NY, NZ, NG, double, ierr); 75 | 76 | /*********************************************************************** 77 | * Working arrays 78 | ***********************************************************************/ 79 | ALLOC_4D(PSII, NANG, NY, NZ, NG, double, ierr); 80 | ALLOC_4D(PSIJ, NANG, ICHUNK, NZ, NG, double, ierr); 81 | ALLOC_4D(PSIK, NANG, ICHUNK, NY, NG, double, ierr); 82 | 83 | /*********************************************************************** 84 | * PE boundary flux arrays 85 | ***********************************************************************/ 86 | ALLOC_4D(JB_IN, NANG, ICHUNK, NZ, NG, double, ierr); 87 | ALLOC_4D(JB_OUT, NANG, ICHUNK, NZ, NG, double, ierr); 88 | ALLOC_4D(KB_IN, NANG, ICHUNK, NY, NG, double, ierr); 89 | ALLOC_4D(KB_OUT, NANG, ICHUNK, NY, NG, double, ierr); 90 | 91 | /*********************************************************************** 92 | * Leakage arrays 93 | ***********************************************************************/ 94 | ALLOC_4D(FLKX, (NX+1), NY, NZ, NG, double, ierr); 95 | ALLOC_4D(FLKY, NX, (NY+1), NZ, NG, double, ierr); 96 | ALLOC_4D(FLKZ, NX, NY, (NZ+1), NG, double, ierr); 97 | } 98 | 99 | void solvar_dealloc ( solvar_data *solvar_vars ) 100 | { 101 | FREE(FLUX); 102 | FREE(FLUXPO); 103 | FREE(FLUXPI); 104 | FREE(T_XS); 105 | FREE(A_XS); 106 | FREE(PSII); 107 | FREE(PSIJ); 108 | FREE(PSIK); 109 | FREE(JB_IN); 110 | FREE(JB_OUT); 111 | FREE(KB_IN); 112 | FREE(KB_OUT); 113 | FREE(FLKX); 114 | FREE(FLKY); 115 | FREE(FLKZ); 116 | FREE(QTOT); 117 | FREE(Q2GRP); 118 | FREE(FLUXM); 119 | FREE(S_XS); 120 | FREE(PTR_IN); 121 | FREE(PTR_OUT); 122 | } 123 | -------------------------------------------------------------------------------- /ports/snap-c/time.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * MODULE: time_module 3 | * This module contains the variables that measure SNAP's execution 4 | * times for different pieces of code and the subroutine used to get the 5 | * time. It also has the timing summary print. 6 | ***********************************************************************/ 7 | #include "snap.h" 8 | 9 | /*********************************************************************** 10 | * Initialize time_data struct values to 0 11 | ***********************************************************************/ 12 | void time_data_init ( time_data *time_vars ) 13 | { 14 | time_vars->tsnap = 0; 15 | time_vars->tparset = 0; 16 | time_vars->tinp = 0; 17 | time_vars->tset = 0; 18 | time_vars->tslv = 0; 19 | time_vars->tparam = 0; 20 | time_vars->totrsrc = 0; 21 | time_vars->tinners = 0; 22 | time_vars->tinrsrc = 0; 23 | time_vars->tsweeps = 0; 24 | time_vars->tinrmisc = 0; 25 | time_vars->tslvmisc = 0; 26 | time_vars->tout = 0; 27 | time_vars->tgrind = 0; 28 | } 29 | 30 | 31 | /*********************************************************************** 32 | * Get the current walltime 33 | ***********************************************************************/ 34 | double wtime ( ) 35 | { 36 | return MPI_Wtime ( );; 37 | } 38 | 39 | void time_summ ( FILE *fp_out, time_data *time_vars ) 40 | { 41 | TINRMISC = TINNERS - ( TINRSRC + TSWEEPS ); 42 | TSLVMISC = TSLV - ( TPARAM + TOTRSRC + TINNERS ); 43 | 44 | fprintf ( fp_out, "\n Timing Summary\n" 45 | "****************************************" 46 | "****************************************\n\n" ); 47 | 48 | fprintf ( fp_out, " Code Section Time (seconds)\n" ); 49 | fprintf ( fp_out, " ************** ****************\n" ); 50 | fprintf ( fp_out, " Parallel Setup %.4E\n", TPARSET ); 51 | fprintf ( fp_out, " Input %.4E\n", TINP ); 52 | fprintf ( fp_out, " Setup %.4E\n", TSET ); 53 | fprintf ( fp_out, " Solve %.4E\n", TSLV ); 54 | fprintf ( fp_out, " Parameter Setup %.4E\n", TPARAM ); 55 | fprintf ( fp_out, " Outer Source %.4E\n", TOTRSRC ); 56 | fprintf ( fp_out, " Inner Iterations %.4E\n", TINNERS ); 57 | fprintf ( fp_out, " Inner Source %.4E\n", TINRSRC ); 58 | fprintf ( fp_out, " Transport Sweeps %.4E\n", TSWEEPS ); 59 | fprintf ( fp_out, " Inner Misc Ops %.4E\n", TINRMISC ); 60 | fprintf ( fp_out, " Solution Misc Ops %.4E\n", TSLVMISC ); 61 | fprintf ( fp_out, " Output %.4E\n", TOUT ); 62 | } 63 | -------------------------------------------------------------------------------- /ports/snap-c/version.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Handles version information 3 | ***********************************************************************/ 4 | #include "snap.h" 5 | #include 6 | 7 | // SNAP release number and release date. 8 | int version = 101; 9 | char *cvers = "1.01"; 10 | char *vdate = "11-10-2014"; 11 | 12 | /*********************************************************************** 13 | * Print version information 14 | ***********************************************************************/ 15 | void version_print ( FILE *fp_out ) 16 | { 17 | // Local variables. 18 | time_t t = time ( NULL ); 19 | struct tm tm = *localtime ( &t ); 20 | 21 | // Call intrinsics to get current date and time. 22 | // Print version information to out file. 23 | fprintf ( fp_out, " SNAP: SN (Discrete Ordinates) Application Proxy\n" ); 24 | fprintf ( fp_out, " Version Number.. %s\n", cvers ); 25 | fprintf ( fp_out, " Version Date.. %s\n", vdate); 26 | fprintf ( fp_out, " Ran on %d-%d-%d", tm.tm_mon + 1, tm.tm_mday, tm.tm_year); 27 | fprintf ( fp_out, " at time %d:%d:%d\n\n", tm.tm_hour, tm.tm_min, tm.tm_sec ); 28 | } 29 | -------------------------------------------------------------------------------- /ports/snap-kf/README.md: -------------------------------------------------------------------------------- 1 | Build 2 | ----- 3 | 4 | 1) export/setenv KPATH to Kokkos root directory 5 | 2) make 6 | 3) make link 7 | 8 | 9 | Run 10 | --- 11 | 12 | As per usual with SNAP. 13 | 14 | Description 15 | ----------- 16 | 17 | Simple demonstration of Fortran accessing memory allocated in a Kokkos View. See kokkos_c_interface / kokkos_f_interface for source, and see (for now) sn.f90 for usage. 18 | 19 | The intention is for this code to use UVM memory. 20 | 21 | -------------------------------------------------------------------------------- /ports/snap-kf/analyze.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: analyze_module 4 | !> @brief 5 | !> This module contains subroutines for analyzing data. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE analyze_module 10 | 11 | USE global_module, ONLY: i_knd, r_knd, ounit 12 | 13 | USE control_module, ONLY: timedep 14 | 15 | USE geom_module, ONLY: dx, dy, dz, nx, ny, nz, ndimen 16 | 17 | USE data_module, ONLY: v, ng 18 | 19 | USE solvar_module, ONLY: flux0, pop 20 | 21 | USE plib_module, ONLY: iproc, root, comm_snap, rtsum 22 | 23 | IMPLICIT NONE 24 | 25 | PUBLIC 26 | 27 | SAVE 28 | 29 | 30 | CONTAINS 31 | 32 | 33 | SUBROUTINE analyze_pop_calc ( cy, time ) 34 | 35 | !----------------------------------------------------------------------- 36 | ! 37 | ! Compute the neutron spectrum: the population per group integrated over 38 | ! volume. 39 | ! 40 | !----------------------------------------------------------------------- 41 | 42 | INTEGER(i_knd), INTENT(IN) :: cy 43 | 44 | REAL(r_knd), INTENT(IN) :: time 45 | !_______________________________________________________________________ 46 | ! 47 | ! Local variables 48 | !_______________________________________________________________________ 49 | 50 | INTEGER(i_knd) :: g 51 | 52 | REAL(r_knd) :: vol 53 | 54 | REAL(r_knd), DIMENSION(nx,ny,nz,ng) :: tmp 55 | !_______________________________________________________________________ 56 | ! 57 | ! Integrate flux over volume of local spatial sub-domain 58 | !_______________________________________________________________________ 59 | 60 | vol = dx 61 | IF ( ndimen > 1 ) THEN 62 | vol = vol*dy 63 | IF ( ndimen > 2 ) vol = vol*dz 64 | END IF 65 | tmp = vol*flux0 66 | 67 | DO g = 1, ng 68 | pop(g) = SUM( tmp(:,:,:,g) ) 69 | END DO 70 | !_______________________________________________________________________ 71 | ! 72 | ! Integrate over global volume with MPI reduction (to root only, not 73 | ! all_reduce) 74 | !_______________________________________________________________________ 75 | 76 | CALL rtsum ( pop, ng, comm_snap, root ) 77 | !_______________________________________________________________________ 78 | ! 79 | ! Divide volume integrated flux by velocity to get particle density 80 | ! per unit energy. Print out results. Note, only root process has 81 | ! correct value because the reduction is not global. Can easily 82 | ! change this though. 83 | !_______________________________________________________________________ 84 | 85 | IF ( iproc == root ) THEN 86 | 87 | IF ( timedep == 1 ) THEN 88 | pop = pop/v 89 | ELSE 90 | WRITE( ounit, 352 ) 91 | END IF 92 | 93 | WRITE( ounit, 350 ) cy, time 94 | DO g = 1, ng 95 | WRITE( ounit, 351 ) g, pop(g) 96 | END DO 97 | WRITE( ounit, * ) 98 | 99 | END IF 100 | !_______________________________________________________________________ 101 | 102 | 350 FORMAT( 2X, 'Particle spectrum, cycle (time)', I4, ' ( ', & 103 | ES11.4, ' )' ) 104 | 351 FORMAT( 8X, I4, ES13.6 ) 105 | 352 FORMAT( 2X, 'Static calc: v(g) not set. Use dummy value of 1.' ) 106 | !_______________________________________________________________________ 107 | !_______________________________________________________________________ 108 | 109 | END SUBROUTINE analyze_pop_calc 110 | 111 | 112 | END MODULE analyze_module 113 | -------------------------------------------------------------------------------- /ports/snap-kf/control.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: control_module 4 | !> @brief 5 | !> This module contains the variables that control SNAP's solver 6 | !> routines. This includes the time-dependent variables. It also 7 | !> includes some KBA scheduling variables. 8 | ! 9 | !----------------------------------------------------------------------- 10 | 11 | MODULE control_module 12 | 13 | USE global_module, ONLY: i_knd, r_knd, l_knd, zero, one 14 | 15 | IMPLICIT NONE 16 | 17 | PUBLIC 18 | 19 | SAVE 20 | !_______________________________________________________________________ 21 | ! 22 | ! Module Input Variables 23 | ! 24 | ! epsi - convergence criterion 25 | ! iitm - max inner iterations 26 | ! oitm - max outer iterations 27 | ! timedep - 0/1=no/yes perform a time-dependent calculation 28 | ! tf - final time 29 | ! nsteps - number of time steps to cover the ts -> tf range 30 | ! 31 | ! swp_typ - 0/1=standard order/mini-KBA sweep 32 | ! cor_swp - 0/1=no/yes concurrent octant mesh sweeps (corner starts) 33 | ! 34 | ! angcpy - 1/2 copies of the time-edge angular flux 35 | ! 36 | ! it_det - 0/1=no/yes full iteration details 37 | ! soloutp - 0/1=no/yes print single k-plane solution to output file 38 | ! kplane - 0/1+=default mid-plane/k-plane index to print with soloutp 39 | ! popout - 0/1/2=no/final only/every cycle print population data to 40 | ! output file 41 | ! fluxp - 0/1/2=print none/scalar flux/all flux moments to file 42 | ! 43 | ! fixup - 0/1=no/yes perform flux fixup 44 | !_______________________________________________________________________ 45 | 46 | INTEGER(i_knd) :: iitm=5, oitm=100, timedep=0, nsteps=1, swp_typ=0, & 47 | cor_swp=0, angcpy=1, it_det=0, soloutp=0, kplane=0, popout=0, & 48 | fluxp=0, fixup=1 49 | 50 | REAL(r_knd) :: epsi=1.0E-4_r_knd, tf=zero 51 | !_______________________________________________________________________ 52 | ! 53 | ! Run-time variables 54 | ! 55 | ! dt - time-step size 56 | ! 57 | ! tolr - parameter, small number used for determining how to 58 | ! compute flux error 59 | ! dfmxi(ng) - max error of inner iteration 60 | ! dfmxo - max error of outer iteration 61 | ! 62 | ! inrdone(ng) - logical for inners being complete 63 | ! otrdone - logical for outers being complete 64 | ! update_ptr - true/false update the ptr_out array 65 | ! 66 | ! ncor - number of corners from which sweeps begin 67 | ! last_oct - last octant to be swept 68 | ! corner_sch(2,4) - corner scheduling control array 69 | ! yzstg(ncor) - KBA stage in yz plane per starting corner 70 | !_______________________________________________________________________ 71 | 72 | LOGICAL(l_knd) :: otrdone, update_ptr 73 | 74 | LOGICAL(l_knd), ALLOCATABLE, DIMENSION(:) :: inrdone 75 | 76 | INTEGER(i_knd) :: ncor, last_oct, corner_sch(2,4) 77 | 78 | INTEGER(i_knd), ALLOCATABLE, DIMENSION(:) :: yzstg 79 | 80 | REAL(r_knd) :: dt, dfmxo 81 | 82 | REAL(r_knd), PARAMETER :: tolr=1.0E-12_r_knd 83 | 84 | REAL(r_knd), ALLOCATABLE, DIMENSION(:) :: dfmxi 85 | 86 | 87 | CONTAINS 88 | 89 | 90 | SUBROUTINE control_allocate ( ng, ierr ) 91 | 92 | !----------------------------------------------------------------------- 93 | ! 94 | ! Allocate control module variables. 95 | ! 96 | !----------------------------------------------------------------------- 97 | 98 | INTEGER(i_knd), INTENT(IN) :: ng 99 | 100 | INTEGER(i_knd), INTENT(OUT) :: ierr 101 | !_______________________________________________________________________ 102 | 103 | ierr = 0 104 | ALLOCATE( yzstg(ncor), dfmxi(ng), inrdone(ng), STAT=ierr ) 105 | IF ( ierr /= 0 ) RETURN 106 | 107 | yzstg = 0 108 | 109 | dfmxi = -one 110 | inrdone = .FALSE. 111 | dfmxo = -one 112 | otrdone = .FALSE. 113 | update_ptr = .FALSE. 114 | !_______________________________________________________________________ 115 | !_______________________________________________________________________ 116 | 117 | END SUBROUTINE control_allocate 118 | 119 | 120 | SUBROUTINE control_deallocate 121 | 122 | !----------------------------------------------------------------------- 123 | ! 124 | ! Deallocate control module arrays. 125 | ! 126 | !----------------------------------------------------------------------- 127 | !_______________________________________________________________________ 128 | 129 | DEALLOCATE( yzstg, dfmxi, inrdone ) 130 | !_______________________________________________________________________ 131 | !_______________________________________________________________________ 132 | 133 | END SUBROUTINE control_deallocate 134 | 135 | 136 | END MODULE control_module 137 | -------------------------------------------------------------------------------- /ports/snap-kf/dealloc.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: dealloc_module 4 | !> @brief 5 | !> This module controls the deallocation process of run-time arrays. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE dealloc_module 10 | 11 | USE global_module, ONLY: i_knd 12 | 13 | USE sn_module, ONLY: sn_deallocate 14 | 15 | USE data_module, ONLY: data_deallocate 16 | 17 | USE mms_module, ONLY: mms_deallocate 18 | 19 | USE geom_module, ONLY: geom_deallocate 20 | 21 | USE solvar_module, ONLY: solvar_deallocate 22 | 23 | USE control_module, ONLY: control_deallocate 24 | 25 | IMPLICIT NONE 26 | 27 | PUBLIC 28 | 29 | 30 | CONTAINS 31 | 32 | 33 | SUBROUTINE dealloc_input ( flg ) 34 | 35 | !----------------------------------------------------------------------- 36 | ! 37 | ! Call for the data deallocation from individual deallocation 38 | ! subroutines. Covers the allocations from input. 39 | ! 40 | !----------------------------------------------------------------------- 41 | 42 | INTEGER(i_knd), INTENT(IN) :: flg 43 | !_______________________________________________________________________ 44 | 45 | CALL sn_deallocate 46 | 47 | IF ( flg > 1 ) CALL data_deallocate 48 | 49 | IF ( flg > 2 ) CALL control_deallocate 50 | 51 | IF ( flg > 3 ) CALL mms_deallocate 52 | !_______________________________________________________________________ 53 | !_______________________________________________________________________ 54 | 55 | END SUBROUTINE dealloc_input 56 | 57 | 58 | SUBROUTINE dealloc_solve ( swp_typ, flg ) 59 | 60 | !----------------------------------------------------------------------- 61 | ! 62 | ! Call for the data deallocation from individual deallocation 63 | ! subroutines. Covers the allocations from input. 64 | ! 65 | !----------------------------------------------------------------------- 66 | 67 | INTEGER(i_knd), INTENT(IN) :: swp_typ, flg 68 | !_______________________________________________________________________ 69 | 70 | CALL geom_deallocate ( swp_typ ) 71 | 72 | IF ( flg > 1 ) CALL solvar_deallocate 73 | !_______________________________________________________________________ 74 | !_______________________________________________________________________ 75 | 76 | END SUBROUTINE dealloc_solve 77 | 78 | 79 | END MODULE dealloc_module 80 | -------------------------------------------------------------------------------- /ports/snap-kf/expxs.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: expxs_module 4 | !> @brief 5 | !> This module contains the subroutines for expanding a cross section to 6 | !> a full spatial map. 7 | ! 8 | !----------------------------------------------------------------------- 9 | 10 | MODULE expxs_module 11 | 12 | USE global_module, ONLY: i_knd, r_knd, zero 13 | 14 | USE geom_module, ONLY: nx, ny, nz 15 | 16 | USE sn_module, ONLY: nmom, cmom, lma 17 | 18 | USE data_module, ONLY: nmat 19 | 20 | IMPLICIT NONE 21 | 22 | PUBLIC 23 | 24 | INTERFACE expxs_reg 25 | MODULE PROCEDURE expxs_reg_1d, expxs_reg_3d 26 | END INTERFACE 27 | 28 | SAVE 29 | 30 | 31 | CONTAINS 32 | 33 | 34 | SUBROUTINE expxs_reg_1d ( xs, map, cs ) 35 | 36 | !----------------------------------------------------------------------- 37 | ! 38 | ! Expand one of the sig*(nmat,ng) arrays to a 1D spatial mapping. xs is 39 | ! a generic cross section array, map is the material map, and cs is the 40 | ! cross section expanded to the mesh. 41 | ! 42 | !----------------------------------------------------------------------- 43 | 44 | INTEGER(i_knd), DIMENSION(nx), INTENT(IN) :: map 45 | 46 | REAL(r_knd), DIMENSION(nmat), INTENT(IN) :: xs 47 | 48 | REAL(r_knd), DIMENSION(nx), INTENT(OUT) :: cs 49 | !_______________________________________________________________________ 50 | ! 51 | ! Local variables 52 | !_______________________________________________________________________ 53 | 54 | INTEGER(i_knd) :: i 55 | !_______________________________________________________________________ 56 | 57 | DO i = 1, nx 58 | cs(i) = xs(map(i)) 59 | END DO 60 | !_______________________________________________________________________ 61 | !_______________________________________________________________________ 62 | 63 | END SUBROUTINE expxs_reg_1d 64 | 65 | 66 | SUBROUTINE expxs_reg_3d ( xs, map, cs ) 67 | 68 | !----------------------------------------------------------------------- 69 | ! 70 | ! Expand one of the sig*(nmat,ng) arrays to a 3D spatial mapping. xs is 71 | ! a generic cross section array, map is the material map, and cs is the 72 | ! cross section expanded to the mesh. 73 | ! 74 | !----------------------------------------------------------------------- 75 | 76 | INTEGER(i_knd), DIMENSION(nx,ny,nz), INTENT(IN) :: map 77 | 78 | REAL(r_knd), DIMENSION(nmat), INTENT(IN) :: xs 79 | 80 | REAL(r_knd), DIMENSION(nx,ny,nz), INTENT(OUT) :: cs 81 | !_______________________________________________________________________ 82 | ! 83 | ! Local variables 84 | !_______________________________________________________________________ 85 | 86 | INTEGER(i_knd) :: i, j, k 87 | !_______________________________________________________________________ 88 | 89 | DO k = 1, nz 90 | DO j = 1, ny 91 | DO i = 1, nx 92 | cs(i,j,k) = xs(map(i,j,k)) 93 | END DO 94 | END DO 95 | END DO 96 | !_______________________________________________________________________ 97 | !_______________________________________________________________________ 98 | 99 | END SUBROUTINE expxs_reg_3d 100 | 101 | 102 | SUBROUTINE expxs_slgg ( scat, map, cs ) 103 | 104 | !----------------------------------------------------------------------- 105 | ! 106 | ! Expand the slgg(nmat,nmom,ng,ng) array to a 1D spatial mapping. scat 107 | ! is the slgg matrix for a single h->g group coupling, map is the 108 | ! material map, and cs is the scattering matrix expanded to the mesh. 109 | ! 110 | !----------------------------------------------------------------------- 111 | 112 | INTEGER(i_knd), DIMENSION(nx), INTENT(IN) :: map 113 | 114 | REAL(r_knd), DIMENSION(nmat,nmom), INTENT(IN) :: scat 115 | 116 | REAL(r_knd), DIMENSION(cmom-1,nx), INTENT(OUT) :: cs 117 | !_______________________________________________________________________ 118 | ! 119 | ! Local variables 120 | !_______________________________________________________________________ 121 | 122 | INTEGER(i_knd) :: l, i, mom 123 | !_______________________________________________________________________ 124 | 125 | cs = zero 126 | 127 | DO i = 1, nx 128 | mom = 1 129 | DO l = 2, nmom 130 | cs(mom:mom+lma(l)-1,i) = scat(map(i),l) 131 | mom = mom + lma(l) 132 | END DO 133 | END DO 134 | !_______________________________________________________________________ 135 | !_______________________________________________________________________ 136 | 137 | END SUBROUTINE expxs_slgg 138 | 139 | 140 | END MODULE expxs_module 141 | -------------------------------------------------------------------------------- /ports/snap-kf/global.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: global_module 4 | !> @brief 5 | !> Global variables for data types, file names and unit numbers, and 6 | !> commonly used numbers 7 | ! 8 | !----------------------------------------------------------------------- 9 | 10 | MODULE global_module 11 | 12 | IMPLICIT NONE 13 | 14 | PUBLIC 15 | 16 | SAVE 17 | !_______________________________________________________________________ 18 | ! 19 | ! Numerical kinds. 20 | !_______________________________________________________________________ 21 | 22 | INTEGER, PARAMETER :: l_knd = KIND( .TRUE. ) 23 | INTEGER, PARAMETER :: i_knd = SELECTED_INT_KIND( 8 ) 24 | INTEGER, PARAMETER :: r_knd = SELECTED_REAL_KIND( 13 ) 25 | !_______________________________________________________________________ 26 | ! 27 | ! File names and unit numbers. 28 | ! 29 | ! ifile - input file name 30 | ! iunit - input file unit number 31 | ! ofile - output file name 32 | ! ounit - output file unit number 33 | !_______________________________________________________________________ 34 | 35 | CHARACTER(LEN=64) :: ifile, ofile 36 | 37 | INTEGER(i_knd), PARAMETER :: iunit=10, ounit=11 38 | !_______________________________________________________________________ 39 | ! 40 | ! Commonly used numbers. 41 | !_______________________________________________________________________ 42 | 43 | REAL(r_knd), PARAMETER :: zero = 0.0_r_knd 44 | REAL(r_knd), PARAMETER :: half = 0.5_r_knd 45 | REAL(r_knd), PARAMETER :: one = 1.0_r_knd 46 | REAL(r_knd), PARAMETER :: two = 2.0_r_knd 47 | 48 | REAL(r_knd), PARAMETER :: pi = 3.14159265358979_r_knd 49 | !_______________________________________________________________________ 50 | !_______________________________________________________________________ 51 | 52 | 53 | END MODULE global_module 54 | -------------------------------------------------------------------------------- /ports/snap-kf/gsnap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lanl/SNAP/e7ab43dfb0c16419d9a42d756141d5957ac526fc/ports/snap-kf/gsnap -------------------------------------------------------------------------------- /ports/snap-kf/kokkos_c_interface.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" 9 | { 10 | #endif 11 | 12 | typedef typename Kokkos::DefaultExecutionSpace device_t; 13 | 14 | typedef Kokkos::TeamPolicy team_policy_t; 15 | 16 | typedef Kokkos::View< int*, Kokkos::LayoutLeft, device_t > view_1i_t; 17 | 18 | typedef Kokkos::View< double*, Kokkos::LayoutLeft, device_t > view_1d_t; 19 | 20 | typedef Kokkos::View< double**, Kokkos::LayoutLeft, device_t > view_2d_t; 21 | 22 | typedef Kokkos::View< double***, Kokkos::LayoutLeft, device_t > view_3d_t; 23 | 24 | typedef Kokkos::View< double****, Kokkos::LayoutLeft, device_t > view_4d_t; 25 | 26 | typedef Kokkos::View< double*****, Kokkos::LayoutLeft, device_t > view_5d_t; 27 | 28 | typedef Kokkos::View< double******, Kokkos::LayoutLeft, device_t > view_6d_t; 29 | 30 | typedef Kokkos::View< double*******, Kokkos::LayoutLeft, device_t > view_7d_t; 31 | 32 | typedef Kokkos::View< double*, Kokkos::LayoutStride, device_t > s_view_1d_t; 33 | 34 | typedef Kokkos::View< double**, Kokkos::LayoutStride, device_t > s_view_2d_t; 35 | 36 | typedef Kokkos::View< double***, Kokkos::LayoutStride, device_t > s_view_3d_t; 37 | 38 | typedef Kokkos::View< double****, Kokkos::LayoutStride, device_t > s_view_4d_t; 39 | 40 | void c_kokkos_initialize_with_args( int argc, char *argv[] ); 41 | void c_kokkos_initialize( void ); 42 | void c_kokkos_finalize( void ); 43 | void c_kokkos_daxpy( const int* n, const double* a, const double* x, double* y ); 44 | void c_kokkos_allocate_A( const int* m, const int* n, double** raw_A, view_2d_t v_A ); 45 | 46 | 47 | void c_kokkos_allocate_1i( const int* m, int** A,view_1i_t** v_A,const char* a_name ); 48 | 49 | void c_kokkos_allocate_1d( const int* m, double** A,view_1d_t** v_A,const char* a_name ); 50 | 51 | void c_kokkos_allocate_2d( const int* m, const int* n, double** A,view_2d_t** v_A,const char* a_name ); 52 | void c_kokkos_allocate_3d( const int* m, const int* n, const int* o, double** A,view_3d_t** v_A,const char* a_name ); 53 | void c_kokkos_allocate_4d( const int* m, const int* n, const int* o, const int* p, 54 | double** A,view_4d_t** v_A,const char* a_name ); 55 | void c_kokkos_allocate_5d( const int* m, const int* n, const int* o, const int* p, const int* q, 56 | double** A,view_5d_t** v_A,const char* a_name ); 57 | void c_kokkos_allocate_6d( const int* m, const int* n, const int* o, const int* p, const int* q, const int* r, 58 | double** A,view_6d_t** v_A,const char* a_name ); 59 | void c_kokkos_allocate_7d( const int* m, const int* n, const int* o, const int* p, const int* q, const int* r, const int* s, 60 | double** A,view_7d_t** v_A,const char* a_name ); 61 | 62 | void c_kokkos_free_1d( view_1d_t** v_A ); 63 | void c_kokkos_free_2d( view_2d_t** v_A ); 64 | void c_kokkos_free_4d( view_4d_t** v_A ); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /ports/snap-kf/sweep.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: sweep_module 4 | !> @brief 5 | !> This module controls the mesh sweep scheduling. It directs the flow 6 | !> of KBA stages for different octants, groups, spatial work chunks. 7 | ! 8 | !----------------------------------------------------------------------- 9 | 10 | MODULE sweep_module 11 | 12 | USE global_module, ONLY: i_knd, zero, one 13 | 14 | USE data_module, ONLY: ng 15 | 16 | USE geom_module, ONLY: ndiag 17 | 18 | USE control_module, ONLY: inrdone, swp_typ, ncor, corner_sch 19 | 20 | USE octsweep_module, ONLY: octsweep 21 | 22 | USE solvar_module, ONLY: flkx, flky, flkz, fmin, fmax 23 | 24 | USE plib_module, ONLY: nthreads, waitinit 25 | 26 | USE thrd_comm_module, ONLY: assign_thrd_set 27 | 28 | IMPLICIT NONE 29 | 30 | PRIVATE 31 | 32 | PUBLIC :: sweep 33 | 34 | SAVE 35 | 36 | 37 | CONTAINS 38 | 39 | 40 | SUBROUTINE sweep ( t, do_grp, ng_per_thrd, nnstd_used, grp_act ) 41 | 42 | !----------------------------------------------------------------------- 43 | ! 44 | ! Driver for the mesh sweeps. Manages the loops over octant pairs. 45 | ! 46 | !----------------------------------------------------------------------- 47 | 48 | INTEGER(i_knd), INTENT(IN) :: t 49 | 50 | INTEGER(i_knd), INTENT(INOUT) :: ng_per_thrd, nnstd_used 51 | 52 | INTEGER(i_knd), DIMENSION(ng), INTENT(INOUT) :: do_grp 53 | 54 | INTEGER(i_knd), DIMENSION(ng,nthreads), INTENT(INOUT) :: grp_act 55 | 56 | !_______________________________________________________________________ 57 | ! 58 | ! Local variables 59 | !_______________________________________________________________________ 60 | 61 | INTEGER(i_knd) :: corner, jd, kd, g, n 62 | 63 | INTEGER(i_knd), DIMENSION(2) :: reqs 64 | !_______________________________________________________________________ 65 | ! 66 | ! Assign the work to threads. Main level threads always applied to 67 | ! energy groups. Apply nested threads additionally to groups if 68 | ! swp_typ is 0. Apply nested threads to mini-KBA if swp_typ is 1. 69 | !_______________________________________________________________________ 70 | 71 | !$OMP MASTER 72 | 73 | do_grp = 1 74 | WHERE ( inrdone ) do_grp = 0 75 | 76 | CALL assign_thrd_set ( do_grp, ng, ng_per_thrd, ndiag, nnstd_used, & 77 | grp_act ) 78 | 79 | !$OMP END MASTER 80 | !$OMP BARRIER 81 | !_______________________________________________________________________ 82 | ! 83 | ! Each thread initializes the reqs (send request) array for 84 | ! asynchronous sends. 85 | !_______________________________________________________________________ 86 | 87 | CALL waitinit ( reqs, SIZE( reqs ) ) 88 | !_______________________________________________________________________ 89 | ! 90 | ! Clean up and initialize some values. 91 | !_______________________________________________________________________ 92 | 93 | clean_loop: DO n = 1, ng_per_thrd 94 | 95 | g = grp_act(n,t) 96 | IF ( g == 0 ) EXIT clean_loop 97 | 98 | fmin(g) = HUGE( one ) 99 | fmax(g) = zero 100 | 101 | flkx(:,:,:,g) = zero 102 | flky(:,:,:,g) = zero 103 | flkz(:,:,:,g) = zero 104 | 105 | END DO clean_loop 106 | !_______________________________________________________________________ 107 | ! 108 | ! Loop over octant pairs; set the starting corner, i.e., the direction 109 | ! in y and z. Spawn the nested threads if used. 110 | !_______________________________________________________________________ 111 | 112 | !$OMP PARALLEL NUM_THREADS(nnstd_used) IF(nnstd_used>1) & 113 | !$OMP& DEFAULT(SHARED) PRIVATE(corner,jd,kd,g) PROC_BIND(CLOSE) 114 | corner_loop: DO corner = 1, ncor 115 | 116 | jd = corner_sch(1,corner) 117 | kd = corner_sch(2,corner) 118 | !_______________________________________________________________________ 119 | ! 120 | ! Loop over the groups assigned to each thread. 121 | !_______________________________________________________________________ 122 | 123 | grp_loop: DO n = 1, ng_per_thrd 124 | 125 | g = grp_act(n,t) 126 | !_______________________________________________________________________ 127 | ! 128 | ! Sweep all the chunks of an octant pair (+/- x-dir). 129 | !_______________________________________________________________________ 130 | 131 | CALL octsweep ( g, jd, kd, t, reqs, SIZE( reqs ) ) 132 | !_______________________________________________________________________ 133 | ! 134 | ! End the loops. Destroy the task set. 135 | !_______________________________________________________________________ 136 | 137 | END DO grp_loop 138 | 139 | END DO corner_loop 140 | !$OMP END PARALLEL 141 | !_______________________________________________________________________ 142 | !_______________________________________________________________________ 143 | 144 | END SUBROUTINE sweep 145 | 146 | 147 | END MODULE sweep_module 148 | -------------------------------------------------------------------------------- /ports/snap-kf/time.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: time_module 4 | !> @brief 5 | !> This module contains the variables that measure SNAP execution 6 | !> times for different pieces of code and the subroutine used to get the 7 | !> time. It also has the timing summary print. 8 | ! 9 | !----------------------------------------------------------------------- 10 | 11 | MODULE time_module 12 | 13 | USE global_module, ONLY: r_knd, i_knd, zero, ounit 14 | 15 | #ifdef MPI 16 | USE mpi 17 | #endif 18 | 19 | IMPLICIT NONE 20 | 21 | PUBLIC 22 | 23 | SAVE 24 | !_______________________________________________________________________ 25 | ! 26 | ! Run-time variables 27 | ! 28 | ! tsnap - total SNAP run time 29 | ! tparset - parallel environment setup time 30 | ! tinp - input run time 31 | ! tset - setup run time 32 | ! tslv - total solution run time 33 | ! tparam - time for setting up solve parameters 34 | ! totrsrc - time for outer source computations 35 | ! tinners - total time spent on inner iterations 36 | ! tinrsrc - time for inner source computations 37 | ! tsweeps - time for transport sweeps, including angular sourc compute 38 | ! tinrmisc - time for miscellaneous inner ops 39 | ! tslvmisc - time for miscellaneous solution ops 40 | ! tout - output run time 41 | ! tgrind - transport grind time 42 | !_______________________________________________________________________ 43 | 44 | REAL(r_knd) :: tsnap=zero, tparset=zero, tinp=zero, tset=zero, & 45 | tslv=zero, tparam=zero, totrsrc=zero, tinners=zero, tinrsrc=zero, & 46 | tsweeps=zero, tinrmisc=zero, tslvmisc=zero, tout=zero, tgrind=zero 47 | 48 | 49 | CONTAINS 50 | 51 | 52 | SUBROUTINE wtime ( time ) 53 | 54 | !----------------------------------------------------------------------- 55 | ! 56 | ! Get the current time 57 | ! 58 | !----------------------------------------------------------------------- 59 | 60 | REAL(r_knd), INTENT(OUT) :: time 61 | !_______________________________________________________________________ 62 | 63 | #ifdef MPI 64 | time = MPI_WTIME() 65 | #else 66 | CALL CPU_TIME ( time ) 67 | #endif 68 | !_______________________________________________________________________ 69 | !_______________________________________________________________________ 70 | 71 | END SUBROUTINE wtime 72 | 73 | 74 | SUBROUTINE time_summ 75 | 76 | !----------------------------------------------------------------------- 77 | ! 78 | ! Print the timing summary to the output file. 79 | ! 80 | !----------------------------------------------------------------------- 81 | !_______________________________________________________________________ 82 | ! 83 | ! Local variables 84 | !_______________________________________________________________________ 85 | 86 | CHARACTER(LEN=1) :: star='*' 87 | 88 | INTEGER(i_knd) :: i 89 | !_______________________________________________________________________ 90 | 91 | tinrmisc = tinners - ( tinrsrc + tsweeps ) 92 | tslvmisc = tslv - ( tparam + totrsrc + tinners ) 93 | 94 | WRITE( ounit, 401 ) ( star, i = 1, 80 ) 95 | WRITE( ounit, 402 ) 96 | WRITE( ounit, 403 ) tparset 97 | WRITE( ounit, 404 ) tinp 98 | WRITE( ounit, 405 ) tset 99 | WRITE( ounit, 406 ) tslv 100 | WRITE( ounit, 407 ) tparam 101 | WRITE( ounit, 408 ) totrsrc 102 | WRITE( ounit, 409 ) tinners 103 | WRITE( ounit, 410 ) tinrsrc 104 | WRITE( ounit, 411 ) tsweeps 105 | WRITE( ounit, 412 ) tinrmisc 106 | WRITE( ounit, 413 ) tslvmisc 107 | WRITE( ounit, 414 ) tout 108 | !_______________________________________________________________________ 109 | 110 | 401 FORMAT( 10X, 'keyword Timing Summary', /, 80A, / ) 111 | 402 FORMAT( 2X, 'Code Section', T41, 'Time (seconds)', /, & 112 | 1X, '**************', T40, '****************' ) 113 | 403 FORMAT( 4X, 'Parallel Setup', T41, ES11.4 ) 114 | 404 FORMAT( 4X, 'Input', T41, ES11.4 ) 115 | 405 FORMAT( 4X, 'Setup', T41, ES11.4 ) 116 | 406 FORMAT( 4X, 'Solve', T41, ES11.4 ) 117 | 407 FORMAT( 7X, 'Parameter Setup', T41, ES11.4 ) 118 | 408 FORMAT( 7X, 'Outer Source', T41, ES11.4 ) 119 | 409 FORMAT( 7X, 'Inner Iterations', T41, ES11.4 ) 120 | 410 FORMAT( 10X, 'Inner Source', T41, ES11.4 ) 121 | 411 FORMAT( 10X, 'Transport Sweeps', T41, ES11.4 ) 122 | 412 FORMAT( 10X, 'Inner Misc Ops', T41, ES11.4 ) 123 | 413 FORMAT( 7X, 'Solution Misc Ops', T41, ES11.4 ) 124 | 414 FORMAT( 4X, 'Output', T41, ES11.4 ) 125 | !_______________________________________________________________________ 126 | !_______________________________________________________________________ 127 | 128 | END SUBROUTINE time_summ 129 | 130 | 131 | END MODULE time_module 132 | -------------------------------------------------------------------------------- /ports/snap-kf/version.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: version_module 4 | !> @brief 5 | !> This module handles version information. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE version_module 10 | 11 | USE global_module, ONLY: i_knd, ounit 12 | 13 | IMPLICIT NONE 14 | 15 | PUBLIC 16 | 17 | SAVE 18 | !_______________________________________________________________________ 19 | ! 20 | ! SNAP release number and release date. 21 | !_______________________________________________________________________ 22 | 23 | INTEGER(i_knd) :: version = 107 24 | 25 | CHARACTER(LEN=8) :: cvers = '1.07' 26 | 27 | CHARACTER(LEN=10) :: vdate = '04-19-2016' 28 | !_______________________________________________________________________ 29 | !_______________________________________________________________________ 30 | 31 | 32 | CONTAINS 33 | 34 | 35 | SUBROUTINE version_print 36 | 37 | !----------------------------------------------------------------------- 38 | ! 39 | ! Print version information. 40 | ! 41 | !----------------------------------------------------------------------- 42 | !_______________________________________________________________________ 43 | ! 44 | ! Local variables. 45 | !_______________________________________________________________________ 46 | 47 | CHARACTER(LEN=12) :: rc(3) 48 | 49 | INTEGER(i_knd), DIMENSION(8) :: dttm 50 | !_______________________________________________________________________ 51 | ! 52 | ! Call intrinsics to get current date and time. Print to output file 53 | ! information about the code. 54 | !_______________________________________________________________________ 55 | 56 | CALL DATE_AND_TIME (rc(1), rc(2), rc(3), dttm) 57 | 58 | WRITE( ounit, 111 ) 59 | WRITE( ounit, 112 ) cvers 60 | WRITE( ounit, 113 ) vdate 61 | WRITE( ounit, FMT=114, ADVANCE='NO' ) dttm(2), dttm(3), dttm(1) 62 | WRITE( ounit, 115 ) dttm(5), dttm(6), dttm(7) 63 | !_______________________________________________________________________ 64 | 65 | 111 FORMAT( 1X, 'SNAP: SN (Discrete Ordinates) Application Proxy' ) 66 | 112 FORMAT( 1X, 'Version Number.. ', A5 ) 67 | 113 FORMAT( 1X, 'Version Date.. ', A10 ) 68 | 114 FORMAT( 1X, 'Ran on ', I2, '-', I2, '-', I4 ) 69 | 115 FORMAT( ' at time ', I2, ':', I2, ':', I2 ) 70 | !_______________________________________________________________________ 71 | !_______________________________________________________________________ 72 | 73 | END SUBROUTINE version_print 74 | 75 | 76 | END MODULE version_module 77 | -------------------------------------------------------------------------------- /ports/viz/sweep_time.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | def parse(filename): 4 | events = {} 5 | iline = 0 6 | start_time = 0 7 | stop_time = 0 8 | ifile = open(filename) 9 | for line in ifile: 10 | if line.find(":"): 11 | res = line.split(":")[1].replace(" ","") 12 | [info_s,time_s] = res.split("=") 13 | time = int(time_s) 14 | 15 | if iline == 0: 16 | start_time = time 17 | stop_time = time 18 | start_time = min(time,start_time) 19 | stop_time = max(time,stop_time) 20 | iline += 1 21 | 22 | ifile.close() 23 | print (stop_time- start_time)/1.0e6 24 | 25 | parse("legion.log") 26 | -------------------------------------------------------------------------------- /ports/viz/viz_sweep.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import mayavi.mlab as mlab 3 | import time as time 4 | import moviepy.editor as mpy 5 | mlab.options.offscreen = True 6 | 7 | 8 | 9 | class Cell: 10 | def __init__(self,_i,_j,_k,_ioct): 11 | self.i=_i 12 | self.j=_j 13 | self.k=_k 14 | self.ioct=_ioct 15 | def __hash__(self): 16 | return (self.i + 2*(self.j + 4* (self.k + 4*self.ioct))) 17 | 18 | def __eq__(self, other): 19 | return (self.i, self.j,self.k,self.ioct) == (other.i, other.j,other.k,other.ioct) 20 | 21 | class Event: 22 | def __init__(self): 23 | self.starts = [] 24 | self.stops = [] 25 | def add_start(self,time): 26 | self.starts.append(time) 27 | def add_stop(self,time): 28 | self.stops.append(time) 29 | 30 | 31 | def parse(filename): 32 | events = {} 33 | iline = 0 34 | start_time = 0 35 | stop_time = 0 36 | ifile = open(filename) 37 | for line in ifile: 38 | if line.find(":"): 39 | res = line.split(":")[1].replace(" ","") 40 | [info_s,time_s] = res.split("=") 41 | time = int(time_s) 42 | 43 | if iline == 0: 44 | start_time = time 45 | time -= start_time 46 | stop_time = max(time,stop_time) 47 | iline += 1 48 | info_s = info_s.strip("[") 49 | info_s = info_s.strip("]") 50 | info = info_s.split(",") 51 | print info 52 | istart = int(info[0]) 53 | i = int(info[1]) 54 | j = int(info[2]) 55 | k = int(info[3]) 56 | ioct = int(info[4]) 57 | print istart, i, j, k, ioct, time 58 | newcell = Cell(i,j,k,ioct) 59 | if(newcell not in events): 60 | print "Adding Cell to events", i, j, k, istart 61 | events[newcell] = Event() 62 | 63 | temp = events[newcell] 64 | if istart == 1: 65 | temp.add_stop(time) 66 | else: 67 | temp.add_start(time) 68 | 69 | events[newcell] = temp 70 | 71 | ifile.close() 72 | return (0,stop_time,events) 73 | 74 | def check_on(events,i,j,k,ioct,tmin,tmax): 75 | event = events[Cell(i,j,k,ioct)] 76 | for it in range(len(event.starts)): 77 | if (tmin >= event.starts[it] or tmax >= event.starts[it]) and (tmin < event.stops[it] or tmax < event.stops[it]): 78 | return True; 79 | 80 | return False; 81 | 82 | nx = 8; 83 | ny = 8; 84 | nz = 8; 85 | fig_myv = mlab.figure(size=(2048,2048), bgcolor=(1,1,1)) 86 | 87 | (start_time, stop_time,events) = parse("legion.log") 88 | duration = 10.0; #video length in seconds 89 | fps = 60.0 90 | dt = duration/fps 91 | X, Y , Z =np.linspace(0,nx,nx), np.linspace(0,ny,ny), np.linspace(0,nz,nz) 92 | XX, YY, ZZ = np.meshgrid(X,Y,Z) 93 | data = [] 94 | XX 95 | def get_data(t): 96 | t = (t)*duration/(duration-0.5) - 0.1 97 | s = np.zeros(shape=(nx,ny,nz)); 98 | tmin = int((t)*stop_time/duration) 99 | tmax = int((t+0.4*dt)*stop_time/duration) 100 | for ioct in range(8): 101 | for k in range(nz): 102 | for j in range(ny): 103 | for i in range(nx): 104 | if check_on(events,i,j,k,ioct,tmin,tmax): 105 | s[i][j][k] = ioct+1.0 106 | return s 107 | 108 | #def make_frame(t): 109 | # mlab.clf() 110 | # s = np.zeros(shape=(nx,ny,nz)); 111 | # t2 = int(t*stop_time/duration) 112 | # for ioct in range(8): 113 | # for k in range(nz): 114 | # for j in range(ny): 115 | # for i in range(nx): 116 | # if check_on(events,i,j,k,ioct,t2): 117 | # s[i][j][k] = ioct+1.0 118 | # 119 | # 120 | # mlab.barchart(s,vmin=0,vmax=8,scale_mode='none',line_width=5.0,lateral_scale=1.0,transparent=True) 121 | # return mlab.screenshot(antialiased=True) 122 | 123 | frames = [] 124 | for t in np.linspace(0.,(duration),int(fps*duration)): 125 | data.append(get_data(t)) 126 | 127 | temp_view = data[0]; 128 | bar = mlab.barchart(temp_view,vmin=0.0,vmax=9.0,scale_mode='none',line_width=2.0,lateral_scale=0.99,auto_scale=False) 129 | lut = bar.module_manager.scalar_lut_manager.lut.table.to_array() 130 | 131 | #for i in range(8): 132 | # lut[i+1] = lut[255*i/9] 133 | lut[0] = [0,0,0,10] 134 | bar.module_manager.scalar_lut_manager.lut.table = lut 135 | 136 | data2 = [] 137 | for view in data: 138 | data2.append(np.reshape(view,np.product(view.shape))) 139 | 140 | #for view in data: 141 | # bar.mlab_source.set(scalars=np.reshape(view,np.product(view.shape))) 142 | 143 | 144 | def make_frame(t): 145 | 146 | view = data2[int(t*fps)] 147 | bar.mlab_source.set(scalars=view) 148 | return mlab.screenshot(antialiased=True) 149 | 150 | animation = mpy.VideoClip(make_frame,duration=duration) 151 | animation.write_videofile("my_animation.mp4", fps=48) # export as video 152 | animation.write_gif("my_animation.gif", fps=24) # export as GIF (slow) 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /qasnap/Readme: -------------------------------------------------------------------------------- 1 | SNAP: SN (Discrete Ordinates) Application Proxy 2 | 3 | Regression Testing Files 4 | 5 | Provided are two directories with input and output of several SNAP jobs. The 6 | included files are designed to test several features of the SNAP coding. Users 7 | may start with the sample inputs to scale to larger problems. Typical problems 8 | SNAP's model code PARTISN is expected to handle include the following ranges: 9 | 10 | Number of angles per octant (nang): 10 - 2,000 11 | Number of energy groups (ng): 30 - 150 12 | Number of spatial cells per MPI rank [nx*ny*nz/(npey*npez)]: 2,000-5,000 13 | Scattering order (nmom): 2-4 14 | 15 | We strongly urge user to consider these ranges for scaling studies. 16 | 17 | The regression tests are divided into two sets. "mms_src" uses the method of 18 | manufactured solutions setting (src_opt=3) to generate a source that is used 19 | in the SNAP computations. "center_src" uses the center source option (src_opt=1) 20 | to set an isotropic source of strength unity and compute the resulting flux 21 | solution. Each set has problems of varying size and parallel decomposition. 22 | Moreover each set has problems with and without the fixup algorithm. 23 | 24 | Due to the design of SNAP, the solution produced has no physical meaning. 25 | Moreover, the numerical algorithm is known to have instabilities that will 26 | prevent some problems from converging. Modifying the problem can be done to 27 | produce a solution that can be analyzed, mainly for debugging (e.g., if the 28 | solution should be symmetric). However, if the solution does not converge, 29 | warning messages are printed to the standard output (terminal) and to the 30 | output file, and the timing summary is still provided. Given that SNAP has 31 | been designed to perform the same operations as its model PARTISN without 32 | actually solving a real physical system, the timing summary should help users 33 | understand the performance of the problem being tested and relate that 34 | performance to that expected of PARTISN. 35 | 36 | That said, since SNAP may be modified for particular architectures, the 37 | regression tests are provided to ensure that any modifications still produce 38 | the same result as the base code provided. The method of manufactured solutions 39 | algorithm should help test problems of any size, given that such parameters 40 | do not lead to a non-converging setup. 41 | 42 | In each testing directory, three scripts are provided to assist users who 43 | wish to test the base code or a build with modifications. The script 'genall' 44 | establish baseline cases. Use genall with the command: 45 | 46 | ./genall [path]/[code name] 47 | 48 | Likewise, the script 'chkall' produces new outputs for comparison with some 49 | reference output. Use chkall with the command: 50 | 51 | ./chkall [path]/[code name] 52 | 53 | Lastly, if the new outputs are to be set as the baseline use 'mvnewtoold' to 54 | properly rename the files. 55 | 56 | ./mvnewtoold 57 | 58 | To compare outputs, some key parameters one may wish to consider include the 59 | number of iterations, the flux solution, or in the case of method of 60 | manufactured solutions (src_opt=3) the maximum and minimum differences between 61 | the manufactured and computed solutions. 62 | 63 | ---03/07/2013 64 | 65 | 66 | Changes to regression testing since original SNAP release in 2013 67 | 68 | These updated test cases have been compared to the output of the originals. 69 | Differences were found due to a bug in the original SNAP. The bug has been 70 | corrected. It did not affect performance results, but did affect the converged 71 | solution. 72 | 73 | Test cases have been modified or added to test new input/output options. 74 | The option 'swp_typ' allows one to vary the sweep ordering for multi-dimensional 75 | problems. Printing a different z-plane scalar flux to file is possible with 76 | 'kplane'. The option 'popout' will print population distribution details that 77 | may be used to get a sense of what kinds of information is needed for 78 | checkpointing and time-dependent editing. 79 | 80 | The nested threading option for swp_typ=0 currently only works for single 81 | process jobs. This form of nested threading is experimental, but a test case 82 | is provided. 83 | 84 | --02/19/2015 85 | 86 | 87 | Add benchmark directory with sample input and output of benchmark base problem 88 | frequently used and modified for node-to-node comparisons or scaled (weak and 89 | strong). 90 | 91 | --09/04/2021 92 | -------------------------------------------------------------------------------- /qasnap/benchmark/inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | nnested=1 5 | npey=4 6 | npez=4 7 | ndimen=3 8 | nx=640 9 | lx=32.0 10 | ny=16 11 | ly=16.0 12 | nz=16 13 | lz=16.0 14 | ichunk=64 15 | nmom=4 16 | nang=48 17 | ng=54 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.02 23 | nsteps=2 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | soloutp=0 31 | popout=0 32 | swp_typ=0 33 | angcpy=1 34 | multiswp=1 35 | / 36 | -------------------------------------------------------------------------------- /qasnap/center_src/chkall: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # No Fixup 4 | mpirun --map-by socket:PE=3 -n 4 $1 in01 nout01 5 | mpirun --map-by socket:PE=2 -n 6 $1 in02 nout02 6 | mpirun --map-by socket:PE=2 -n 6 $1 in03 nout03 7 | mpirun --map-by socket:PE=2 -n 4 $1 in04 nout04 8 | mpirun --map-by socket:PE=4 -n 4 $1 in05 nout05 9 | mpirun --map-by socket:PE=4 -n 4 $1 in06 nout06 10 | mpirun --map-by socket:PE=2 -n 8 $1 in07 nout07 11 | mpirun --map-by socket:PE=2 -n 8 $1 in08 nout08 12 | mpirun --map-by socket:PE=4 -n 4 $1 in09 nout09 13 | mpirun --map-by socket:PE=4 -n 4 $1 in10 nout10 14 | mpirun --map-by socket:PE=4 -n 4 $1 in11 nout11 15 | mpirun --map-by socket:PE=4 -n 4 $1 in12 nout12 16 | mpirun --map-by socket:PE=4 -n 4 $1 in13 nout13 17 | mpirun --map-by socket:PE=8 -n 1 $1 in14 nout14 18 | 19 | # Fixup 20 | mpirun --map-by socket:PE=3 -n 4 $1 fin01 nfout01 21 | mpirun --map-by socket:PE=2 -n 6 $1 fin02 nfout02 22 | mpirun --map-by socket:PE=2 -n 6 $1 fin03 nfout03 23 | mpirun --map-by socket:PE=2 -n 4 $1 fin04 nfout04 24 | mpirun --map-by socket:PE=4 -n 4 $1 fin05 nfout05 25 | mpirun --map-by socket:PE=4 -n 4 $1 fin06 nfout06 26 | mpirun --map-by socket:PE=2 -n 8 $1 fin07 nfout07 27 | mpirun --map-by socket:PE=2 -n 8 $1 fin08 nfout08 28 | mpirun --map-by socket:PE=4 -n 4 $1 fin09 nfout09 29 | mpirun --map-by socket:PE=4 -n 4 $1 fin10 nfout10 30 | mpirun --map-by socket:PE=4 -n 4 $1 fin11 nfout11 31 | mpirun --map-by socket:PE=4 -n 4 $1 fin12 nfout12 32 | mpirun --map-by socket:PE=4 -n 4 $1 fin13 nfout13 33 | mpirun --map-by socket:PE=8 -n 1 $1 fin14 nfout14 34 | -------------------------------------------------------------------------------- /qasnap/center_src/fin01: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=3 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin02: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=1 5 | npez=6 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=36 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin03: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=6 5 | npez=1 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=3 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin04: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=5 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | popout=1 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/fin05: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=12 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin06: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin07: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=1.0 9 | ny=20 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=5 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin08: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=3 15 | nang=36 16 | ng=5 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=1 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | kplane=3 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/fin09: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/fin10: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.02 9 | ny=20 10 | ly=0.02 11 | nz=12 12 | lz=0.012 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=1 20 | it_det=0 21 | tf=0.01 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | popout=2 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/fin11: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.1 10 | ny=20 11 | ly=0.1 12 | nz=12 13 | lz=0.1 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=0.1 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=2 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/fin12: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=1 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | soloutp=1 31 | angcpy=2 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/fin13: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/fin14: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=8 4 | nnested=2 5 | npey=1 6 | npez=1 7 | ndimen=3 8 | nx=12 9 | lx=1.0 10 | ny=12 11 | ly=1.0 12 | nz=12 13 | lz=1.0 14 | ichunk=6 15 | nmom=1 16 | nang=10 17 | ng=40 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=1.0 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-7 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/genall: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # No Fixup 4 | mpirun --map-by socket:PE=3 -n 4 $1 in01 out01 5 | mpirun --map-by socket:PE=2 -n 6 $1 in02 out02 6 | mpirun --map-by socket:PE=2 -n 6 $1 in03 out03 7 | mpirun --map-by socket:PE=2 -n 4 $1 in04 out04 8 | mpirun --map-by socket:PE=4 -n 4 $1 in05 out05 9 | mpirun --map-by socket:PE=4 -n 4 $1 in06 out06 10 | mpirun --map-by socket:PE=2 -n 8 $1 in07 out07 11 | mpirun --map-by socket:PE=2 -n 8 $1 in08 out08 12 | mpirun --map-by socket:PE=4 -n 4 $1 in09 out09 13 | mpirun --map-by socket:PE=4 -n 4 $1 in10 out10 14 | mpirun --map-by socket:PE=4 -n 4 $1 in11 out11 15 | mpirun --map-by socket:PE=4 -n 4 $1 in12 out12 16 | mpirun --map-by socket:PE=4 -n 4 $1 in13 out13 17 | mpirun --map-by socket:PE=8 -n 1 $1 in14 out14 18 | 19 | # Fixup 20 | mpirun --map-by socket:PE=3 -n 4 $1 fin01 fout01 21 | mpirun --map-by socket:PE=2 -n 6 $1 fin02 fout02 22 | mpirun --map-by socket:PE=2 -n 6 $1 fin03 fout03 23 | mpirun --map-by socket:PE=2 -n 4 $1 fin04 fout04 24 | mpirun --map-by socket:PE=4 -n 4 $1 fin05 fout05 25 | mpirun --map-by socket:PE=4 -n 4 $1 fin06 fout06 26 | mpirun --map-by socket:PE=2 -n 8 $1 fin07 fout07 27 | mpirun --map-by socket:PE=2 -n 8 $1 fin08 fout08 28 | mpirun --map-by socket:PE=4 -n 4 $1 fin09 fout09 29 | mpirun --map-by socket:PE=4 -n 4 $1 fin10 fout10 30 | mpirun --map-by socket:PE=4 -n 4 $1 fin11 fout11 31 | mpirun --map-by socket:PE=4 -n 4 $1 fin12 fout12 32 | mpirun --map-by socket:PE=4 -n 4 $1 fin13 fout13 33 | mpirun --map-by socket:PE=8 -n 1 $1 fin14 fout14 34 | -------------------------------------------------------------------------------- /qasnap/center_src/in01: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=3 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in02: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=1 5 | npez=6 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=36 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in03: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=6 5 | npez=1 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=3 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in04: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=5 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | popout=1 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/in05: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=12 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in06: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=12 8 | lx=1.0 9 | ny=12 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=6 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in07: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=1.0 9 | ny=20 10 | ly=1.0 11 | nz=12 12 | lz=1.0 13 | ichunk=5 14 | nmom=1 15 | nang=10 16 | ng=3 17 | mat_opt=0 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=1.0 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-7 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in08: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=3 15 | nang=36 16 | ng=5 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=1 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | kplane=3 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/in09: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.1 9 | ny=20 10 | ly=0.1 11 | nz=12 12 | lz=0.1 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=0 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=1 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/center_src/in10: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=20 8 | lx=0.02 9 | ny=20 10 | ly=0.02 11 | nz=12 12 | lz=0.012 13 | ichunk=10 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=1 19 | timedep=1 20 | it_det=0 21 | tf=0.01 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | popout=2 31 | angcpy=1 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/in11: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.1 10 | ny=20 11 | ly=0.1 12 | nz=12 13 | lz=0.1 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=0.1 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=2 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/in12: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=1 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | soloutp=1 31 | angcpy=2 32 | / 33 | -------------------------------------------------------------------------------- /qasnap/center_src/in13: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ndimen=3 8 | nx=20 9 | lx=0.02 10 | ny=20 11 | ly=0.02 12 | nz=12 13 | lz=0.012 14 | ichunk=10 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=1 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/in14: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=8 4 | nnested=2 5 | npey=1 6 | npez=1 7 | ndimen=3 8 | nx=12 9 | lx=1.0 10 | ny=12 11 | ly=1.0 12 | nz=12 13 | lz=1.0 14 | ichunk=6 15 | nmom=1 16 | nang=10 17 | ng=40 18 | mat_opt=1 19 | src_opt=1 20 | timedep=0 21 | it_det=0 22 | tf=1.0 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-7 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | soloutp=1 31 | swp_typ=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/center_src/mvnewtoold: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | mv -f nout01 out01 4 | mv -f nout02 out02 5 | mv -f nout03 out03 6 | mv -f nout04 out04 7 | mv -f nout05 out05 8 | mv -f nout06 out06 9 | mv -f nout07 out07 10 | mv -f nout08 out08 11 | mv -f nout09 out09 12 | mv -f nout10 out10 13 | mv -f nout11 out11 14 | mv -f nout12 out12 15 | mv -f nout13 out13 16 | mv -f nout14 out14 17 | 18 | mv -f nfout01 fout01 19 | mv -f nfout02 fout02 20 | mv -f nfout03 fout03 21 | mv -f nfout04 fout04 22 | mv -f nfout05 fout05 23 | mv -f nfout06 fout06 24 | mv -f nfout07 fout07 25 | mv -f nfout08 fout08 26 | mv -f nfout09 fout09 27 | mv -f nfout10 fout10 28 | mv -f nfout11 fout11 29 | mv -f nfout12 fout12 30 | mv -f nfout13 fout13 31 | mv -f nfout14 fout14 32 | -------------------------------------------------------------------------------- /qasnap/center_src/quick-check: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # Run this after running tests and do a comparison with 'old-iterations'. 4 | 5 | foreach file (nout* nfout*); 6 | grep "Inners" $file >> new-iterations; 7 | grep "Total inners" $file >> new-iterations; 8 | end 9 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_fixup_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | ndimen=1 5 | nx=20 6 | lx=10.0 7 | nmom=4 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=0 13 | it_det=1 14 | tf=1.0 15 | nsteps=10 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=2 20 | scatp=1 21 | fixup=1 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_fixup_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | ndimen=1 5 | nx=20 6 | lx=10.0 7 | nmom=4 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=1 13 | it_det=0 14 | tf=5.0 15 | nsteps=10 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=0 20 | scatp=0 21 | fixup=1 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_fixup_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=10 4 | ndimen=1 5 | nx=20 6 | lx=10.0 7 | nmom=2 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=1 13 | it_det=0 14 | tf=5.0 15 | nsteps=100 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=0 20 | scatp=0 21 | fixup=1 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_mms_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | ndimen=1 5 | nx=20 6 | lx=0.2 7 | nmom=4 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=0 13 | it_det=1 14 | tf=1.0 15 | nsteps=10 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=2 20 | scatp=1 21 | fixup=0 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_mms_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | ndimen=1 5 | nx=20 6 | lx=0.2 7 | nmom=4 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=1 13 | it_det=0 14 | tf=1.0 15 | nsteps=10 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=0 20 | scatp=0 21 | fixup=0 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/1d_mms_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=10 4 | ndimen=1 5 | nx=20 6 | lx=0.2 7 | nmom=2 8 | nang=12 9 | ng=10 10 | mat_opt=0 11 | src_opt=3 12 | timedep=1 13 | it_det=0 14 | tf=1.0 15 | nsteps=100 16 | iitm=5 17 | oitm=100 18 | epsi=1.E-4 19 | fluxp=0 20 | scatp=0 21 | fixup=0 22 | angcpy=2 23 | / 24 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_fixup_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=20.0 8 | ny=20 9 | ly=20.0 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=0 16 | it_det=1 17 | tf=1.0 18 | nsteps=10 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=2 23 | scatp=1 24 | fixup=1 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_fixup_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=20.0 8 | ny=20 9 | ly=20.0 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=1 16 | it_det=0 17 | tf=1.0 18 | nsteps=10 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=0 23 | scatp=0 24 | fixup=1 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_fixup_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=20.0 8 | ny=20 9 | ly=20.0 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=1 16 | it_det=0 17 | tf=1.0 18 | nsteps=100 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=0 23 | scatp=0 24 | fixup=1 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_mms_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=0.2 8 | ny=20 9 | ly=0.2 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=0 16 | it_det=1 17 | tf=1.0 18 | nsteps=10 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=2 23 | scatp=1 24 | fixup=0 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_mms_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=0.2 8 | ny=20 9 | ly=0.2 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=1 16 | it_det=0 17 | tf=1.0 18 | nsteps=10 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=0 23 | scatp=0 24 | fixup=0 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/2d_mms_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=4 5 | ndimen=2 6 | nx=20 7 | lx=0.2 8 | ny=20 9 | ly=0.2 10 | nmom=4 11 | nang=12 12 | ng=10 13 | mat_opt=0 14 | src_opt=3 15 | timedep=1 16 | it_det=0 17 | tf=1.0 18 | nsteps=100 19 | iitm=5 20 | oitm=100 21 | epsi=1.E-4 22 | fluxp=0 23 | scatp=0 24 | fixup=0 25 | angcpy=2 26 | / 27 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_fixup_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=8 8 | lx=8.0 9 | ny=8 10 | ly=8.0 11 | nz=8 12 | lz=8.0 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=0 17 | src_opt=3 18 | timedep=0 19 | it_det=1 20 | tf=1.0 21 | nsteps=10 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=2 26 | scatp=1 27 | fixup=1 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_fixup_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=4 6 | ndimen=3 7 | nx=8 8 | lx=8.0 9 | ny=8 10 | ly=8.0 11 | nz=8 12 | lz=8.0 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=0 17 | src_opt=3 18 | timedep=1 19 | it_det=0 20 | tf=0.5 21 | nsteps=10 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=0 26 | scatp=0 27 | fixup=1 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_fixup_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=8 8 | lx=8.0 9 | ny=8 10 | ly=8.0 11 | nz=8 12 | lz=8.0 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=1 17 | src_opt=3 18 | timedep=1 19 | it_det=0 20 | tf=0.5 21 | nsteps=100 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=0 26 | scatp=0 27 | fixup=1 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_mms_st.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | npey=2 5 | npez=2 6 | ndimen=3 7 | nx=8 8 | lx=0.08 9 | ny=8 10 | ly=0.08 11 | nz=8 12 | lz=0.08 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=0 17 | src_opt=3 18 | timedep=0 19 | it_det=1 20 | tf=1.0 21 | nsteps=10 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=2 26 | scatp=1 27 | fixup=0 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_mms_t1.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=2 5 | npez=4 6 | ndimen=3 7 | nx=8 8 | lx=0.08 9 | ny=8 10 | ly=0.08 11 | nz=8 12 | lz=0.08 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=0 17 | src_opt=3 18 | timedep=1 19 | it_det=0 20 | tf=1.0 21 | nsteps=10 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=0 26 | scatp=0 27 | fixup=0 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_mms_t2.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ndimen=3 7 | nx=8 8 | lx=0.08 9 | ny=8 10 | ly=0.08 11 | nz=8 12 | lz=0.08 13 | nmom=4 14 | nang=12 15 | ng=10 16 | mat_opt=1 17 | src_opt=3 18 | timedep=1 19 | it_det=0 20 | tf=1.0 21 | nsteps=100 22 | iitm=5 23 | oitm=100 24 | epsi=1.E-4 25 | fluxp=0 26 | scatp=0 27 | fixup=0 28 | angcpy=1 29 | / 30 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_mod_fix_n.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ichunk=10 8 | ndimen=3 9 | nx=20 10 | lx=20.0 11 | ny=20 12 | ly=20.0 13 | nz=10 14 | lz=10.0 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=3 20 | timedep=1 21 | it_det=0 22 | tf=0.1 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=1 30 | swp_typ=1 31 | soloutp=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_mod_fixup.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ichunk=10 7 | ndimen=3 8 | nx=20 9 | lx=20.0 10 | ny=20 11 | ly=20.0 12 | nz=10 13 | lz=10.0 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=3 19 | timedep=1 20 | it_det=0 21 | tf=0.1 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=1 29 | soloutp=1 30 | angcpy=2 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_model.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=2 4 | npey=4 5 | npez=2 6 | ichunk=10 7 | ndimen=3 8 | nx=20 9 | lx=1.0 10 | ny=20 11 | ly=1.0 12 | nz=10 13 | lz=1.0 14 | nmom=4 15 | nang=80 16 | ng=30 17 | mat_opt=1 18 | src_opt=3 19 | timedep=1 20 | it_det=0 21 | tf=0.01 22 | nsteps=10 23 | iitm=5 24 | oitm=100 25 | epsi=1.E-4 26 | fluxp=0 27 | scatp=0 28 | fixup=0 29 | soloutp=1 30 | angcpy=2 31 | / 32 | -------------------------------------------------------------------------------- /qasnap/mms_src/3d_model_n.inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | nthreads=4 4 | nnested=2 5 | npey=2 6 | npez=2 7 | ichunk=10 8 | ndimen=3 9 | nx=20 10 | lx=1.0 11 | ny=20 12 | ly=1.0 13 | nz=10 14 | lz=1.0 15 | nmom=4 16 | nang=80 17 | ng=30 18 | mat_opt=1 19 | src_opt=3 20 | timedep=1 21 | it_det=0 22 | tf=0.01 23 | nsteps=10 24 | iitm=5 25 | oitm=100 26 | epsi=1.E-4 27 | fluxp=0 28 | scatp=0 29 | fixup=0 30 | swp_typ=1 31 | soloutp=1 32 | angcpy=1 33 | multiswp=0 34 | / 35 | -------------------------------------------------------------------------------- /qasnap/mms_src/chkall: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # 1-D cases 4 | # No Fixup 5 | mpirun --map-by socket:PE=2 -n 1 $1 1d_mms_st.inp 1d_mms_st.new 6 | mv -f flux 1d_mms_st.flux.new 7 | mv -f slgg 1d_mms_st.slgg.new 8 | 9 | mpirun --map-by socket:PE=4 -n 1 $1 1d_mms_t1.inp 1d_mms_t1.new 10 | 11 | mpirun --map-by socket:PE=10 -n 1 $1 1d_mms_t2.inp 1d_mms_t2.new 12 | 13 | # Fixup 14 | mpirun --map-by socket:PE=2 -n 1 $1 1d_fixup_st.inp 1d_fixup_st.new 15 | mv -f flux 1d_fixup_st.flux.new 16 | mv -f slgg 1d_fixup_st.slgg.new 17 | 18 | mpirun --map-by socket:PE=4 -n 1 $1 1d_fixup_t1.inp 1d_fixup_t1.new 19 | 20 | mpirun --map-by socket:PE=10 -n 1 $1 1d_fixup_t2.inp 1d_fixup_t2.new 21 | 22 | 23 | # 2-D cases 24 | # No Fixup 25 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_st.inp 2d_mms_st.new 26 | mv -f flux 2d_mms_st.flux.new 27 | mv -f slgg 2d_mms_st.slgg.new 28 | 29 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_t1.inp 2d_mms_t1.new 30 | 31 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_t2.inp 2d_mms_t2.new 32 | 33 | # Fixup 34 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_st.inp 2d_fixup_st.new 35 | mv -f flux 2d_fixup_st.flux.new 36 | mv -f slgg 2d_fixup_st.slgg.new 37 | 38 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_t1.inp 2d_fixup_t1.new 39 | 40 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_t2.inp 2d_fixup_t2.new 41 | 42 | 43 | # 3-D cases 44 | # No Fixup 45 | mpirun --map-by socket:PE=4 -n 4 $1 3d_mms_st.inp 3d_mms_st.new 46 | mv -f flux 3d_mms_st.flux.new 47 | mv -f slgg 3d_mms_st.slgg.new 48 | 49 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mms_t1.inp 3d_mms_t1.new 50 | 51 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mms_t2.inp 3d_mms_t2.new 52 | 53 | mpirun --map-by socket:PE=2 -n 8 $1 3d_model.inp 3d_model.new 54 | 55 | mpirun --map-by socket:PE=4 -n 4 $1 3d_model_n.inp 3d_model_n.new 56 | 57 | # Fixup 58 | mpirun --map-by socket:PE=4 -n 4 $1 3d_fixup_st.inp 3d_fixup_st.new 59 | mv -f flux 3d_fixup_st.flux.new 60 | mv -f slgg 3d_fixup_st.slgg.new 61 | 62 | mpirun --map-by socket:PE=2 -n 8 $1 3d_fixup_t1.inp 3d_fixup_t1.new 63 | 64 | mpirun --map-by socket:PE=2 -n 8 $1 3d_fixup_t2.inp 3d_fixup_t2.new 65 | 66 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mod_fixup.inp 3d_mod_fixup.new 67 | 68 | mpirun --map-by socket:PE=4 -n 4 $1 3d_mod_fix_n.inp 3d_mod_fix_n.new 69 | 70 | -------------------------------------------------------------------------------- /qasnap/mms_src/genall: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # 1-D cases 4 | # No Fixup 5 | mpirun --map-by socket:PE=2 -n 1 $1 1d_mms_st.inp 1d_mms_st.old 6 | mv -f flux 1d_mms_st.flux.old 7 | mv -f slgg 1d_mms_st.slgg.old 8 | 9 | mpirun --map-by socket:PE=4 -n 1 $1 1d_mms_t1.inp 1d_mms_t1.old 10 | 11 | mpirun --map-by socket:PE=10 -n 1 $1 1d_mms_t2.inp 1d_mms_t2.old 12 | 13 | # Fixup 14 | mpirun --map-by socket:PE=2 -n 1 $1 1d_fixup_st.inp 1d_fixup_st.old 15 | mv -f flux 1d_fixup_st.flux.old 16 | mv -f slgg 1d_fixup_st.slgg.old 17 | 18 | mpirun --map-by socket:PE=4 -n 1 $1 1d_fixup_t1.inp 1d_fixup_t1.old 19 | 20 | mpirun --map-by socket:PE=10 -n 1 $1 1d_fixup_t2.inp 1d_fixup_t2.old 21 | 22 | 23 | # 2-D cases 24 | # No Fixup 25 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_st.inp 2d_mms_st.old 26 | mv -f flux 2d_mms_st.flux.old 27 | mv -f slgg 2d_mms_st.slgg.old 28 | 29 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_t1.inp 2d_mms_t1.old 30 | 31 | mpirun --map-by socket:PE=4 -n 4 $1 2d_mms_t2.inp 2d_mms_t2.old 32 | 33 | # Fixup 34 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_st.inp 2d_fixup_st.old 35 | mv -f flux 2d_fixup_st.flux.old 36 | mv -f slgg 2d_fixup_st.slgg.old 37 | 38 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_t1.inp 2d_fixup_t1.old 39 | 40 | mpirun --map-by socket:PE=4 -n 4 $1 2d_fixup_t2.inp 2d_fixup_t2.old 41 | 42 | 43 | # 3-D cases 44 | # No Fixup 45 | mpirun --map-by socket:PE=4 -n 4 $1 3d_mms_st.inp 3d_mms_st.old 46 | mv -f flux 3d_mms_st.flux.old 47 | mv -f slgg 3d_mms_st.slgg.old 48 | 49 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mms_t1.inp 3d_mms_t1.old 50 | 51 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mms_t2.inp 3d_mms_t2.old 52 | 53 | mpirun --map-by socket:PE=2 -n 8 $1 3d_model.inp 3d_model.old 54 | 55 | mpirun --map-by socket:PE=4 -n 4 $1 3d_model_n.inp 3d_model_n.old 56 | 57 | # Fixup 58 | mpirun --map-by socket:PE=4 -n 4 $1 3d_fixup_st.inp 3d_fixup_st.old 59 | mv -f flux 3d_fixup_st.flux.old 60 | mv -f slgg 3d_fixup_st.slgg.old 61 | 62 | mpirun --map-by socket:PE=2 -n 8 $1 3d_fixup_t1.inp 3d_fixup_t1.old 63 | 64 | mpirun --map-by socket:PE=2 -n 8 $1 3d_fixup_t2.inp 3d_fixup_t2.old 65 | 66 | mpirun --map-by socket:PE=2 -n 8 $1 3d_mod_fixup.inp 3d_mod_fixup.old 67 | 68 | mpirun --map-by socket:PE=4 -n 4 $1 3d_mod_fix_n.inp 3d_mod_fix_n.old 69 | 70 | -------------------------------------------------------------------------------- /qasnap/mms_src/mvnewtoold: -------------------------------------------------------------------------------- 1 | 2 | # 1-D cases 3 | mv -f 1d_mms_st.new 1d_mms_st.old 4 | mv -f 1d_mms_st.flux.new 1d_mms_st.flux.old 5 | mv -f 1d_mms_st.slgg.new 1d_mms_st.slgg.old 6 | 7 | mv -f 1d_mms_t1.new 1d_mms_t1.old 8 | 9 | mv -f 1d_mms_t2.new 1d_mms_t2.old 10 | 11 | 12 | mv -f 1d_fixup_st.new 1d_fixup_st.old 13 | mv -f 1d_fixup_st.flux.new 1d_fixup_st.flux.old 14 | mv -f 1d_fixup_st.slgg.new 1d_fixup_st.slgg.old 15 | 16 | mv -f 1d_fixup_t1.new 1d_fixup_t1.old 17 | 18 | mv -f 1d_fixup_t2.new 1d_fixup_t2.old 19 | 20 | # 2-D cases 21 | mv -f 2d_mms_st.new 2d_mms_st.old 22 | mv -f 2d_mms_st.flux.new 2d_mms_st.flux.old 23 | mv -f 2d_mms_st.slgg.new 2d_mms_st.slgg.old 24 | 25 | mv -f 2d_mms_t1.new 2d_mms_t1.old 26 | 27 | mv -f 2d_mms_t2.new 2d_mms_t2.old 28 | 29 | 30 | mv -f 2d_fixup_st.new 2d_fixup_st.old 31 | mv -f 2d_fixup_st.flux.new 2d_fixup_st.flux.old 32 | mv -f 2d_fixup_st.slgg.new 2d_fixup_st.slgg.old 33 | 34 | mv -f 2d_fixup_t1.new 2d_fixup_t1.old 35 | 36 | mv -f 2d_fixup_t2.new 2d_fixup_t2.old 37 | 38 | # 3-D cases 39 | mv -f 3d_mms_st.new 3d_mms_st.old 40 | mv -f 3d_mms_st.flux.new 3d_mms_st.flux.old 41 | mv -f 3d_mms_st.slgg.new 3d_mms_st.slgg.old 42 | 43 | mv -f 3d_mms_t1.new 3d_mms_t1.old 44 | 45 | mv -f 3d_mms_t2.new 3d_mms_t2.old 46 | 47 | mv -f 3d_model.new 3d_model.old 48 | 49 | mv -f 3d_model_n.new 3d_model_n.old 50 | 51 | 52 | mv -f 3d_fixup_st.new 3d_fixup_st.old 53 | mv -f 3d_fixup_st.flux.new 3d_fixup_st.flux.old 54 | mv -f 3d_fixup_st.slgg.new 3d_fixup_st.slgg.old 55 | 56 | mv -f 3d_fixup_t1.new 3d_fixup_t1.old 57 | 58 | mv -f 3d_fixup_t2.new 3d_fixup_t2.old 59 | 60 | mv -f 3d_mod_fixup.new 3d_mod_fixup.old 61 | 62 | mv -f 3d_mod_fix_n.new 3d_mod_fix_n.old 63 | 64 | -------------------------------------------------------------------------------- /qasnap/mms_src/quick-check: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | # Run this after running tests and do a comparison with 'old-iterations'. 4 | 5 | foreach file (1d*new 2d*new 3d_fixup*new 3d_mms*new 3d_model.new 3d_model_n.new 3d_mod_fix*new); 6 | grep "Inners" $file >> new-iterations; 7 | grep "Total inners" $file >> new-iterations; 8 | grep "Max Diff" $file >> new-iterations; 9 | grep "Min Diff" $file >> new-iterations; 10 | grep "Avg Diff" $file >> new-iterations; 11 | end 12 | -------------------------------------------------------------------------------- /qasnap/sample/inp: -------------------------------------------------------------------------------- 1 | ! Input from namelist 2 | &invar 3 | npey=2 4 | npez=2 5 | ichunk=2 6 | nthreads=2 7 | nnested=1 8 | ndimen=3 9 | nx=6 10 | lx=0.6 11 | ny=6 12 | ly=0.6 13 | nz=6 14 | lz=0.6 15 | nmom=1 16 | nang=10 17 | ng=4 18 | epsi=1.0E-4 19 | iitm=5 20 | oitm=30 21 | timedep=0 22 | tf=1.0 23 | nsteps=1 24 | mat_opt=0 25 | src_opt=0 26 | scatp=0 27 | it_det=0 28 | fluxp=0 29 | fixup=1 30 | soloutp=1 31 | kplane=0 32 | popout=0 33 | swp_typ=0 34 | angcpy=1 35 | multiswp=1 36 | / 37 | -------------------------------------------------------------------------------- /snap_release_v106.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.06 2 | 6/25/2015 3 | 4 | SNAP Version 1.06 includes minor revisions to allow SNAP to be pre-processable 5 | for inclusion/exclusion of MPI and OPENMP. 6 | 7 | Summary: 8 | The SNAP files time.f90 and plib.f90 have been renamed time.F90 and plib.F90. 9 | Each file includes pre-processing directives depending on the definitions in 10 | the make system 'MPI' and 'OPENMP'. The Makefile has been modified to set 11 | the definitions and use a pre-processor to analyze the *.F90 files, convert 12 | them to *.f90 files, and compile. 13 | 14 | To build without MPI and/or OPENMP: 15 | gmake MPI=no OPENMP=no 16 | 17 | The default build assumes MPI=yes and OPENMP=yes. 18 | 19 | Files: 20 | R plib.f90 21 | A plib.F90 22 | 23 | Add dummy routines that perform little or no operations in place of the 24 | normal "wrapper" routines around calls to MPI and/or OPENMP. Add preprocessing 25 | definition to evaluate at compile time. 26 | 27 | R time.f90 28 | A time.F90 29 | 30 | Add preprocessing definition within the wtime subroutine for case with/without 31 | MPI. 32 | 33 | M Makefile 34 | 35 | Include preprocessing DEFS. Set FORTRAN and OMPFLAGS based on conditions 36 | specified to make command. 37 | 38 | M version.f90 39 | 40 | Update version and date. 41 | -------------------------------------------------------------------------------- /snap_release_v108.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.08 2 | 10/24/2018 3 | 4 | SNAP Version 1.08 includes major revisions to the previous version of SNAP 5 | released to GitHub. The new version has been rewritten to incorporate 6 | similar changes mad to the code for which it is a proxy, PARTISN. 7 | 8 | Summary: 9 | SNAP 1.08 includes two major modifications. The major revisions are (1) the 10 | implementation of a new thread-locking scheme when thread_multiple is not 11 | available that is conformal with OpenMP standard in that any lock is set and 12 | unset by the same thread before being used by any other thread; and (2) the 13 | implementation of an asynchronous communication scheme that allows for 14 | simultaneous mesh sweeps in multiple octant directions. 15 | 16 | The thread-locking scheme required the relocation of the nested parallel OpenMP 17 | region into the mkba_sweep subroutine. This means more fork/join operations and 18 | will diminish performance. In the absence of nested threading, the new scheme 19 | can lead to some small performance decrease as thread barriers are put in place 20 | to protect against race conditions. The use of mkba_sweep is preserved for 21 | research interest, so its performance has not been optimized. 22 | 23 | The simultaneous octant sweeps algorithm improves parallel efficiency by 24 | starting sweeps from multiple corners of fully known boundary conditions (two 25 | in 2-D and four in 3-D; this restriction is meant to mimic the production code 26 | which permits more restrictive boundary conditions, not just vacuum). The 27 | algorithm works with threads for thread_serialized and thread_multiple 28 | environments, but only a single lock is used with the former, because the 29 | order does not matter. This algorithm offers improved scaling, increasingly 30 | noticeable at increasing node-count. It represents the future direction for the 31 | production code and as such has been made the default. It does not work with 32 | swp_typ=1. 33 | 34 | Please note some of the variable names and keywords previously used as 35 | placeholders for the simultaneous octant sweeps algorithm have been changed 36 | or removed. Most notably, cor_swp has been moved to multiswp as the input 37 | keyword. 38 | 39 | Minor changes were made to the Makefile for better GFORTRAN compile options and 40 | remove some options for Intel KNL (ksnap) builds. 41 | 42 | Please direct questions to the SNAP developers for finer details of the code 43 | changes. 44 | 45 | 46 | Modified files: 47 | Makefile 48 | control.f90 49 | dim1_sweep.f90 50 | dim3_sweep.f90 51 | inner.f90 52 | input.f90 53 | mkba_sweep.f90 54 | octsweep.f90 55 | plib.F90 56 | setup.f90 57 | solvar.f90 58 | sweep.f90 59 | thrd_comm.f90 60 | translv.f90 61 | version.f 62 | -------------------------------------------------------------------------------- /snap_release_v109.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.09 2 | 04/18/2019 3 | 4 | SNAP Version 1.09 includes minor revisions to the previous version of SNAP 5 | released to GitHub. 6 | 7 | Summary: 8 | SNAP 1.09 includes one feature request addition. SNAP now reports the number 9 | of words allocated, which when multiplied by the number of bytes per word 10 | (i.e., 8 for double precision), allows the user to quickly assess how much 11 | memory SNAP is using. It does not include the size of stack memory. This 12 | information can be found at the bottom of a SNAP output file or by searching 13 | for the phrase "Allocated words". 14 | 15 | The Makefile has also been lightly modified to use less aggressive optimizations 16 | for the GFORTRAN configuration. As always, users may modify the makefile 17 | options that suit their own needs. This change effectively reverts changes 18 | made for v1.08. 19 | 20 | The copyright statment has been previously updated to reflect the change in 21 | management of Los Alamos National Laboratory to Triad National Security, LLC. 22 | 23 | Please direct questions to the SNAP developers for finer details of the code 24 | changes. 25 | 26 | 27 | Modified files: 28 | Makefile 29 | control.f90 30 | data.f90 31 | geom.f90 32 | setup.f90 33 | sn.f90 34 | snap_main.f90 35 | solvar.f90 36 | translv.f90 37 | version.f 38 | -------------------------------------------------------------------------------- /snap_release_v110.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.10 2 | 04/06/2020 3 | 4 | SNAP Version 1.10 includes minor revisions to the previous version of SNAP 5 | released to GitHub. 6 | 7 | Summary: 8 | SNAP 1.10 includes one feature request addition and one algorithm modification. 9 | 10 | A negative flux fixup counter has been added to determine how many edges in 11 | the spatial and time domains are corrected per group per inner iteration. The 12 | fixup is reported as a fraction of all unknowns per group per inner iteration. 13 | It is reported when the input file uses the keyword=value "it_det=1". Negative 14 | angular fluxes are unphysical consequences of the approximations made, including 15 | a finite difference closure relationship and finite number of moments to model 16 | the scattering source. 17 | 18 | The inner and outer error checks have been modified to reduce the size of the 19 | stack array 'df' in each module. The subroutines inner/outer_conv have been 20 | removed. A smaller df array is computed per group in the new subroutines 21 | inner/outer_df_calc. Calls to this subroutine are threaded. Additional steps 22 | to compute the global errors have been moved to the inner and outer 23 | subroutines. The manual has been updated to describe the changes in the 24 | subroutine names. 25 | 26 | The scripts 'quick-check' have been added to the qasnap directories as well 27 | as initial runs on the reference outputs in 'old-iterations'. After running the 28 | tests with 'chkall' one can run 'quick-check' and compare new-iterations and 29 | old-iterations for a quick confirmation that the tests ran correctly. Further 30 | confirmation can come from greater comparison of flux outputs. 31 | 32 | Please direct questions to the SNAP developers for finer details of the code 33 | changes. 34 | 35 | 36 | Modified files: 37 | M src/inner.f90 38 | M src/outer.f90 39 | M src/dim1_sweep.f90 40 | M src/dim3_sweep.f90 41 | M src/mkba_sweep.f90 42 | M src/octsweep.f90 43 | M src/sweep.f90 44 | M src/solvar.f90 45 | M src/version.f90 46 | M qasnap/center_src/fout08 47 | M qasnap/center_src/out08 48 | M qasnap/mms_src/1d_fixup_st.old 49 | M qasnap/mms_src/1d_mms_st.old 50 | M qasnap/mms_src/2d_fixup_st.old 51 | M qasnap/mms_src/2d_mms_st.old 52 | M qasnap/mms_src/3d_fixup_st.old 53 | M qasnap/mms_src/3d_mms_st.old 54 | A qasnap/center_src/quick-check 55 | A qasnap/center_src/old-iterations 56 | A qasnap/mms_src/quick-check 57 | A qasnap/mms_src/old-iterations 58 | -------------------------------------------------------------------------------- /snap_release_v111.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.11 2 | 06/19/2021 3 | 4 | SNAP Version 1.11 includes minor revisions to the previous version of SNAP 5 | released to GitHub. 6 | 7 | Summary: 8 | SNAP 1.11 includes some changes for standard adherence and a fix for running 9 | SNAP when built with the MPI=no Make option. 10 | 11 | In several places in the code, a comma was missing between two strings that 12 | were separted onto two lines. Comma was added for proper compilation. 13 | 14 | When running the code built with MPI=no, the multiswp algorithm was hanging. 15 | Now the code checks for that option whenever nproc=1 (including the MPI=no 16 | build) and resets it to 0. 17 | 18 | Please direct questions to the SNAP developers for finer details of the code 19 | changes. 20 | 21 | 22 | Modified files: 23 | src/input.f90 24 | src/output.f90 25 | src/setup.f90 26 | src/translv.f90 27 | src/version.f90 28 | -------------------------------------------------------------------------------- /snap_release_v112.txt: -------------------------------------------------------------------------------- 1 | SNAP Version 1.12 2 | 09/07/2021 3 | 4 | SNAP Version 1.12 includes minor revisions to the previous version of SNAP 5 | released to GitHub. 6 | 7 | Summary: 8 | SNAP 1.12 replaces the use of omp_set_nested, a deprecated OpenMP feature, 9 | with omp_max_active_levels for nested threading capability. An additional 10 | Figure of Merit (FOM) edit has been provided at the end of the timing summary. 11 | The new FOM is Inverse Grind Time (1/ns), which corresponds to the more 12 | useful interpretation that an increase in its value is an improvement. 13 | 14 | The Makefile has been modified to start accounting for the introduction of 15 | the oneAPI compiler on LANL Cray PE systems. This is a work in progress. As 16 | with all Makefile compiler choices, please feel free to ask questions on how 17 | to modify for individual systems. 18 | 19 | A new testing input has been added to qasnap/benchmark for posterity. This 20 | input is reflective of a typical single node problem and is useful for 21 | profiling and scaling studies. One other minor testing diff was revealed with 22 | a new version of the Intel compiler (used to generate the original files) and 23 | updated. The qasnap/Readme has been updated. 24 | 25 | Please direct questions to the SNAP developers for finer details of the code 26 | changes. 27 | 28 | 29 | Modified files: 30 | src/Makefile 31 | src/plib.F90 32 | src/snap_main.f90 33 | src/version.f90 34 | qasnap/Readme 35 | qasnap/center_src/out10 36 | qasnap/center_src/old-iterations 37 | qasnap/sample/out 38 | 39 | Added files: 40 | qasnap/benchmark/inp 41 | qasnap/benchmark/out 42 | -------------------------------------------------------------------------------- /src/LineCount: -------------------------------------------------------------------------------- 1 | # Count lines of code, omitting blanks and comments 2 | echo $1 line count is: `grep -cvE '^$|^[\!]' < $1` >> $2 3 | -------------------------------------------------------------------------------- /src/LineReport: -------------------------------------------------------------------------------- 1 | # Add up the number of lines 2 | BEGIN { LC = 0 } 3 | 4 | // { LC = LC + $5 } 5 | 6 | END { print "Total line count is: " LC } 7 | -------------------------------------------------------------------------------- /src/Lines: -------------------------------------------------------------------------------- 1 | global.f90 line count is: 15 2 | snap_main.f90 line count is: 84 3 | utils.f90 line count is: 95 4 | version.f90 line count is: 25 5 | plib.F90 line count is: 532 6 | geom.f90 line count is: 113 7 | sn.f90 line count is: 112 8 | data.f90 line count is: 63 9 | control.f90 line count is: 35 10 | input.f90 line count is: 437 11 | setup.f90 line count is: 512 12 | dealloc.f90 line count is: 24 13 | translv.f90 line count is: 228 14 | solvar.f90 line count is: 133 15 | outer.f90 line count is: 143 16 | expxs.f90 line count is: 49 17 | inner.f90 line count is: 148 18 | sweep.f90 line count is: 120 19 | octsweep.f90 line count is: 79 20 | dim1_sweep.f90 line count is: 93 21 | dim3_sweep.f90 line count is: 217 22 | output.f90 line count is: 184 23 | time.F90 line count is: 56 24 | mms.f90 line count is: 265 25 | analyze.f90 line count is: 45 26 | thrd_comm.f90 line count is: 254 27 | mkba_sweep.f90 line count is: 259 28 | Total line count is: 4320 29 | -------------------------------------------------------------------------------- /src/analyze.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: analyze_module 4 | !> @brief 5 | !> This module contains subroutines for analyzing data. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE analyze_module 10 | 11 | USE global_module, ONLY: i_knd, r_knd, ounit 12 | 13 | USE control_module, ONLY: timedep 14 | 15 | USE geom_module, ONLY: dx, dy, dz, nx, ny, nz, ndimen 16 | 17 | USE data_module, ONLY: v, ng 18 | 19 | USE solvar_module, ONLY: flux0, pop 20 | 21 | USE plib_module, ONLY: iproc, root, comm_snap, rtsum 22 | 23 | IMPLICIT NONE 24 | 25 | PUBLIC 26 | 27 | SAVE 28 | 29 | 30 | CONTAINS 31 | 32 | 33 | SUBROUTINE analyze_pop_calc ( cy, time ) 34 | 35 | !----------------------------------------------------------------------- 36 | ! 37 | ! Compute the neutron spectrum: the population per group integrated over 38 | ! volume. 39 | ! 40 | !----------------------------------------------------------------------- 41 | 42 | INTEGER(i_knd), INTENT(IN) :: cy 43 | 44 | REAL(r_knd), INTENT(IN) :: time 45 | !_______________________________________________________________________ 46 | ! 47 | ! Local variables 48 | !_______________________________________________________________________ 49 | 50 | INTEGER(i_knd) :: g 51 | 52 | REAL(r_knd) :: vol 53 | 54 | REAL(r_knd), DIMENSION(nx,ny,nz,ng) :: tmp 55 | !_______________________________________________________________________ 56 | ! 57 | ! Integrate flux over volume of local spatial sub-domain 58 | !_______________________________________________________________________ 59 | 60 | vol = dx 61 | IF ( ndimen > 1 ) THEN 62 | vol = vol*dy 63 | IF ( ndimen > 2 ) vol = vol*dz 64 | END IF 65 | tmp = vol*flux0 66 | 67 | DO g = 1, ng 68 | pop(g) = SUM( tmp(:,:,:,g) ) 69 | END DO 70 | !_______________________________________________________________________ 71 | ! 72 | ! Integrate over global volume with MPI reduction (to root only, not 73 | ! all_reduce) 74 | !_______________________________________________________________________ 75 | 76 | CALL rtsum ( pop, ng, comm_snap, root ) 77 | !_______________________________________________________________________ 78 | ! 79 | ! Divide volume integrated flux by velocity to get particle density 80 | ! per unit energy. Print out results. Note, only root process has 81 | ! correct value because the reduction is not global. Can easily 82 | ! change this though. 83 | !_______________________________________________________________________ 84 | 85 | IF ( iproc == root ) THEN 86 | 87 | IF ( timedep == 1 ) THEN 88 | pop = pop/v 89 | ELSE 90 | WRITE( ounit, 352 ) 91 | END IF 92 | 93 | WRITE( ounit, 350 ) cy, time 94 | DO g = 1, ng 95 | WRITE( ounit, 351 ) g, pop(g) 96 | END DO 97 | WRITE( ounit, * ) 98 | 99 | END IF 100 | !_______________________________________________________________________ 101 | 102 | 350 FORMAT( 2X, 'Particle spectrum, cycle (time)', I4, ' ( ', & 103 | ES11.4, ' )' ) 104 | 351 FORMAT( 8X, I4, ES13.6 ) 105 | 352 FORMAT( 2X, 'Static calc: v(g) not set. Use dummy value of 1.' ) 106 | !_______________________________________________________________________ 107 | !_______________________________________________________________________ 108 | 109 | END SUBROUTINE analyze_pop_calc 110 | 111 | 112 | END MODULE analyze_module 113 | -------------------------------------------------------------------------------- /src/control.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: control_module 4 | !> @brief 5 | !> This module contains the variables that control SNAP's solver 6 | !> routines. This includes the time-dependent variables. It also 7 | !> includes some KBA scheduling variables. 8 | ! 9 | !----------------------------------------------------------------------- 10 | 11 | MODULE control_module 12 | 13 | USE global_module, ONLY: i_knd, r_knd, l_knd, zero, one 14 | 15 | IMPLICIT NONE 16 | 17 | PUBLIC 18 | 19 | SAVE 20 | !_______________________________________________________________________ 21 | ! 22 | ! Module Input Variables 23 | ! 24 | ! epsi - convergence criterion 25 | ! iitm - max inner iterations 26 | ! oitm - max outer iterations 27 | ! timedep - 0/1=no/yes perform a time-dependent calculation 28 | ! tf - final time 29 | ! nsteps - number of time steps to cover the ts -> tf range 30 | ! 31 | ! swp_typ - 0/1=standard order/mini-KBA sweep 32 | ! multiswp - 0/1=no/yes concurrent octant mesh sweeps (corner starts) 33 | ! 34 | ! angcpy - 1/2 copies of the time-edge angular flux 35 | ! 36 | ! it_det - 0/1=no/yes full iteration details 37 | ! soloutp - 0/1=no/yes print single k-plane solution to output file 38 | ! kplane - 0/1+=default mid-plane/k-plane index to print with soloutp 39 | ! popout - 0/1/2=no/final only/every cycle print population data to 40 | ! output file 41 | ! fluxp - 0/1/2=print none/scalar flux/all flux moments to file 42 | ! 43 | ! fixup - 0/1=no/yes perform flux fixup 44 | !_______________________________________________________________________ 45 | 46 | INTEGER(i_knd) :: iitm=5, oitm=100, timedep=0, nsteps=1, swp_typ=0, & 47 | multiswp=1, angcpy=1, it_det=0, soloutp=0, kplane=0, popout=0, & 48 | fluxp=0, fixup=1 49 | 50 | REAL(r_knd) :: epsi=1.0E-4_r_knd, tf=zero 51 | !_______________________________________________________________________ 52 | ! 53 | ! Run-time variables 54 | ! 55 | ! dt - time-step size 56 | ! 57 | ! tolr - parameter, small number used for determining how to 58 | ! compute flux error 59 | ! dfmxi(ng) - max error of inner iteration 60 | ! dfmxo - max error of outer iteration 61 | ! 62 | ! inrdone(ng) - logical for inners being complete 63 | ! otrdone - logical for outers being complete 64 | ! update_ptr - true/false update the ptr_out array 65 | ! 66 | ! ncor - number of corners from which sweeps begin 67 | ! nops - number of chunks a process performs per sweep 68 | ! last_oct - last octant to be swept 69 | ! corner_sch(2,4) - corner scheduling control array 70 | ! yzstg(4) - KBA stage in yz plane per starting corner 71 | ! corner_loop_order(4) - multisweep corner loop priortized order 72 | !_______________________________________________________________________ 73 | 74 | LOGICAL(l_knd) :: otrdone, update_ptr 75 | 76 | LOGICAL(l_knd), ALLOCATABLE, DIMENSION(:) :: inrdone 77 | 78 | INTEGER(i_knd) :: ncor, nops, last_oct, corner_sch(2,4), yzstg(4), & 79 | corner_loop_order(4) 80 | 81 | REAL(r_knd) :: dt, dfmxo 82 | 83 | REAL(r_knd), PARAMETER :: tolr=1.0E-12_r_knd 84 | 85 | REAL(r_knd), ALLOCATABLE, DIMENSION(:) :: dfmxi 86 | 87 | 88 | CONTAINS 89 | 90 | 91 | SUBROUTINE control_allocate ( ng, ndpwds, ierr ) 92 | 93 | !----------------------------------------------------------------------- 94 | ! 95 | ! Allocate control module variables. 96 | ! 97 | !----------------------------------------------------------------------- 98 | 99 | INTEGER(i_knd), INTENT(IN) :: ng 100 | 101 | INTEGER(i_knd), INTENT(INOUT) :: ndpwds 102 | 103 | INTEGER(i_knd), INTENT(OUT) :: ierr 104 | !_______________________________________________________________________ 105 | 106 | ierr = 0 107 | ALLOCATE( dfmxi(ng), inrdone(ng), STAT=ierr ) 108 | IF ( ierr /= 0 ) RETURN 109 | 110 | dfmxi = -one 111 | inrdone = .FALSE. 112 | dfmxo = -one 113 | otrdone = .FALSE. 114 | update_ptr = .FALSE. 115 | 116 | ndpwds = ndpwds + SIZE( dfmxi ) + SIZE( inrdone ) 117 | !_______________________________________________________________________ 118 | !_______________________________________________________________________ 119 | 120 | END SUBROUTINE control_allocate 121 | 122 | 123 | SUBROUTINE control_deallocate 124 | 125 | !----------------------------------------------------------------------- 126 | ! 127 | ! Deallocate control module arrays. 128 | ! 129 | !----------------------------------------------------------------------- 130 | !_______________________________________________________________________ 131 | 132 | DEALLOCATE( dfmxi, inrdone ) 133 | !_______________________________________________________________________ 134 | !_______________________________________________________________________ 135 | 136 | END SUBROUTINE control_deallocate 137 | 138 | 139 | END MODULE control_module 140 | -------------------------------------------------------------------------------- /src/dealloc.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: dealloc_module 4 | !> @brief 5 | !> This module controls the deallocation process of run-time arrays. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE dealloc_module 10 | 11 | USE global_module, ONLY: i_knd 12 | 13 | USE sn_module, ONLY: sn_deallocate 14 | 15 | USE data_module, ONLY: data_deallocate 16 | 17 | USE mms_module, ONLY: mms_deallocate 18 | 19 | USE geom_module, ONLY: geom_deallocate 20 | 21 | USE solvar_module, ONLY: solvar_deallocate 22 | 23 | USE control_module, ONLY: control_deallocate 24 | 25 | IMPLICIT NONE 26 | 27 | PUBLIC 28 | 29 | 30 | CONTAINS 31 | 32 | 33 | SUBROUTINE dealloc_input ( flg ) 34 | 35 | !----------------------------------------------------------------------- 36 | ! 37 | ! Call for the data deallocation from individual deallocation 38 | ! subroutines. Covers the allocations from input. 39 | ! 40 | !----------------------------------------------------------------------- 41 | 42 | INTEGER(i_knd), INTENT(IN) :: flg 43 | !_______________________________________________________________________ 44 | 45 | CALL sn_deallocate 46 | 47 | IF ( flg > 1 ) CALL data_deallocate 48 | 49 | IF ( flg > 2 ) CALL control_deallocate 50 | 51 | IF ( flg > 3 ) CALL mms_deallocate 52 | !_______________________________________________________________________ 53 | !_______________________________________________________________________ 54 | 55 | END SUBROUTINE dealloc_input 56 | 57 | 58 | SUBROUTINE dealloc_solve ( swp_typ, flg ) 59 | 60 | !----------------------------------------------------------------------- 61 | ! 62 | ! Call for the data deallocation from individual deallocation 63 | ! subroutines. Covers the allocations from input. 64 | ! 65 | !----------------------------------------------------------------------- 66 | 67 | INTEGER(i_knd), INTENT(IN) :: swp_typ, flg 68 | !_______________________________________________________________________ 69 | 70 | CALL geom_deallocate ( swp_typ ) 71 | 72 | IF ( flg > 1 ) CALL solvar_deallocate 73 | !_______________________________________________________________________ 74 | !_______________________________________________________________________ 75 | 76 | END SUBROUTINE dealloc_solve 77 | 78 | 79 | END MODULE dealloc_module 80 | -------------------------------------------------------------------------------- /src/expxs.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: expxs_module 4 | !> @brief 5 | !> This module contains the subroutines for expanding a cross section to 6 | !> a full spatial map. 7 | ! 8 | !----------------------------------------------------------------------- 9 | 10 | MODULE expxs_module 11 | 12 | USE global_module, ONLY: i_knd, r_knd, zero 13 | 14 | USE geom_module, ONLY: nx, ny, nz 15 | 16 | USE sn_module, ONLY: nmom, cmom, lma 17 | 18 | USE data_module, ONLY: nmat 19 | 20 | IMPLICIT NONE 21 | 22 | PUBLIC 23 | 24 | INTERFACE expxs_reg 25 | MODULE PROCEDURE expxs_reg_1d, expxs_reg_3d 26 | END INTERFACE 27 | 28 | SAVE 29 | 30 | 31 | CONTAINS 32 | 33 | 34 | SUBROUTINE expxs_reg_1d ( xs, map, cs ) 35 | 36 | !----------------------------------------------------------------------- 37 | ! 38 | ! Expand one of the sig*(nmat,ng) arrays to a 1D spatial mapping. xs is 39 | ! a generic cross section array, map is the material map, and cs is the 40 | ! cross section expanded to the mesh. 41 | ! 42 | !----------------------------------------------------------------------- 43 | 44 | INTEGER(i_knd), DIMENSION(nx), INTENT(IN) :: map 45 | 46 | REAL(r_knd), DIMENSION(nmat), INTENT(IN) :: xs 47 | 48 | REAL(r_knd), DIMENSION(nx), INTENT(OUT) :: cs 49 | !_______________________________________________________________________ 50 | ! 51 | ! Local variables 52 | !_______________________________________________________________________ 53 | 54 | INTEGER(i_knd) :: i 55 | !_______________________________________________________________________ 56 | 57 | DO i = 1, nx 58 | cs(i) = xs(map(i)) 59 | END DO 60 | !_______________________________________________________________________ 61 | !_______________________________________________________________________ 62 | 63 | END SUBROUTINE expxs_reg_1d 64 | 65 | 66 | SUBROUTINE expxs_reg_3d ( xs, map, cs ) 67 | 68 | !----------------------------------------------------------------------- 69 | ! 70 | ! Expand one of the sig*(nmat,ng) arrays to a 3D spatial mapping. xs is 71 | ! a generic cross section array, map is the material map, and cs is the 72 | ! cross section expanded to the mesh. 73 | ! 74 | !----------------------------------------------------------------------- 75 | 76 | INTEGER(i_knd), DIMENSION(nx,ny,nz), INTENT(IN) :: map 77 | 78 | REAL(r_knd), DIMENSION(nmat), INTENT(IN) :: xs 79 | 80 | REAL(r_knd), DIMENSION(nx,ny,nz), INTENT(OUT) :: cs 81 | !_______________________________________________________________________ 82 | ! 83 | ! Local variables 84 | !_______________________________________________________________________ 85 | 86 | INTEGER(i_knd) :: i, j, k 87 | !_______________________________________________________________________ 88 | 89 | DO k = 1, nz 90 | DO j = 1, ny 91 | DO i = 1, nx 92 | cs(i,j,k) = xs(map(i,j,k)) 93 | END DO 94 | END DO 95 | END DO 96 | !_______________________________________________________________________ 97 | !_______________________________________________________________________ 98 | 99 | END SUBROUTINE expxs_reg_3d 100 | 101 | 102 | SUBROUTINE expxs_slgg ( scat, map, cs ) 103 | 104 | !----------------------------------------------------------------------- 105 | ! 106 | ! Expand the slgg(nmat,nmom,ng,ng) array to a 1D spatial mapping. scat 107 | ! is the slgg matrix for a single h->g group coupling, map is the 108 | ! material map, and cs is the scattering matrix expanded to the mesh. 109 | ! 110 | !----------------------------------------------------------------------- 111 | 112 | INTEGER(i_knd), DIMENSION(nx), INTENT(IN) :: map 113 | 114 | REAL(r_knd), DIMENSION(nmat,nmom), INTENT(IN) :: scat 115 | 116 | REAL(r_knd), DIMENSION(cmom-1,nx), INTENT(OUT) :: cs 117 | !_______________________________________________________________________ 118 | ! 119 | ! Local variables 120 | !_______________________________________________________________________ 121 | 122 | INTEGER(i_knd) :: l, i, mom 123 | !_______________________________________________________________________ 124 | 125 | cs = zero 126 | 127 | DO i = 1, nx 128 | mom = 1 129 | DO l = 2, nmom 130 | cs(mom:mom+lma(l)-1,i) = scat(map(i),l) 131 | mom = mom + lma(l) 132 | END DO 133 | END DO 134 | !_______________________________________________________________________ 135 | !_______________________________________________________________________ 136 | 137 | END SUBROUTINE expxs_slgg 138 | 139 | 140 | END MODULE expxs_module 141 | -------------------------------------------------------------------------------- /src/global.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: global_module 4 | !> @brief 5 | !> Global variables for data types, file names and unit numbers, and 6 | !> commonly used numbers 7 | ! 8 | !----------------------------------------------------------------------- 9 | 10 | MODULE global_module 11 | 12 | IMPLICIT NONE 13 | 14 | PUBLIC 15 | 16 | SAVE 17 | !_______________________________________________________________________ 18 | ! 19 | ! Numerical kinds. 20 | !_______________________________________________________________________ 21 | 22 | INTEGER, PARAMETER :: l_knd = KIND( .TRUE. ) 23 | INTEGER, PARAMETER :: i_knd = SELECTED_INT_KIND( 8 ) 24 | INTEGER, PARAMETER :: r_knd = SELECTED_REAL_KIND( 13 ) 25 | !_______________________________________________________________________ 26 | ! 27 | ! File names and unit numbers. 28 | ! 29 | ! ifile - input file name 30 | ! iunit - input file unit number 31 | ! ofile - output file name 32 | ! ounit - output file unit number 33 | !_______________________________________________________________________ 34 | 35 | CHARACTER(LEN=64) :: ifile, ofile 36 | 37 | INTEGER(i_knd), PARAMETER :: iunit=10, ounit=11 38 | !_______________________________________________________________________ 39 | ! 40 | ! Commonly used numbers. 41 | !_______________________________________________________________________ 42 | 43 | REAL(r_knd), PARAMETER :: zero = 0.0_r_knd 44 | REAL(r_knd), PARAMETER :: half = 0.5_r_knd 45 | REAL(r_knd), PARAMETER :: one = 1.0_r_knd 46 | REAL(r_knd), PARAMETER :: two = 2.0_r_knd 47 | 48 | REAL(r_knd), PARAMETER :: pi = 3.14159265358979_r_knd 49 | !_______________________________________________________________________ 50 | !_______________________________________________________________________ 51 | 52 | 53 | END MODULE global_module 54 | -------------------------------------------------------------------------------- /src/time.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: time_module 4 | !> @brief 5 | !> This module contains the variables that measure SNAP execution 6 | !> times for different pieces of code and the subroutine used to get the 7 | !> time. It also has the timing summary print. 8 | ! 9 | !----------------------------------------------------------------------- 10 | 11 | MODULE time_module 12 | 13 | USE global_module, ONLY: r_knd, i_knd, zero, ounit 14 | 15 | #ifdef MPI 16 | USE mpi 17 | #endif 18 | 19 | IMPLICIT NONE 20 | 21 | PUBLIC 22 | 23 | SAVE 24 | !_______________________________________________________________________ 25 | ! 26 | ! Run-time variables 27 | ! 28 | ! tsnap - total SNAP run time 29 | ! tparset - parallel environment setup time 30 | ! tinp - input run time 31 | ! tset - setup run time 32 | ! tslv - total solution run time 33 | ! tparam - time for setting up solve parameters 34 | ! totrsrc - time for outer source computations 35 | ! tinners - total time spent on inner iterations 36 | ! tinrsrc - time for inner source computations 37 | ! tsweeps - time for transport sweeps, including angular sourc compute 38 | ! tinrmisc - time for miscellaneous inner ops 39 | ! tslvmisc - time for miscellaneous solution ops 40 | ! tout - output run time 41 | ! tgrind - transport grind time 42 | !_______________________________________________________________________ 43 | 44 | REAL(r_knd) :: tsnap=zero, tparset=zero, tinp=zero, tset=zero, & 45 | tslv=zero, tparam=zero, totrsrc=zero, tinners=zero, tinrsrc=zero, & 46 | tsweeps=zero, tinrmisc=zero, tslvmisc=zero, tout=zero, tgrind=zero 47 | 48 | 49 | CONTAINS 50 | 51 | 52 | SUBROUTINE wtime ( time ) 53 | 54 | !----------------------------------------------------------------------- 55 | ! 56 | ! Get the current time 57 | ! 58 | !----------------------------------------------------------------------- 59 | 60 | REAL(r_knd), INTENT(OUT) :: time 61 | !_______________________________________________________________________ 62 | 63 | #ifdef MPI 64 | time = MPI_WTIME() 65 | #else 66 | CALL CPU_TIME ( time ) 67 | #endif 68 | !_______________________________________________________________________ 69 | !_______________________________________________________________________ 70 | 71 | END SUBROUTINE wtime 72 | 73 | 74 | SUBROUTINE time_summ 75 | 76 | !----------------------------------------------------------------------- 77 | ! 78 | ! Print the timing summary to the output file. 79 | ! 80 | !----------------------------------------------------------------------- 81 | !_______________________________________________________________________ 82 | ! 83 | ! Local variables 84 | !_______________________________________________________________________ 85 | 86 | CHARACTER(LEN=1) :: star='*' 87 | 88 | INTEGER(i_knd) :: i 89 | !_______________________________________________________________________ 90 | 91 | tinrmisc = tinners - ( tinrsrc + tsweeps ) 92 | tslvmisc = tslv - ( tparam + totrsrc + tinners ) 93 | 94 | WRITE( ounit, 401 ) ( star, i = 1, 80 ) 95 | WRITE( ounit, 402 ) 96 | WRITE( ounit, 403 ) tparset 97 | WRITE( ounit, 404 ) tinp 98 | WRITE( ounit, 405 ) tset 99 | WRITE( ounit, 406 ) tslv 100 | WRITE( ounit, 407 ) tparam 101 | WRITE( ounit, 408 ) totrsrc 102 | WRITE( ounit, 409 ) tinners 103 | WRITE( ounit, 410 ) tinrsrc 104 | WRITE( ounit, 411 ) tsweeps 105 | WRITE( ounit, 412 ) tinrmisc 106 | WRITE( ounit, 413 ) tslvmisc 107 | WRITE( ounit, 414 ) tout 108 | !_______________________________________________________________________ 109 | 110 | 401 FORMAT( 10X, 'keyword Timing Summary', /, 80A, / ) 111 | 402 FORMAT( 2X, 'Code Section', T41, 'Time (seconds)', /, & 112 | 1X, '**************', T40, '****************' ) 113 | 403 FORMAT( 4X, 'Parallel Setup', T41, ES11.4 ) 114 | 404 FORMAT( 4X, 'Input', T41, ES11.4 ) 115 | 405 FORMAT( 4X, 'Setup', T41, ES11.4 ) 116 | 406 FORMAT( 4X, 'Solve', T41, ES11.4 ) 117 | 407 FORMAT( 7X, 'Parameter Setup', T41, ES11.4 ) 118 | 408 FORMAT( 7X, 'Outer Source', T41, ES11.4 ) 119 | 409 FORMAT( 7X, 'Inner Iterations', T41, ES11.4 ) 120 | 410 FORMAT( 10X, 'Inner Source', T41, ES11.4 ) 121 | 411 FORMAT( 10X, 'Transport Sweeps', T41, ES11.4 ) 122 | 412 FORMAT( 10X, 'Inner Misc Ops', T41, ES11.4 ) 123 | 413 FORMAT( 7X, 'Solution Misc Ops', T41, ES11.4 ) 124 | 414 FORMAT( 4X, 'Output', T41, ES11.4 ) 125 | !_______________________________________________________________________ 126 | !_______________________________________________________________________ 127 | 128 | END SUBROUTINE time_summ 129 | 130 | 131 | END MODULE time_module 132 | -------------------------------------------------------------------------------- /src/version.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------- 2 | ! 3 | ! MODULE: version_module 4 | !> @brief 5 | !> This module handles version information. 6 | ! 7 | !----------------------------------------------------------------------- 8 | 9 | MODULE version_module 10 | 11 | USE global_module, ONLY: i_knd, ounit 12 | 13 | IMPLICIT NONE 14 | 15 | PUBLIC 16 | 17 | SAVE 18 | !_______________________________________________________________________ 19 | ! 20 | ! SNAP release number and release date. 21 | !_______________________________________________________________________ 22 | 23 | INTEGER(i_knd) :: version = 112 24 | 25 | CHARACTER(LEN=8) :: cvers = '1.12' 26 | 27 | CHARACTER(LEN=10) :: vdate = '09-07-2021' 28 | !_______________________________________________________________________ 29 | !_______________________________________________________________________ 30 | 31 | 32 | CONTAINS 33 | 34 | 35 | SUBROUTINE version_print 36 | 37 | !----------------------------------------------------------------------- 38 | ! 39 | ! Print version information. 40 | ! 41 | !----------------------------------------------------------------------- 42 | !_______________________________________________________________________ 43 | ! 44 | ! Local variables. 45 | !_______________________________________________________________________ 46 | 47 | CHARACTER(LEN=12) :: rc(3) 48 | 49 | INTEGER(i_knd), DIMENSION(8) :: dttm 50 | !_______________________________________________________________________ 51 | ! 52 | ! Call intrinsics to get current date and time. Print to output file 53 | ! information about the code. 54 | !_______________________________________________________________________ 55 | 56 | CALL DATE_AND_TIME (rc(1), rc(2), rc(3), dttm) 57 | 58 | WRITE( ounit, 111 ) 59 | WRITE( ounit, 112 ) cvers 60 | WRITE( ounit, 113 ) vdate 61 | WRITE( ounit, FMT=114, ADVANCE='NO' ) dttm(2), dttm(3), dttm(1) 62 | WRITE( ounit, 115 ) dttm(5), dttm(6), dttm(7) 63 | !_______________________________________________________________________ 64 | 65 | 111 FORMAT( 1X, 'SNAP: SN (Discrete Ordinates) Application Proxy' ) 66 | 112 FORMAT( 1X, 'Version Number.. ', A5 ) 67 | 113 FORMAT( 1X, 'Version Date.. ', A10 ) 68 | 114 FORMAT( 1X, 'Ran on ', I2, '-', I2, '-', I4 ) 69 | 115 FORMAT( ' at time ', I2, ':', I2, ':', I2 ) 70 | !_______________________________________________________________________ 71 | !_______________________________________________________________________ 72 | 73 | END SUBROUTINE version_print 74 | 75 | 76 | END MODULE version_module 77 | --------------------------------------------------------------------------------