|
From: <569...@qq...> - 2022-11-22 00:24:40
|
Dear All,
I have a memory leak with the following example. I don't know why, please help me.
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
Code:
int main()
{
int a = 0;
int b = 0;
int j = 0;
for (j = 0; j < 3;j++)
{
#pragma omp parallel
#pragma omp single
{
#pragma omp task depend(out: b)
{
printf("task 1=%d\n", a);
}
#pragma omp task depend(in: b)
{
printf("task 2=%d\n", a);
}
}
}
return 0;
}
error msg: 136 bytes in 1 bloacks are definitely lost in loss record 3 of 8
by 0x4008CB: main.-omp_fn.0(test.c: 19)
Best
Gang Chen
Sichuan University |