<commit_before>##############################################################################
## YASK: Yet Another Stencil Kernel
## Copyright (c) 2014-2017, Intel Corporation
## 
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to
## deal in the Software without restriction, including without limitation the
## rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
## sell copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
## 
## * The above copyright notice and this permission notice shall be included in
##   all copies or substantial portions of the Software.
## 
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
## IN THE SOFTWARE.
##############################################################################

# Type 'make help' for some examples.

# Some of the make vars available:
#
# stencil: see list below.
#
# arch: see list below.
#
# mpi: 0, 1: whether to use MPI. 
#   Currently, MPI is only used in X dimension.
#
# radius: sets size of certain stencils.
#
# real_bytes: FP precision: 4=float, 8=double.
#
# fold: How to fold vectors (x*y*z).
#   Vectorization in dimensions perpendicular to the inner loop
#   (defined by BLOCK_LOOP_CODE below) often works well.
#
# cluster: How many folded vectors to evaluate simultaneously.
#
# eqs: comma-separated name=substr pairs used to group
#   grid update equations into sets.
#
# streaming_stores: 0, 1: Whether to use streaming stores.
#
# hbw: 0, 1: whether to use memkind lib.
#   If hbw=1, the memkind lib will be used to allocate grids;
#   this can provide the ability to fine-tune which grids use
#   HBW and which use default memory.
#
# omp_schedule: OMP schedule policy for region loop.
# omp_block_schedule: OMP schedule policy for nested OpenMP block loop.
# omp_halo_schedule: OMP schedule policy for OpenMP halo loop.
#
# def_block_threads: Number of threads to use in nested OpenMP block loop by default.
# def_thread_divisor: Divide number of OpenMP threads by this factor by default.
#
# def_*_size, def_pad: Default sizes used in executable.

# Initial defaults.
stencil		=	unspecified
arch		=	knl
mpi		=	0

# Defaults based on stencil type.
ifeq ($(stencil),)
$(error Stencil not specified; use stencil=iso3dfd, 3axis, 9axis, 3plane, cube, ave, stream, awp, awp_elastic, ssg , fsg or fsg_abc)

else ifeq ($(stencil),ave)
radius		?=	1
real_bytes	?=	8

else ifeq ($(stencil),3axis)
MACROS		+=	MAX_EXCH_DIST=1
radius		?=	6

else ifeq ($(stencil),9axis)
MACROS		+=	MAX_EXCH_DIST=2
radius		?=	4

else ifeq ($(stencil),3plane)
MACROS		+=	MAX_EXCH_DIST=2
radius		?=	3

else ifeq ($(stencil),cube)
MACROS		+=	MAX_EXCH_DIST=3
radius		?=	2

else ifeq ($(stencil),iso3dfd)
MACROS		+=	MAX_EXCH_DIST=1
radius		?=	8
real_bytes	?=	4
ifeq ($(arch),knl)
ifeq ($(real_bytes),4)
fold		?=	x=2,y=8,z=1
else
fold		?=	x=2,y=4,z=1
endif
cluster		?=	x=2
else
cluster		?=	z=2
endif

else ifeq ($(stencil),stream)
MACROS		+=	MAX_EXCH_DIST=0
radius		?=	2
cluster		?=	x=2

else ifneq ($(findstring awp,$(stencil)),)
eqs		?=	velocity=vel,stress=str
time_alloc	?=	1
def_block_size	?=	32
ifeq ($(arch),knl)
def_thread_divisor	?=	2
def_block_threads	?=	4
endif
FB_FLAGS	+=	-min-es 1

else ifeq ($(stencil)),ssg)
eqs		?=	v_bl=v_bl,v_tr=v_tr,v_tl=v_tl,s_br=s_br,s_bl=s_bl,s_tr=s_tr,s_tl=s_tl

else ifeq ($(stencil),fsg)
eqs             ?=      v_br=v_br,v_bl=v_bl,v_tr=v_tr,v_tl=v_tl,s_br=s_br,s_bl=s_bl,s_tr=s_tr,s_tl=s_tl
time_alloc	?=	1
ifeq ($(arch),knl)
REGION_LOOP_CODE ?=     omp square_wave serpentine loop(rn,rz,rx,ry) { calc(block(rt)); }
BLOCK_LOOP_CODE ?=      omp square_wave serpentine loop(bnv,bxv,byv) { prefetch(L1) loop(bzv) { calc(cluster(bt)); } }
def_block_size  ?=      32
def_thread_divisor ?=	4
def_block_threads ?= 	1<commit_msg>Update FSG best built options<commit_after>##############################################################################
## YASK: Yet Another Stencil Kernel
## Copyright (c) 2014-2017, Intel Corporation
## 
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to
## deal in the Software without restriction, including without limitation the
## rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
## sell copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
## 
## * The above copyright notice and this permission notice shall be included in
##   all copies or substantial portions of the Software.
## 
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
## IN THE SOFTWARE.
##############################################################################

