Skip to content

Turbsim uses up all available threads when not compiled with OpenMP #3018

@mayankchetan

Description

@mayankchetan

Bug description

When running turbsim on a system that has OpenMP ( or OpenMP loaded in case of HPC), but is not compiled with -DOPENMP=ON, turbsim runs on all available threads. This can bog down the system, or in some cases crashes HPC nodes.

Current workaround is to use export OMP_NUM_THREADS=1, but this can affect other processes that rely on OpenMP like OLAF.

To Reproduce

Steps to reproduce the behavior:

  1. Compile with -DOPENMP=OFF
  2. have or load OpenMP on system.
  3. Run turbsim with r-test/glue-codes/openfast/5MW_Baseline/Wind/90m_12mps_twr.inp
  4. Use top/htop to view resources used by turbsim.
  5. Also see ####### CPU seconds used. after turbsim completes running.

Expected behavior

turbsim does not use all threads when compiled with -DOPENMP=OFF & system has/loaded OpenMP.

Screenshots, if applicable

  1. When OpenMP is not loaded on an HPC node:
Image
 **************************************************************************************************
 TurbSim

 Copyright (C) 2025 National Renewable Energy Laboratory
 Copyright (C) 2025 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

  Running TurbSim (from OpenFAST-v4.1.2)


  Reading the input file "90m_12mps_twr.inp".
  Calculating the spectral and transfer function matrices:
     u-component matrices (IEC coherence method)
     v-component matrices (identity coherence)
     w-component matrices (identity coherence)
  Generating time series for all points:
     u-component
     v-component
     w-component
  Computing hub-height statistics
  Writing statistics to summary file
  Generating AeroDyn binary time-series file "90m_12mps_twr.bts"

  Processing complete.  38.71 CPU seconds used.

  TurbSim terminated normally.
  1. When OpenMP is loaded on an HPC node:
Image
 **************************************************************************************************
 TurbSim

 Copyright (C) 2025 National Renewable Energy Laboratory
 Copyright (C) 2025 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

  Running TurbSim (from OpenFAST-v4.1.2)


  Reading the input file "90m_12mps_twr.inp".
  Calculating the spectral and transfer function matrices:
     u-component matrices (IEC coherence method)
     v-component matrices (identity coherence)
     w-component matrices (identity coherence)
  Generating time series for all points:
     u-component
     v-component
     w-component
  Computing hub-height statistics
  Writing statistics to summary file
  Generating AeroDyn binary time-series file "90m_12mps_twr.bts"

  Processing complete.  4963.4 CPU seconds used.

  TurbSim terminated normally.
  1. When OpenMP is loaded on an HPC node & we set OMP_NUM_THREADS using export OMP_NUM_THREADS=1:
Image
 **************************************************************************************************
 TurbSim

 Copyright (C) 2025 National Renewable Energy Laboratory
 Copyright (C) 2025 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

  Running TurbSim (from OpenFAST-v4.1.2)


  Reading the input file "90m_12mps_twr.inp".
  Calculating the spectral and transfer function matrices:
     u-component matrices (IEC coherence method)
     v-component matrices (identity coherence)
     w-component matrices (identity coherence)
  Generating time series for all points:
     u-component
     v-component
     w-component
  Computing hub-height statistics
  Writing statistics to summary file
  Generating AeroDyn binary time-series file "90m_12mps_twr.bts"

  Processing complete.  202.22 CPU seconds used.

  TurbSim terminated normally.

OpenFAST Version

 **************************************************************************************************
 OpenFAST

 Copyright (C) 2025 National Renewable Energy Laboratory
 Copyright (C) 2025 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

 OpenFAST-v4.1.2
 Compile Info:
  - Compiler: GCC version 14.3.0
  - Architecture: 64 bit
  - Precision: single
  - OpenMP: No
  - Date: Sep 24 2025
  - Time: 02:13:53
 Execution Info:
  - Date: 10/01/2025
  - Time: 11:26:53-0600

System Information (please complete the following information):

  • OS: Red Hat Enterprise Linux 8.8 (Ootpa) (NREL, Kestrel)
  • Compiler: GCC version 14.3.0
  • Compiler settings: -DOPENMP=OFF

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions