Skip to content

Commit

Permalink
Standardize guards on header files. Add some missing ones.
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchwiebert committed Sep 21, 2023
1 parent 8d16bf0 commit 411ed83
Show file tree
Hide file tree
Showing 39 changed files with 106 additions and 72 deletions.
8 changes: 6 additions & 2 deletions lib/AlphaNum.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef ALPHA_NUM_H
#define ALPHA_NUM_H

#include "BasicTypes.h" // uint
#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -40,4 +42,6 @@ class AlphaNum {
uint string2Uint(std::string stringSuffix);
struct icompare_char;
struct compare;
};
};

#endif /*ALPHA_NUM_H*/
6 changes: 5 additions & 1 deletion lib/FloydWarshallCycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef FLOYD_WARSHALL_CYCLE_H
#define FLOYD_WARSHALL_CYCLE_H

#include <algorithm>
#include <cassert>
#include <vector>
Expand Down Expand Up @@ -86,3 +88,5 @@ class FloydWarshallCycle {
std::vector<int> returnCombinedSet(const std::vector<int> &first,
const std::vector<int> &second);
};

#endif /*FLOYD_WARSHALL_CYCLE_H*/
6 changes: 3 additions & 3 deletions src/BondAdjacencyList.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ along with this program, also can be found at

/* Courtesy of https://www.softwaretestinghelp.com/graph-implementation-cpp/ */

#ifndef BONDADJACENCYLIST_H
#define BONDADJACENCYLIST_H
#ifndef BOND_ADJACENCY_LIST_H
#define BOND_ADJACENCY_LIST_H

#include <limits.h>

Expand Down Expand Up @@ -48,4 +48,4 @@ class BondAdjacencyList {

graphEdge *edges;
};
#endif
#endif /*BOND_ADJACENCY_LIST_H*/
2 changes: 1 addition & 1 deletion src/CBMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CBMC *MakeCBMC(System &sys, const Forcefield &ff, const MoleculeKind &kind,
const Setup &set);
} // namespace cbmc

#endif
#endif /*CBMC_H*/
6 changes: 3 additions & 3 deletions src/CalculateEnergy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef CALCULATEENERGY_H
#define CALCULATEENERGY_H
#ifndef CALCULATE_ENERGY_H
#define CALCULATE_ENERGY_H

#include <vector>

Expand Down Expand Up @@ -294,4 +294,4 @@ class CalculateEnergy {
const CellList &cellList;
};

#endif /*ENERGY_H*/
#endif /*CALCULATE_ENERGY_H*/
2 changes: 1 addition & 1 deletion src/CellList.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ inline void CellList::Pairs::Next() {
// skip over doubles
} while (First() >= Second());
}
#endif
#endif /*CELLLIST_H*/
2 changes: 1 addition & 1 deletion src/Checkpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ class Checkpoint {
}
};

#endif
#endif /*CHECKPOINT_H*/
2 changes: 1 addition & 1 deletion src/CheckpointOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ class CheckpointOutput : public OutputableBase {
ulong stepsPerCheckpoint;
};

#endif
#endif /*CHECKPOINT_OUTPUT_H*/
2 changes: 1 addition & 1 deletion src/CheckpointSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ class CheckpointSetup {
friend class CheckpointOutput;
};

#endif
#endif /*CHECKPOINT_SETUP_H*/
6 changes: 3 additions & 3 deletions src/ConfigSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef CONFIGSETUP_H
#define CONFIGSETUP_H
#ifndef CONFIG_SETUP_H
#define CONFIG_SETUP_H

#include <iostream> //for cerr, cout;
#include <map> //for function handle storage.
Expand Down Expand Up @@ -918,4 +918,4 @@ class ConfigSetup {
InputFileReader reader;
};

#endif
#endif /*CONFIG_SETUP_H*/
2 changes: 1 addition & 1 deletion src/CoordinateSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ struct CoordinateSetup {
void SetCOM(const MolSetupData &molData);
}

#endif
#endif /*COORDINATESETUP_H*/
2 changes: 1 addition & 1 deletion src/DCDlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ void NAMD_bug(const char *err_msg);
int NAMD_file_exists(const char *filename);
void NAMD_backup_file(const char *filename, const char *extension);

#endif /* ! DCDLIB_H */
#endif /*DCDLIB_H*/
2 changes: 1 addition & 1 deletion src/EnergyTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,4 @@ inline std::ostream &operator<<(std::ostream &out, Energy &en) {
}
#endif

#endif
#endif /*ENERGYTYPES_H*/
6 changes: 3 additions & 3 deletions src/EwaldCached.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef EWALDCACHED_H
#define EWALDCACHED_H
#ifndef EWALD_CACHED_H
#define EWALD_CACHED_H

#include "Ewald.h"