# Type 'make help' for some examples.

# Some of the make vars available:
#
# stencil: see list below.
#
# arch: see list below.
#
# mpi: 0, 1: whether to use MPI. 
#   Currently, MPI is only used in X dimension.
#
# radius: sets size of certain stencils.
#
# real_bytes: FP precision: 4=float, 8=double.
#
# fold: How to fold vectors (x*y*z).
#   Vectorization in dimensions perpendicular to the inner loop
#   (defined by BLOCK_LOOP_CODE below) often works well.
#
# cluster: How many folded vectors to evaluate simultaneously.
#
# eqs: comma-separated name=substr pairs used to group
#   grid update equations into sets.
#
# streaming_stores: 0, 1: Whether to use streaming stores.
#
# hbw: 0, 1: whether to use memkind lib.
#   If hbw=1, the memkind lib will be used to allocate grids;
#   this can provide the ability to fine-tune which grids use
#   HBW and which use default memory.
#
# omp_schedule: OMP schedule policy for region loop.
# omp_block_schedule: OMP schedule policy for nested OpenMP block loop.
# omp_halo_schedule: OMP schedule policy for OpenMP halo loop.
#
# def_block_threads: Number of threads to use in nested OpenMP block loop by default.
# def_thread_divisor: Divide number of OpenMP threads by this factor by default.
#
# def_*_size, def_pad: Default sizes used in executable.

# Initial defaults.
stencil		=	unspecified
arch		=	knl
mpi		=	0

# Defaults based on stencil type.
ifeq ($(stencil),)
$(error Stencil not specified; use stencil=iso3dfd, 3axis, 9axis, 3plane, cube, ave, stream, awp, awp_elastic, ssg , fsg or fsg_abc)

else ifeq ($(stencil),ave)
radius		?=	1
real_bytes	?=	8

else ifeq ($(stencil),3axis)
MACROS		+=	MAX_EXCH_DIST=1
radius		?=	6

else ifeq ($(stencil),9axis)
MACROS		+=	MAX_EXCH_DIST=2
radius		?=	4

else ifeq ($(stencil),3plane)
MACROS		+=	MAX_EXCH_DIST=2
radius		?=	3

else ifeq ($(stencil),cube)
MACROS		+=	MAX_EXCH_DIST=3
radius		?=	2

else ifeq ($(stencil),iso3dfd)
MACROS		+=	MAX_EXCH_DIST=1
radius		?=	8
real_bytes	?=	4
ifeq ($(arch),knl)
ifeq ($(real_bytes),4)
fold		?=	x=2,y=8,z=1
else
fold		?=	x=2,y=4,z=1
endif
cluster		?=	x=2
else
cluster		?=	z=2
endif

else ifeq ($(stencil),stream)
MACROS		+=	MAX_EXCH_DIST=0
radius		?=	2
cluster		?=	x=2

else ifneq ($(findstring awp,$(stencil)),)
eqs		?=	velocity=vel,stress=str
time_alloc	?=	1
def_block_size	?=	32
ifeq ($(arch),knl)
def_thread_divisor	?=	2
def_block_threads	?=	4
endif
FB_FLAGS	+=	-min-es 1

else ifeq ($(stencil)),ssg)
eqs		?=	v_bl=v_bl,v_tr=v_tr,v_tl=v_tl,s_br=s_br,s_bl=s_bl,s_tr=s_tr,s_tl=s_tl

else ifeq ($(stencil),fsg)
eqs             ?=      v_br=v_br,v_bl=v_bl,v_tr=v_tr,v_tl=v_tl,s_br=s_br,s_bl=s_bl,s_tr=s_tr,s_tl=s_tl
time_alloc	?=	1
ifeq ($(arch),knl)
REGION_LOOP_CODE ?=     omp serpentine loop(rn,ry,rx,rz) { calc(block(rt)); } 
BLOCK_LOOP_CODE ?=      serpentine loop(bnv,byv,bxv) {  prefetch(L2) loop(bzv) { calc(cluster(bt)); } }
omp_schedule    ?=	guided
def_block_size  ?=      16
def_thread_divisor ?=	4
def_block_threads ?= 	1
{'fraction_non_alphanumeric': 0.14012003693444136, 'fraction_numerical': 0.014542936288088643, 'mean_word_length': 4.815436241610739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2413197', 'n_tokens_mistral': 3224, 'n_tokens_neox': 3042, 'n_words': 1030}