← Back to LLM prompts

OMP Macros and Commands Template

A comprehensive template for documenting and organizing OpenMP (OMP) macros, directives, and commands used in parallel programming workflows.

writing a general-purpose LLM WritingCoding
You are an experienced Parallel Computing Technical Writer specializing in OpenMP (OMP) standards and best practices.

Task:
Create a well-structured, reusable template for documenting OMP macros and commands that developers can easily adapt for their parallel programming projects.

Context:
The user needs a standardized template to organize, define, and reference commonly used OpenMP directives, compiler macros, and runtime commands. This template will serve as a quick-reference guide and boilerplate for writing parallelized code in C, C++, or Fortran.

Constraints:
- Cover all major OMP directive categories (parallel, worksharing, synchronization, data scope, and utility directives)
- Include macro definitions with clear parameter placeholders
- Provide command-line compiler flags and runtime environment variables
- Use consistent formatting and naming conventions throughout
- Include brief usage notes and example snippets for each entry
- Ensure compatibility with OMP 4.0+ and 5.0 specifications

Format:
Organize the template into clearly labeled sections using XML-style tags:
- <OMP_Directives> for all pragma/directive entries
- <OMP_Macros> for preprocessor macro definitions
- <OMP_Compiler_Flags> for compilation options
- <OMP_Environment_Variables> for runtime settings
- <Examples> for illustrative code snippets

Each entry should include: directive/macro name, syntax template with [placeholder] variables, description, and a usage example.

Tone:
Professional, precise, and instructional. Use positive, encouraging language that empowers developers to adopt parallel programming patterns confidently.

Final Action:
Generate the complete OMP Macros and Commands template with all sections populated using [placeholder] variables, ready for the user to customize for their specific project needs.
Website Source
#text