... | ... | @@ -12,24 +12,24 @@ |
|
|
```
|
|
|
|
|
|
2. <strong>Header files include guards:</strong> all header files must have include guards to prevent name conflict. These are place right after the license and at the end of the file. The adopted format includes the relative path in ADIOS. For example, file _adios2/engine/bp/BPFileWriter.h_ will contain the following include guards:
|
|
|
```cpp
|
|
|
#ifndef ADIOS2_ENGINE_BP_BPFILEWRITER_H_
|
|
|
#define ADIOS2_ENGINE_BP_BPFILEWRITER_H_<br><br>
|
|
|
//File contents...
|
|
|
...
|
|
|
```cpp
|
|
|
#ifndef ADIOS2_ENGINE_BP_BPFILEWRITER_H_
|
|
|
#define ADIOS2_ENGINE_BP_BPFILEWRITER_H_<br><br>
|
|
|
//File contents...
|
|
|
...
|
|
|
|
|
|
//End of file
|
|
|
#endif // end of ADIOS2_ENGINE_BP_BPFILEWRITER_H_
|
|
|
```
|
|
|
//End of file
|
|
|
#endif // end of ADIOS2_ENGINE_BP_BPFILEWRITER_H_
|
|
|
```
|
|
|
|
|
|
3. <strong>Document included headers</strong>: list header components used in the code if header is not self-explanatory. Example:
|
|
|
```cpp
|
|
|
//vector and map are self-explanatory, no comment needed
|
|
|
#include <vector>
|
|
|
#include <utility> //std::pair
|
|
|
#include <stdexcept>; //std::invalid_argument
|
|
|
#include <map>;
|
|
|
```
|
|
|
```cpp
|
|
|
//vector and map are self-explanatory, no comment needed
|
|
|
#include <vector>
|
|
|
#include <utility> //std::pair
|
|
|
#include <stdexcept>; //std::invalid_argument
|
|
|
#include <map>;
|
|
|
```
|
|
|
|
|
|
4. <strong>Header includes organization</strong>: use the following ordering for the included headers:
|
|
|
Example for file ClassName.cpp:
|
... | ... | @@ -40,24 +40,24 @@ Example for file ClassName.cpp: |
|
|
4. External libraries: ```zfp.h, bzip2.h```
|
|
|
5. ADIOS2 headers: ```adios2/ADIOSTypes.h, adios2/ADIOSMPI.h```
|
|
|
|
|
|
```cpp
|
|
|
#include "ClassName.h"
|
|
|
```cpp
|
|
|
#include "ClassName.h"
|
|
|
|
|
|
#include <unistd.h> //key_t
|
|
|
#include <sys/ipc.h> //ftok
|
|
|
#include <unistd.h> //key_t
|
|
|
#include <sys/ipc.h> //ftok
|
|
|
|
|
|
#include <map>
|
|
|
#include <thread>
|
|
|
#include <vector>
|
|
|
#include <map>
|
|
|
#include <thread>
|
|
|
#include <vector>
|
|
|
|
|
|
#ifdef ADIOS_USE_ZFP
|
|
|
#include <zfp.h>
|
|
|
#endif
|
|
|
#ifdef ADIOS_USE_ZFP
|
|
|
#include <zfp.h>
|
|
|
#endif
|
|
|
|
|
|
#ifdef ADIOS_USE_BZip2
|
|
|
#include <bzip2.h>
|
|
|
#endif
|
|
|
#ifdef ADIOS_USE_BZip2
|
|
|
#include <bzip2.h>
|
|
|
#endif
|
|
|
|
|
|
#include "adios2/ADIOSTypes.h"
|
|
|
#include "adios2/ADIOSMPI.h"
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
#include "adios2/ADIOSTypes.h"
|
|
|
#include "adios2/ADIOSMPI.h"
|
|
|
``` |
|
|
\ No newline at end of file |