Skip to content

write_aop_knowledgeWriteAopKnowledgeWriteAopKnowledgewrite_aop_knowledgewrite_aop_knowledge🔗

Short description🔗

write_aop_knowledgeWriteAopKnowledgeWriteAopKnowledgewrite_aop_knowledgewrite_aop_knowledge — Write knowledge about hardware dependent behavior of automatic operator parallelization to file.

Signature🔗

write_aop_knowledge( filename.write FileName, string GenParamName, string GenParamValue )void WriteAopKnowledge( const HTuple& FileName, const HTuple& GenParamName, const HTuple& GenParamValue )static void HOperatorSet.WriteAopKnowledge( HTuple fileName, HTuple genParamName, HTuple genParamValue )def write_aop_knowledge( file_name: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, int, float]] ) -> None

Herror write_aop_knowledge( const char* FileName, const char* GenParamName, const char* GenParamValue )

Herror T_write_aop_knowledge( const Htuple FileName, const Htuple GenParamName, const Htuple GenParamValue )

static void HSystem::WriteAopKnowledge( const HString& FileName, const HTuple& GenParamName, const HTuple& GenParamValue )

static void HSystem::WriteAopKnowledge( const HString& FileName, const HString& GenParamName, const HString& GenParamValue )

static void HSystem::WriteAopKnowledge( const char* FileName, const char* GenParamName, const char* GenParamValue )

static void HSystem::WriteAopKnowledge( const wchar_t* FileName, const wchar_t* GenParamName, const wchar_t* GenParamValue ) (Windows only)

static void HSystem.WriteAopKnowledge( string fileName, HTuple genParamName, HTuple genParamValue )

static void HSystem.WriteAopKnowledge( string fileName, string genParamName, string genParamValue )

Description🔗

write_aop_knowledgeWriteAopKnowledge stores the automatic parallelization knowledge of HALCON operators to file. The knowledge hold by the HALCON system is used to better utilize multiprocessor hardware in order to speed up the processing of operators. To optimize the automatic parallelization of operators, HALCON needs some specific knowledge about the speed of operators on the used hardware. This hardware-specific knowledge can be obtained by calling the operator optimize_aopOptimizeAop or read from file by using read_aop_knowledgeReadAopKnowledge, respectively.

With write_aop_knowledgeWriteAopKnowledge it is possible to store this knowledge explicitly in a binary file. At this, FileNamefileNamefile_name denotes the name of this file (incl. path and file extension). If an empty string ''"" is passed to FileNamefileNamefile_name, HALCON writes the knowledge to the specific file .aop_info in the HALCON installation directory (Linux) or within the common application data folder (Windows). This file is read by HALCON during the initialization phase automatically. write_aop_knowledgeWriteAopKnowledge adds attributes to the knowledge like the host name and information about HALCON architecture, variant, version, and revision. This enables HALCON to write aop knowledge sets of different machines or HALCON systems into the same file. Therefore, write_aop_knowledgeWriteAopKnowledge can control the updating of the files contents by a pair of values passed to GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value. Every entry in GenParamNamegenParamNamegen_param_name must have one corresponding, specifying entry in GenParamValuegenParamValuegen_param_value, meaning that the tuples passed to the parameters must have the same length. GenParamNamegenParamNamegen_param_name supports the values in following list, describing the possible applicable values for GenParamValuegenParamValuegen_param_value:

  • 'mode'"mode" sets the way how existing knowledge with same attributes would be updated in the file.

    • 'truncate'"truncate" for GenParamValuegenParamValuegen_param_value deletes the existing knowledge with matching attributes before the new information is added to file.

    • 'renew'"renew" overwrites existing knowledge and adds new one (default).

    • 'append'"append" keeps all existing operator information and just adds the knowledge not already contained.

    • 'nil'"nil" however refuses any update of the file but checks the user privileges, i.e., if read write access is available.

  • 'operator'"operator" denotes that the corresponding index value of GenParamValuegenParamValuegen_param_value contains an operator name. It delimits the storage on a dedicated operator set. Multiple definitions of operators are possible. By default, information of any operator possessing AOP optimization data is written.

  • 'iconic_type'"iconic_type" focuses on AOP information for a specific iconic type, specified by following values of GenParamValuegenParamValuegen_param_value: 'byte'"byte", 'uint2'"uint2", 'real'"real", 'int1'"int1", 'int2'"int2", 'int4'"int4", 'int8'"int8", 'direction'"direction", 'vector_field'"vector_field", 'cyclic'"cyclic", 'complex'"complex", 'region'"region", 'xld'"xld". Multiple definitions of iconic types are possible.

Execution information🔗

Execution information
  • Multithreading type: exclusive (runs in parallel only with independent operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

FileNamefileNamefile_name (input_control) filename.write → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of knowledge file

Default: ''""

GenParamNamegenParamNamegen_param_name (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Parameter name

Default: 'none'"none"
Suggested values: 'mode', 'operator', 'iconic_type'"mode", "operator", "iconic_type"

GenParamValuegenParamValuegen_param_value (input_control) string(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[str, int, float]]Htuple (char* / Hlong / double)

Parameter value

Number of elements: GenParamName == GenParamValue
Default: 'none'"none"
Suggested values: 'truncate', 'renew', 'append'"truncate", "renew", "append"

Result🔗

write_aop_knowledgeWriteAopKnowledge returns 2 (H_MSG_TRUE) if all parameters are correct and the file could be read. If necessary, an exception is raised.

Module🔗

Foundation