YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
yask::yk_factory Class Reference

Bootstrap factory to create a stencil solution. More...

#include <yask_kernel_api.hpp>

Public Member Functions

virtual std::string get_version_string ()
 Version information.
 
virtual yk_env_ptr new_env () const
 Create an object to hold environment information.
 
virtual yk_env_ptr new_env (MPI_Comm comm) const
 Create a yk_env object using the provided MPI communicator.
 
virtual yk_solution_ptr new_solution (yk_env_ptr env) const
 Create a stencil solution.
 
virtual yk_solution_ptr new_solution (yk_env_ptr env, const yk_solution_ptr source) const
 [Advanced] Create a stencil solution by copying the settings from another.
 

Detailed Description

Bootstrap factory to create a stencil solution.

Member Function Documentation

◆ get_version_string()

virtual std::string yask::yk_factory::get_version_string ( )
virtual

Version information.

Returns
String describing the current version.

◆ new_env() [1/2]

virtual yk_env_ptr yask::yk_factory::new_env ( ) const
virtual

Create an object to hold environment information.

Performs the following initialization steps:

  • Initializes MPI if MPI is enabled but not yet initialized. Does not initialize MPI if MPI is not enabled or already initialized. If MPI is enabled, uses MPI_COMM_WORLD as the communicator.
  • Sets flush-to-zero (FTZ) and denormals-are-zero (DAZ) floating-point controls.
  • Enables "hot teams" mode for Intel OpenMP. Initializes OpenMP library if it is not already started. If it is already started, note that the "hot teams" mode may not get set correctly. This mode is important for optimal performance of nested OpenMP regions (used when the number of threads per block is greater than one).
Note
If you initialize MPI before calling this function, you should call MPI_Init_thread(..., MPI_THREAD_SERIALIZED, ...) or MPI_Init_thread(..., MPI_THREAD_MULTIPLE, ...).
If you initialize OpenMP (by calling any OpenMP function) before calling this function, set the following environment variables prior to initializing OpenMP: KMP_HOT_TEAMS_MODE= and KMP_HOT_TEAMS_MAX_LEVEL=2.

Environment info is kept in a separate object to factilitate initializing the environment before creating a solution and sharing an environment among multiple solutions.

Returns
Pointer to new env object.

◆ new_env() [2/2]

virtual yk_env_ptr yask::yk_factory::new_env ( MPI_Comm  comm) const
virtual

Create a yk_env object using the provided MPI communicator.

Behaves like new_env(), but uses the provided MPI communicator instead of using MPI_COMM_WORLD. MPI must be enabled and initialized before calling this function following the usage notes for new_env().

Note
#include "mpi.h" should precede #include "yask_kernel_api.hpp" to ensure proper MPI type definitions.

◆ new_solution() [1/2]

virtual yk_solution_ptr yask::yk_factory::new_solution ( yk_env_ptr  env) const
virtual

Create a stencil solution.

A stencil solution contains all the vars and equations that were created during stencil compilation.

Returns
Pointer to new solution object.
Parameters
[in]envPointer to env info.

◆ new_solution() [2/2]

virtual yk_solution_ptr yask::yk_factory::new_solution ( yk_env_ptr  env,
const yk_solution_ptr  source 
) const
virtual

[Advanced] Create a stencil solution by copying the settings from another.

All the settings that were specified via the yk_solution::set_*() functions in the source solution will be copied to the new solution. This does not copy any vars, var settings, or var data; see yk_solution::fuse_vars().

Returns
Pointer to new solution object.
Parameters
[in]envPointer to env info.
[in]sourcePointer to existing yk_solution from which the settings will be copied.

The documentation for this class was generated from the following file: