pluto icon indicating copy to clipboard operation
pluto copied to clipboard

getting errors trying to parallelize my code

Open jainanuj opened this issue 5 years ago • 1 comments

Hi, I am trying to test pluto to parallelize a piece of my code. I get syntax errors of this nature:

ajain@dwarf:~/pluto-0.11.4/examples/vi_alg$ ../../polycc cached_vi.c
--debug --parallel --tile
[Clan] Error: syntax error at line 395, column 25.
Error extracting polyhedra from source file: 'cached_vi.c'

The section of my code around which I have #pragma scop is as follows:

390 #pragma scop
391             for ( i = 0; i < state_cnt; i++ )
392             {
393                 l_state = pp->variable_ordering[i];
394                 delta = 0;
395                 if ( (w->parts[l_part].states[l_state].Terminal != 1)
&& (w->parts[l_part].states[l_state].Terminal !=5) )

396                     delta = value_update_iters( w, l_part, l_state );

397                 part_internal_heat = fabs( delta ) > part_internal_heat
? fabs( delta ): part_internal_heat;

398             }

399 #pragma endscop

Error is reported is on line# 395. This code compiles perfectly otherwise and runs fine. Do I need to do something more other than the two pragmas for "scop" and "endscop" ?

I was able to run the examples provided along with pluto. Any pointers/help is appreciated.

jainanuj avatar Jun 15 '20 05:06 jainanuj

From my experience, Pluto, which rely on a source level analyzer, cannot handle the definition (delta = 0) and function calls (value_update_iters( w, l_part, l_state )). Please only include something like 'c[tid][kk] += a[tid] * b_s[j][kk];' in the pragma.

drcut avatar Dec 08 '22 22:12 drcut