Expand Down Expand Up @@ -81,4 +81,4 @@ class EwaldCached : public Ewald {
#endif
};

#endif /*EWALDCACHED_H*/
#endif /*EWALD_CACHED_H*/
6 changes: 3 additions & 3 deletions src/ExtendedSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef EXTENDED_SYSTEM
#define EXTENDED_SYSTEM
#ifndef EXTENDED_SYSTEM_H
#define EXTENDED_SYSTEM_H

#include <vector>

Expand Down Expand Up @@ -83,4 +83,4 @@ class ExtendedSystem {
std::vector<XYZ> binaryVeloc;
};

#endif /*EXTENDED_SYSTEM*/
#endif /*EXTENDED_SYSTEM_H*/
6 changes: 3 additions & 3 deletions src/ExtendedSystemOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef DCD_OUTPUT_H
#define DCD_OUTPUT_H
#ifndef EXTENDED_SYSTEM_OUTPUT_H
#define EXTENDED_SYSTEM_OUTPUT_H

#include <cstring>
#include <iostream>
Expand Down Expand Up @@ -124,4 +124,4 @@ struct ExtendedSystemOutput : OutputableBase {
Writer xscFile[BOX_TOTAL];
};

#endif /*DCD_OUTPUT_H*/
#endif /*EXTENDED_SYSTEM_OUTPUT_H*/
6 changes: 3 additions & 3 deletions src/FreeEnergyOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef FREEENERGY_OUTPUT_H
#define FREEENERGY_OUTPUT_H
#ifndef FREE_ENERGY_OUTPUT_H
#define FREE_ENERGY_OUTPUT_H

#include <fstream>
#include <string>
Expand Down Expand Up @@ -59,4 +59,4 @@ struct FreeEnergyOutput : OutputableBase {
#endif
};

#endif /*HIST_OUTPUT_H*/
#endif /*FREE_ENERGY_OUTPUT_H*/
6 changes: 3 additions & 3 deletions src/FxdWidthWrtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef FXD_WIDTH_WRTR
#define FXD_WIDTH_WRTR
#ifndef FXD_WIDTH_WRTR_H
#define FXD_WIDTH_WRTR_H

