PMs to you are bouncing because you have chosen a setting of not to be contactable by the board messenger. Check out.
Here is what I wantd to tell you.
Generally, You cant parallelize code that is cumulative.
For example:
for(int i=1; i<=N; i++)
a[i] = a[i] + a[i-1];
Things that accumulate across iterations dont lend them for parallel decomposition unless you find an alternate way out.
In your code, I dont know what is “j1” and “j2”.
But it looks like there is some cumulation for “i” and “k”. I am not very sure. I dont understand what is the instance.
A general way of doing this is : you could make a thread correspond to eac value of “j”. So, for each such “j” , you can go around and find the solution – but i am not sure if it will work - espeically if there is cumulation you generally cant