小编con*_*onk的帖子

OpenMP:当代码以普通用户身份运行时,“libgomp:线程创建失败:资源暂时不可用”

当我运行以下示例代码时:

#include "stdio.h"
#include <omp.h>

int main(int argc, char *argv[])
{
  #pragma omp parallel
  {
   int NCPU,tid,NPR,NTHR;
    /* get the total number of CPUs/cores available for OpenMP */
   NCPU = omp_get_num_procs();
   /* get the current thread ID in the parallel region */
   tid = omp_get_thread_num();
   /* get the total number of threads available in this parallel region */
   NPR = omp_get_num_threads();
   /* get the total number of threads requested */
   NTHR = omp_get_max_threads();
   /* only execute this on the master …
Run Code Online (Sandbox Code Playgroud)

c linux gcc openmp libgomp

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

c ×1

gcc ×1

libgomp ×1

linux ×1

openmp ×1