Struct ProcessingContext

Struct Documentation

struct ProcessingContext

Complete context for thread-safe file processing operations.

The ProcessingContext encapsulates all resources, parameters, and state needed for safe multi-threaded processing of Gaussian log files. It provides shared access to resource managers and maintains processing parameters consistent across all worker threads.

Design

  • Immutable after construction to prevent race conditions

  • Shared resource managers for coordinated resource usage

  • Integration with job scheduler resource limits

  • Parameter validation and safe defaults

Management

The context owns shared resource managers that coordinate access to:

Note

All resource managers are thread-safe and can be accessed simultaneously from multiple processing threads

Public Functions

inline ProcessingContext(double temp, int C, bool use_temp, unsigned int thread_count = 1, const std::string &ext = ".log", size_t max_file_mb = DEFAULT_MAX_FILE_SIZE_MB, const JobResources &job_res = JobResources{})

Constructor with parameter validation and resource setup.

Creates a complete processing context with:

  • Optimally configured resource managers

  • Validated processing parameters

  • Integration with job scheduler limits

  • Thread-safe resource sharing setup

Note

Memory limits are automatically calculated based on thread count and available system resources

Parameters:
  • temp – Base temperature for thermodynamic calculations (K)

  • C – Concentration for phase corrections (mM)

  • use_temp – Whether to use temperatures from input files

  • thread_count – Number of processing threads to use

  • ext – File extension to process (default: “.log”)

  • max_file_mb – Maximum individual file size in MB (default: 100)

  • job_res – Job scheduler resource information

Public Members

std::shared_ptr<MemoryMonitor> memory_monitor

Shared memory usage monitor.

std::shared_ptr<FileHandleManager> file_manager

Shared file handle manager.

std::shared_ptr<ThreadSafeErrorCollector> error_collector

Shared error collector.

double base_temp

Base temperature for calculations (K)

int concentration

Concentration for phase corrections (mM)

bool use_input_temp

Whether to use temperature from input files.

std::string extension

File extension to process.

unsigned int requested_threads

Number of requested processing threads.

size_t max_file_size_mb

Maximum individual file size in MB.

JobResources job_resources

Job scheduler resource information.