This patch adds a new device plugin that is able to distribute work to a cluster using MPI as its underlying communication layer. The plugin is entirely based on the paper "The OpenMP Cluster Programming Model" (The OpenMP Cluster Programming Model).
Thanks for putting this up for review. It's a lot and I think we should start with a presentation in our weekly meeting. I also would like you to take a look at the new plugin infrastructure that is under review. My hope would be that we target that one right away and avoid lots of duplication. Some of the features you build here might be useful to be generalized anyway.
One initial question I have is about the "main" and "on device" stuff, but I'll ask it for sure in our meeting. Some drive by comments below.
We certainly want to rename this.
I would recommend against custom "assert" macros, the && notation is literally not more to type. That said, assert(0) is not helpful. Either make it an llvm_unreachable or a printf + __builtin_trap.
Bottom of the list, please.
Some of these changes seam unrelated and should be split of. E.g., calling deinit if present seems reasonable for all plugins.