uwhpsc-2016 / homework4

Homework #4
0 stars 1 forks source link

ukt necessity #10

Open anders34 opened 8 years ago

anders34 commented 8 years ago

I'm a little confused about in heat.c, why we have ukt. If we already have uk, why do we need a duplicate of it at ukt.

anders34 commented 8 years ago

Because uk is a private variable to each thread/process, right? So we shouldn't need to make ukt...

swcarmer commented 8 years ago

I agree, we could use the uk pointer passed in as our ukt, which negates the need for the array copies as well.

quantheory commented 8 years ago

It's true that ukt is unnecessary in this case. If there were two separate "input" and "output" pointers, and you weren't allowed to change the "input" array, then it would be necessary to make a copy. But in this case, it's admittedly an extra step.