|
| 1 | +# Contributing to Open MPI |
| 2 | + |
| 3 | +First off, thank you for taking the time to prepare a contribution to |
| 4 | +Open MPI! |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## Content |
| 9 | + |
| 10 | +We love getting contributions from anyone. But keep in mind that Open |
| 11 | +MPI is used in production environments all around the world. |
| 12 | + |
| 13 | +If you're contributing a small bug fix, awesome! |
| 14 | + |
| 15 | +If you're contributing a large new piece of functionality, that will |
| 16 | +be best viewed if you -- or someone, anyone -- is also stepping up to |
| 17 | +help maintain that functionality over time. We love new ideas and new |
| 18 | +features, but we do need to be realistic in what we can reliably test |
| 19 | +and deliver to our users. |
| 20 | + |
| 21 | +## Contributor's Declaration |
| 22 | + |
| 23 | +In order to ensure that we can keep distributing Open MPI under our |
| 24 | +[open source license](LICENSE), we need to ensure that all |
| 25 | +contributions are compatible with that license. |
| 26 | + |
| 27 | +To that end, we require that all Git commits contributed to Open MPI |
| 28 | +have a "Signed-off-by" token indicating that the commit author agrees |
| 29 | +with [Open MPI's Contributor's |
| 30 | +Declaration](https://github.com/open-mpi/ompi/wiki/Admistrative-rules#contributors-declaration). |
| 31 | + |
| 32 | +If you have not already done so, please ensure that: |
| 33 | + |
| 34 | +1. Every commit contains exactly the "Signed-off-by" token. You can |
| 35 | +add this token via `git commit -s`. |
| 36 | +1. The email address after "Signed-off-by" must match the Git commit |
| 37 | +email address. |
| 38 | + |
| 39 | +## Style |
| 40 | + |
| 41 | +There are a small number of style rules for Open MPI: |
| 42 | + |
| 43 | +1. For all code: |
| 44 | + * 4 space tabs. No more, no less. |
| 45 | + * No tab characters *at all*. 2 indentations are 8 spaces -- not a tab. |
| 46 | + * m4 code is a bit weird in terms of indentation: we don't have a |
| 47 | + good, consistent indentation style in our existing code. But |
| 48 | + still: no tab characters at all. |
| 49 | +1. For C code: |
| 50 | + * We prefer if all blocks are enclosed in `{}` (even 1-line |
| 51 | + blocks). |
| 52 | + * We prefer that if you are testing equality with a constant, put |
| 53 | + the constant on the *left* of the `==`. E.g., `if (NULL == |
| 54 | + ptr)`. |
| 55 | + * If there are no parameters to a C function, declare it with |
| 56 | + `(void)` (vs. `()`). |
| 57 | + |
| 58 | +That's about it! |
0 commit comments