Программы на C++. Форум разработчиков
-
Anonymous
Ошибка сегментации C++ при добавлении упорядоченного параллельного OMP для
Сообщение
Anonymous »
Приведенный ниже код дает сбой
Код: Выделить всё
terminate called after throwing an instance of 'std::__cxx11::basic_string'
Aborted (core dumped) ./a.out
при компиляции с помощью g++ -fopenmp
Код: Выделить всё
#include
#include
#include
void bla2(){
try{
throw std::string("bla2");
}catch(std::string x){
throw std::string("error ")+x;
}
}
void bla1(){
try{
std::vector y;
y.resize(10);
#pragma omp parallel for ordered schedule(static) num_threads(10)
for(int i=0;i0) throw x;
}catch(std::string x){
throw std::string("error ")+x;
}
}
int main(){
try{
bla1();
}catch(std::string x){
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79805874/c-segmentation-fault-when-throwing-in-ordered-omp-parallel-for[/url]
1761957954
Anonymous
Приведенный ниже код дает сбой
[code]terminate called after throwing an instance of 'std::__cxx11::basic_string'
Aborted (core dumped) ./a.out
[/code]
при компиляции с помощью g++ -fopenmp
[code]#include
#include
#include
void bla2(){
try{
throw std::string("bla2");
}catch(std::string x){
throw std::string("error ")+x;
}
}
void bla1(){
try{
std::vector y;
y.resize(10);
#pragma omp parallel for ordered schedule(static) num_threads(10)
for(int i=0;i0) throw x;
}catch(std::string x){
throw std::string("error ")+x;
}
}
int main(){
try{
bla1();
}catch(std::string x){
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79805874/c-segmentation-fault-when-throwing-in-ordered-omp-parallel-for[/url]