struct FxdWidthWrtr : Writer {
FxdWidthWrtr(std::string const &nm, std::string const &als, const bool crit,
Expand All @@ -23,4 +23,4 @@ struct FxdWidthWrtr : Writer {
// Align left by default, but accept right alignment if necessary.
}

#endif /*FXD_WIDTH_WRTR*/
#endif /*FXD_WIDTH_WRTR_H*/
5 changes: 5 additions & 0 deletions src/GOMCEventsProfileDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef GOMC_EVENTS_PROFILE_DEF_H
#define GOMC_EVENTS_PROFILE_DEF_H

GOMC_PROFILE_EVENT(INITIALIZE, "initialization")
GOMC_PROFILE_EVENT(MC_RUN, "MC_run")
GOMC_PROFILE_EVENT(DESTRUCTION, "destruction")
Expand Down Expand Up @@ -152,3 +155,5 @@ GOMC_PROFILE_EVENT(DUMMY_EVENT19, "Dummy Event19")
GOMC_PROFILE_EVENT(DUMMY_EVENT20, "Dummy Event20")
GOMC_PROFILE_EVENT(DUMMY_EVENT21, "Dummy Event21")
GOMC_PROFILE_EVENT(DUMMY_EVENT22, "Dummy Event22")

#endif /*GOMC_EVENTS_PROFILE_DEF_H*/
5 changes: 4 additions & 1 deletion src/GPU/CUDAMemoryManager.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef CUDA_MEMORY_MANAGER_H
#define CUDA_MEMORY_MANAGER_H

#ifdef GOMC_CUDA
#include <cuda.h>
#include <cuda_runtime.h>
Expand All @@ -27,3 +29,4 @@ private:
};

#endif
#endif /*CUDA_MEMORY_MANAGER_H*/
5 changes: 4 additions & 1 deletion src/GPU/CalculateEnergyCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef CALCULATE_ENERGY_CUDA_KERNEL_H
#define CALCULATE_ENERGY_CUDA_KERNEL_H

#ifdef GOMC_CUDA
#include <cuda.h>
#include <cuda_runtime.h>
Expand Down Expand Up @@ -206,3 +208,4 @@ __device__ double CalcEnSwitchGPUNoLambda(double distSq, int index,
double gpu_rCut, double gpu_rOn);

#endif /*GOMC_CUDA*/
#endif /*CALCULATE_ENERGY_CUDA_KERNEL_H*/
6 changes: 3 additions & 3 deletions src/GPU/CalculateEwaldCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef CALCULATE_EWALD_CUDA_KERNEL
#define CALCULATE_EWALD_CUDA_KERNEL
#ifndef CALCULATE_EWALD_CUDA_KERNEL_H
#define CALCULATE_EWALD_CUDA_KERNEL_H

#ifdef GOMC_CUDA
#include <cuda.h>
Expand Down Expand Up @@ -190,4 +190,4 @@ __global__ void BoxReciprocalGPU(double *gpu_prefact,
int imageSize);

#endif /*GOMC_CUDA*/
#endif /*CALCULATE_EWALD_CUDA_KERNEL*/
#endif /*CALCULATE_EWALD_CUDA_KERNEL_H*/
6 changes: 3 additions & 3 deletions src/GPU/CalculateForceCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef CALCULATE_FORCE_CUDA_KERNEL
#define CALCULATE_FORCE_CUDA_KERNEL
#ifndef CALCULATE_FORCE_CUDA_KERNEL_H
#define CALCULATE_FORCE_CUDA_KERNEL_H

#ifdef GOMC_CUDA
#include <vector>
Expand Down Expand Up @@ -403,4 +403,4 @@ __device__ inline double CalcCoulombForceGPU(double distSq, double qi_qj,


#endif /*GOMC_CUDA*/
#endif /*CALCULATE_FORCE_CUDA_KERNEL*/
#endif /*CALCULATE_FORCE_CUDA_KERNEL_H*/
5 changes: 4 additions & 1 deletion src/GPU/CalculateMinImageCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef CALCULATE_MIN_IMAGE_CUDA_KERNEL_H
#define CALCULATE_MIN_IMAGE_CUDA_KERNEL_H

#ifdef GOMC_CUDA

#include "ConstantDefinitionsCUDAKernel.cuh"
Expand Down Expand Up @@ -278,3 +280,4 @@ static __inline__ __device__ double atomicAdd(double *address, double val) {
#endif

#endif /*GOMC_CUDA*/
#endif /*CALCULATE_MIN_IMAGE_CUDA_KERNEL_H*/
6 changes: 3 additions & 3 deletions src/GPU/ConstantDefinitionsCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#ifndef CONSTANT_DEFINITIONS_CUDA_KERNEL
#define CONSTANT_DEFINITIONS_CUDA_KERNEL
#ifndef CONSTANT_DEFINITIONS_CUDA_KERNEL_H
#define CONSTANT_DEFINITIONS_CUDA_KERNEL_H

#ifdef GOMC_CUDA
#include <cuda.h>
Expand Down Expand Up @@ -47,4 +47,4 @@ void DestroyExp6CUDAVars(VariablesCUDA *vars);
void DestroyCUDAVars(VariablesCUDA *vars);

#endif /*GOMC_CUDA*/
#endif /*CONSTANT_DEFINITIONS_CUDA_KERNEL*/
#endif /*CONSTANT_DEFINITIONS_CUDA_KERNEL_H*/
5 changes: 4 additions & 1 deletion src/GPU/TransformParticlesCUDAKernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef TRANSFORM_PARTICLES_CUDA_KERNEL_H
#define TRANSFORM_PARTICLES_CUDA_KERNEL_H

#ifdef GOMC_CUDA
#include "Random123/philox.h"
#include <vector>
Expand Down Expand Up @@ -95,3 +97,4 @@ __global__ void BrownianMotionTranslateKernel(
unsigned int key, ulong seed, double BETA);

#endif
#endif /*TRANSFORM_PARTICLES_CUDA_KERNEL_H*/
6 changes: 4 additions & 2 deletions src/GPU/VariablesCUDA.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Copyright (C) 2022 GOMC Group
A copy of the MIT License can be found in License.txt
along with this program, also can be found at <https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifdef GOMC_CUDA
#ifndef VARIABLES_CUDA_H
#define VARIABLES_CUDA_H

#ifdef GOMC_CUDA
#include <cuda.h>
#include <stdio.h>
#include <cuda_runtime.h>
Expand Down Expand Up @@ -135,3 +136,4 @@ public:
int *gpu_cellVector, *gpu_mapParticleToCell;
};
#endif
#endif /*VARIABLES_CUDA_H*/
2 changes: 1 addition & 1 deletion src/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ class SortedNonbond {
SubdividedArray subdiv;
};

#endif
#endif /*GEOMETRY_H*/
6 changes: 5 additions & 1 deletion src/InputFileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ A copy of the MIT License can be found in License.txt
along with this program, also can be found at
<https://opensource.org/licenses/MIT>.
********************************************************************************/
#pragma once
#ifndef INPUT_FILE_READER_H
#define INPUT_FILE_READER_H

#include <fstream>
#include <iostream>
#include <vector>
Expand All @@ -23,3 +25,5 @@ class InputFileReader {
InputFileReader(void);
~InputFileReader();
};

#endif /*INPUT_FILE_READER_H*/
Loading

0 comments on commit 411ed83

Please sign in to comment.