Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

why core dumped error occurs with openmp (C language)

I'm a starter for openmp. I wrote very very simple code like below. when I compile that code and implement ./a.out, 'Segmentation fault (core dumped)' occurs. Why core dumped in this simple code?

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

int main(void){

    #pragma omp parallel
    {printf("thread num %d: first hello world!
",omp_get_thread_num());
    printf("thread num %d; second hello world!
",omp_get_thread_num());
    }
    return 0;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...