OpenMP lets you easily parallelize code without doing a lot of refactoring. For example, you don't need to move a loop into a function to parallelize it, you just wrap it in OpenMP directives and let the compiler do its magic. It also abstracts away system details, making the program portable.
It's not accurate to call it an API, though. An API involves functions calls. That's not what OpenMP is. An OpenMP implementation is an integral part of the compiler, just like the preprocessor. You don't make any function calls in particular; instead, you give the compiler instructions that it will use to generate code for you.
Do you really need one of these API's though? Can you not do it manually? |
Depends on what you mean by "manually". If you mean "call system functions to start threads", then yes, you can, but you lose portability. If you mean "start threads without using any API at all", then no and yes. No, you can't start real threads without interacting at some level with the OS (without involves using an API, at the very least the system's), but yes, you can do something very roundabout, complicated, and rather ineffective that will make a program believe it's running in a threaded environment without providing any of the benefits.