News for hackers. Stuff that matters.
Re:A 1000-processor chip powered by an AA battery (2016) by gpderetta on Monday February 15, 2021 @07:09AM (#26141976)
#pragma omp parallel for
Re:A 1000-processor chip powered by an AA battery (2016) by oblio on Monday February 15, 2021 @10:15AM (#26143453)
What's the operational cost of doing that?
Re:A 1000-processor chip powered by an AA battery (2016) by gpderetta on Monday February 15, 2021 @10:51AM (#26143822)
What do you mean exactly?

You need a C/C++/fortran compiler that supports openmp, which is most of the mainstream ones (I believe MSVC still only support an older standard, still more than enough for parallel for). Compilers that do not support openmp are supposed to ignore the pragma and the code will still run fine (although serially) and be fully compatible.

Other than that and possibly passing the correct command line flag, openmp is fairly low friction. A parallel for can provide significant speedup for embassingly parallel problems and these days it even support custom random access iterators in C++.

Of course it is more involved to express less embarrassingly parallelizable problems, but it is still doable.