90 virtual const std::string&
98 virtual const std::string&
624 virtual std::vector<yk_var_ptr>
731 idx_t last_step_index ) =0;
842 bool verbose =
false ) =0;
1015 const std::initializer_list<std::string>& dims ) =0;
1093 const std::initializer_list<std::string>& dims,
1140 idx_t first_step_index,
1243 inline std::vector<yk_var_ptr>
1261 const std::initializer_list<std::string>& dims) {
1280 const std::initializer_list<std::string>& dims,
Stencil solution as defined by the generated code from the YASK stencil compiler.
Definition yk_solution_api.hpp:82
virtual idx_t get_first_rank_domain_index(const std::string &dim) const =0
Get the first index of the sub-domain in this rank in the specified dimension.
virtual int get_default_numa_preferred() const =0
[Advanced] Get the default preferred NUMA node on which to allocate data.
virtual yk_var_ptr get_var(const std::string &name)=0
Get the specified var.
virtual int get_num_outer_threads() const =0
Get the number of outer OpenMP threads.
virtual const std::string & get_description() const =0
Get the description (long name) of the solution.
virtual bool is_auto_tuner_enabled() const =0
Determine whether the online auto-tuner is enabled on this rank.
virtual void copy_vars_from_device() const =0
Update data on the host.
YASK_DEPRECATED yk_var_ptr new_fixed_size_grid(const std::string &name, const std::initializer_list< std::string > &dims, const idx_t_vec &dim_sizes)
[Deprecated] Use new_fixed_size_var().
Definition yk_solution_api.hpp:1279
virtual void clear_stats()=0
Clear the internal stats.
virtual void run_solution(idx_t first_step_index, idx_t last_step_index)=0
Run the stencil solution for the specified steps.
virtual void set_rank_domain_size(const std::string &dim, idx_t size)=0
Set the local-domain size in the specified dimension, i.e., the size of the part of the domain that i...
virtual void set_overall_domain_size_vec(const idx_t_vec &vals)=0
Set the global-domain size in all domain dimensions.
virtual void set_block_size_vec(const idx_t_vec &vals)=0
Set the block size in all domain dimensions.
virtual idx_t get_min_pad_size(const std::string &dim) const =0
[Advanced] Get the minimum requested amount of padding for all vars.
std::function< void(yk_solution &soln, idx_t first_step_index, idx_t last_step_index)> hook_fn_2idx_t
[Advanced] Callback type with yk_solution and step-index parameters.
Definition yk_solution_api.hpp:1141
virtual void call_before_run_solution(hook_fn_2idx_t hook_fn)=0
[Advanced] Register a hook function to be called at the beginning of yk_solution::run_solution().
virtual string_vec get_domain_dim_names() const =0
Get all the domain dimension names.
virtual std::vector< yk_var_ptr > get_vars()=0
Get all the vars.
virtual const std::string & get_name() const =0
Get the name of the solution.
virtual yk_var_ptr new_fixed_size_var(const std::string &name, const string_vec &dims, const idx_t_vec &dim_sizes)=0
[Advanced] Add a new var to the solution with a specified size.
virtual bool is_offloaded() const =0
Get whether the stencil kernel will be offloaded to a device.
virtual void copy_vars_to_device() const =0
Update data on the device.
virtual void call_after_prepare_solution(hook_fn_t hook_fn)=0
[Advanced] Register a hook function to be called at the end of yk_solution::prepare_solution().
YASK_DEPRECATED yk_var_ptr new_grid(const std::string &name, const std::initializer_list< std::string > &dims)
[Deprecated] Use new_var().
Definition yk_solution_api.hpp:1260
virtual void set_rank_domain_size_vec(const idx_t_vec &vals)=0
Set the local-domain size in all domain dimensions.
virtual idx_t get_rank_index(const std::string &dim) const =0
Get the rank index in the specified dimension.
virtual int get_num_domain_dims() const =0
Get the number of domain dimensions used in this solution.
virtual string_vec get_misc_dim_names() const =0
Get all the miscellaneous dimension names.
virtual idx_t get_num_ranks(const std::string &dim) const =0
Get the number of MPI ranks in the given dimension.
virtual void set_overall_domain_size_vec(const idx_t_init_list &vals)=0
Set the global-domain size in all domain dimensions.
virtual void run_solution(idx_t step_index)=0
Run the stencil solution for the specified step.
virtual std::string get_command_line_values()=0
Return a description of the current settings of the command-line options.
YASK_DEPRECATED int get_num_grids() const
[Deprecated] Use get_num_vars().
Definition yk_solution_api.hpp:1230
virtual idx_t_vec get_rank_domain_size_vec() const =0
Get the local-domain size in all domain dimensions.
virtual int get_element_bytes() const =0
Get the floating-point precision size.
virtual void call_after_run_solution(hook_fn_2idx_t hook_fn)=0
[Advanced] Register a hook function to be called at the end of yk_solution::run_solution().
virtual std::string apply_command_line_options(const string_vec &args)=0
Set kernel options from a vector of strings.
YASK_DEPRECATED yk_var_ptr get_grid(const std::string &name)
[Deprecated] Use get_var().
Definition yk_solution_api.hpp:1237
virtual void fuse_vars(yk_solution_ptr source)=0
[Advanced] Merge YASK variables with another solution.
virtual idx_t get_rank_domain_size(const std::string &dim) const =0
Get the local-domain size in the specified dimension, i.e., the size in this rank.
virtual idx_t get_last_rank_domain_index(const std::string &dim) const =0
Get the last index of the sub-domain in this rank the specified dimension.
virtual idx_t get_block_size(const std::string &dim) const =0
Get the block size.
virtual idx_t_vec get_rank_index_vec() const =0
Get the rank index in all domain dimensions.
virtual void exchange_halos()=0
Force a halo exchange now.
virtual int get_num_inner_threads() const =0
Get the number of inner (nested) OpenMP threads.
virtual std::string get_step_dim_name() const =0
Get the solution step dimension.
virtual idx_t_vec get_num_ranks_vec() const =0
Get the number of MPI ranks in all domain dimensions.
virtual yk_var_ptr new_var(const std::string &name, const string_vec &dims)=0
[Advanced] Add a new var to the solution.
virtual idx_t_vec get_block_size_vec() const =0
Get the block size in all domain dimensions.
virtual idx_t_vec get_first_rank_domain_index_vec() const =0
Get the first index of the sub-domain in this rank in all domain dimensions.
virtual void set_num_ranks_vec(const idx_t_init_list &vals)=0
Set the number of all MPI ranks in all domain dimensions.
virtual YASK_DEPRECATED void set_debug_output(yask_output_ptr debug)=0
[Deprecated] Use yk_env::set_debug_output().
virtual void set_overall_domain_size(const std::string &dim, idx_t size)=0
Get the global-domain size in the specified dimension, i.e., the total size across all MPI ranks.
virtual void set_num_ranks_vec(const idx_t_vec &vals)=0
Set the number of MPI ranks in all domain dimensions.
YASK_DEPRECATED yk_var_ptr new_fixed_size_grid(const std::string &name, const string_vec &dims, const idx_t_vec &dim_sizes)
[Deprecated] Use new_fixed_size_var().
Definition yk_solution_api.hpp:1269
virtual yk_var_ptr new_fixed_size_var(const std::string &name, const std::initializer_list< std::string > &dims, const idx_t_init_list &dim_sizes)=0
[Advanced] Add a new var to the solution with a specified size.
virtual void run_auto_tuner_now(bool verbose=true)=0
Run the offline auto-tuner immediately, not preserving variable data.
std::function< void(yk_solution &)> hook_fn_t
[Advanced] Callback type with yk_solution parameter.
Definition yk_solution_api.hpp:1136
virtual void set_rank_index_vec(const idx_t_init_list &vals)=0
Set the rank index in all domain dimensions.
virtual void reset_auto_tuner(bool enable, bool verbose=false)=0
Start or stop the online auto-tuner on this rank.
virtual void set_block_size_vec(const idx_t_init_list &vals)=0
Set the block size in all domain dimensions.
virtual idx_t_vec get_last_rank_domain_index_vec() const =0
Get the last index of the sub-domain in this rank in all domain dimensions.
virtual void set_rank_domain_size_vec(const idx_t_init_list &vals)=0
Set the local-domain size in all domain dimensions.
virtual int get_num_vars() const =0
Get the number of vars in the solution.
virtual void prepare_solution()=0
Prepare the solution for stencil application.
virtual idx_t_vec get_overall_domain_size_vec() const =0
Get the global-domain size in all domain dimensions.
virtual idx_t get_overall_domain_size(const std::string &dim) const =0
Get the global-domain size in the specified dimension, i.e., the total size across all MPI ranks.
virtual std::string get_target() const =0
Get the target ISA.
virtual yk_stats_ptr get_stats()=0
Get performance statistics associated with preceding calls to run_solution().
virtual void set_min_pad_size(const std::string &dim, idx_t size)=0
[Advanced] Set the minimum amount of padding for all vars.
virtual void set_rank_index_vec(const idx_t_vec &vals)=0
Set the rank index in all domain dimensions.
virtual void set_block_size(const std::string &dim, idx_t size)=0
Set the block size in the given dimension.
virtual std::string get_command_line_help()=0
Return a help-string for the command-line options.
virtual void set_rank_index(const std::string &dim, idx_t num)=0
Set the rank index in the specified dimension.
virtual std::string apply_command_line_options(const std::string &args)=0
Set kernel options from a string.
YASK_DEPRECATED void fuse_grids(yk_solution_ptr source)
[Deprecated] Use fuse_vars().
Definition yk_solution_api.hpp:1289
virtual void set_num_ranks(const std::string &dim, idx_t num)=0
Set the number of MPI ranks in the given dimension.
YASK_DEPRECATED yk_var_ptr new_grid(const std::string &name, const string_vec &dims)
[Deprecated] Use new_var().
Definition yk_solution_api.hpp:1251
virtual bool set_default_numa_preferred(int numa_node)=0
[Advanced] Set the default preferred NUMA node on which to allocate data.
virtual std::string apply_command_line_options(int argc, char *argv[])=0
Set kernel options from standard C or C++ argc and argv parameters to main().
virtual bool get_step_wrap() const =0
[Advanced] Get whether invalid step indices alias to valid ones.
virtual yk_var_ptr new_var(const std::string &name, const std::initializer_list< std::string > &dims)=0
[Advanced] Add a new var to the solution.
virtual void call_before_prepare_solution(hook_fn_t hook_fn)=0
[Advanced] Register a function to be called at the beginning of yk_solution::prepare_solution().
YASK_DEPRECATED std::vector< yk_var_ptr > get_grids()
[Deprecated] Use get_vars().
Definition yk_solution_api.hpp:1244
virtual void set_step_wrap(bool do_wrap)=0
[Advanced] Set whether invalid step indices alias to valid ones.
virtual void end_solution()=0
Finish using a solution.
Statistics from calls to run_solution().
Definition yk_solution_api.hpp:1300
virtual idx_t get_est_fp_ops_done()=0
Get the estimated number of floating-point operations executed across all steps.
virtual idx_t get_num_elements()=0
Get the number of elements in the overall domain.
virtual idx_t get_num_steps_done()=0
Get the number of steps executed via run_solution().
virtual double get_elapsed_secs()=0
Get the number of seconds elapsed during calls to run_solution().
virtual idx_t get_num_writes_done()=0
Get the number of elements written across all steps.
YASK_INT64_T idx_t
Type to use for indexing grids.
Definition yask_common_api.hpp:86
std::vector< std::string > string_vec
Vector of strings.
Definition yask_common_api.hpp:99
std::shared_ptr< yask_output > yask_output_ptr
Shared pointer to yask_output.
Definition yask_common_api.hpp:105
std::initializer_list< idx_t > idx_t_init_list
Initializer list of indices.
Definition yask_common_api.hpp:96
std::vector< idx_t > idx_t_vec
Vector of indices.
Definition yask_common_api.hpp:89
std::shared_ptr< yk_stats > yk_stats_ptr
Shared pointer to yk_stats.
Definition yask_kernel_api.hpp:66
std::shared_ptr< yk_solution > yk_solution_ptr
Shared pointer to yk_solution.
Definition yask_kernel_api.hpp:58
const int yask_numa_none
Do not specify any NUMA binding.
Definition yk_solution_api.hpp:65
const int yask_numa_interleave
Allocate vars across all available NUMA nodes.
Definition yk_solution_api.hpp:57
const int yask_numa_local
Allocate vars on local NUMA node.
Definition yk_solution_api.hpp:49
std::shared_ptr< yk_var > yk_var_ptr
Shared pointer to yk_var.
Definition yask_kernel_api.hpp:62
const int yask_numa_offload
Do not specify any NUMA binding and use allocations optimized for offloading.
Definition yk_solution_api.hpp:73
#define YASK_DEPRECATED
Deprecated attribute.
Definition yask_common_api.hpp:60