Geant4-11
Variables
geant4_check_module_cycles Namespace Reference

Variables

 action
 
dictionary adjList = {}
 
 args = parser.parse_args()
 
string cycle = " <- ".join(err.args[1])
 
 file
 
 help
 
 metavar
 
 nodes = line.rstrip("\n").split(" ")
 
 parser
 
 required
 
 ts = graphlib.TopologicalSorter(adjList)
 

Detailed Description

Check Geant4's module dependency graph for cycles

Geant4 organises source code into "Modules", with each Module being a
directory containing headers and sources in `include/` and `src/`
subdirectories respectively. One or more Modules are grouped/compiled
into the actual libraries.

CMake will raise errors if there are circular dependencies between
shared libraries (cycles are allowed between static libraries). However,
CMake cannot detect cycles between Modules directly, are these are a
Geant4 construct. Whilst cycles between modules that get added to the
same library are technically o.k., they still indicate either:

- A bad design/organisation of code
- A mistake in the declared dependencies for a module(s)

To help developers and CI pick module cycles, Geant4's CMake scripts
write out the declared module dependencies in a text file as an Adjacency
List graph. This comprises one line per module, with the first column
being the module name, and any remaining columns being the modules the
first one "depends on", i.e. uses code from.

This program reads that file and uses Python's graphlib module to try
topologically sorting this graph. Failure to sort indicates a cycle, and
this will be printed to stdout and a non-zero return code emitted on exit.

Variable Documentation

◆ action

geant4_check_module_cycles.action

◆ adjList

dictionary geant4_check_module_cycles.adjList = {}

Definition at line 56 of file geant4_check_module_cycles.py.

◆ args

geant4_check_module_cycles.args = parser.parse_args()

Definition at line 52 of file geant4_check_module_cycles.py.

◆ cycle

string geant4_check_module_cycles.cycle = " <- ".join(err.args[1])

◆ file

geant4_check_module_cycles.file

Definition at line 92 of file geant4_check_module_cycles.py.

Referenced by G4UIQt.AddViewerTabFromFile(), G4ParticleHPJENDLHEData.BuildPhysicsTable(), G4IonStoppingData.BuildPhysicsVector(), CLHEP::HepRandomEngine.checkFile(), G4Hdf5FileManager.CloseFileImpl(), G4RootFileManager.CloseFileImpl(), G4CsvFileManager.CloseFileImpl(), G4XmlFileManager.CloseFileImpl(), G4Hdf5FileManager.CreateDirectory(), G4CsvFileManager.CreateFileImpl(), G4Hdf5FileManager.CreateFileImpl(), G4RootFileManager.CreateFileImpl(), G4XmlFileManager.CreateFileImpl(), G4OpenInventorXtExaminerViewer.createNewVPFileCB(), G4Hdf5FileManager.CreateNtupleFile(), G4RootFileManager.CreateNtupleFile(), G4RootPNtupleManager.CreateNtupleFromMain(), G4PersistencyCenter.CurrentObject(), G4FileUtilities.DeleteFile(), G4FileUtilities.FileExists(), G4PixeShellDataSet.FullFileName(), G4IsotopeMagneticMomentTable.G4IsotopeMagneticMomentTable(), G4LEPTSDiffXS.G4LEPTSDiffXS(), G4LEPTSElossDistr.G4LEPTSElossDistr(), G4ParticleHPNames.GetName(), gzbuffer(), gzclearerr(), gzclose(), gzclose_r(), gzclose_w(), gzdirect(), gzeof(), gzerror(), gzflush(), gzfread(), gzfwrite(), gzgetc(), gzgetc_(), gzgets(), gzoffset(), gzoffset64(), gzprintf(), gzputc(), gzputs(), gzread(), gzrewind(), gzseek(), gzseek64(), gzsetparams(), gztell(), gztell64(), gzungetc(), gzwrite(), G4LivermoreComptonModel.Initialise(), G4LivermorePolarizedComptonModel.Initialise(), G4LowEPComptonModel.Initialise(), G4LowEPPolarizedComptonModel.Initialise(), G4DopplerProfile.LoadBiggsP(), G4eIonisationParameters.LoadData(), G4VCrossSectionHandler.LoadData(), G4ShellData.LoadData(), G4PixeShellDataSet.LoadData(), G4ShellEMDataSet.LoadData(), G4AugerData.LoadData(), G4FluoData.LoadData(), G4RadioactiveDecay.LoadDecayTable(), G4VCrossSectionHandler.LoadNonLogData(), G4ShellEMDataSet.LoadNonLogData(), G4DopplerProfile.LoadProfile(), G4OpenInventorXtExaminerViewer.loadRefCoordsCB(), G4OpenInventorXtExaminerViewer.loadSceneGraphCB(), MCGIDI_misc_pointerToAttributeIfAllOk(), MCGIDI_misc_pointerToTOMAttributeIfAllOk(), MCGIDI_misc_setMessageError_Element(), G4Hdf5RFileManager.OpenDirectory(), G4RootRFileManager.OpenRFile(), PoPs_particleIndex_smr(), G4PersistencyCenter.PrintAll(), G4ParticleHPJENDLHEData.readAFile(), G4VDNAModel.ReadAndSaveCSFile(), G4ParticleHPThermalScattering.readAnE_isoAng(), G4ParticleHPThermalScattering.readAnE_P_E_isoAng(), G4PenelopeBremsstrahlungAngular.ReadDataFile(), G4PenelopeGammaConversionModel.ReadDataFile(), G4PenelopeBremsstrahlungFS.ReadDataFile(), G4PenelopePhotoElectricModel.ReadDataFile(), G4PenelopeRayleighModel.ReadDataFile(), G4PenelopeRayleighModelMI.ReadDataFile(), G4DNAPTBIonisationModel.ReadDiffCSFile(), G4DNAPTBElasticModel.ReadDiffCSFile(), G4PenelopeOscillatorManager.ReadElementData(), G4PenelopeRayleighModelMI.ReadMolInterferenceData(), G4OpenGLQtViewer.removeTempFolder(), G4PersistencyManager.Retrieve(), G4ShellEMDataSet.SaveData(), G4OpenInventorXtExaminerViewer.saveRefCoordsCB(), G4OpenInventorXtExaminerViewer.saveSceneGraphCB(), G4PersistencyCenter.SetHepMCObjyReaderFile(), G4OpenGLQtViewer.setSaveFileName(), smr_allocateCopyString(), smr_allocateCopyStringN(), smr_malloc(), smr_realloc(), smr_setAllocationFailure(), smr_setReport(), smr_setReportError(), smr_setReportInfo(), smr_setReportWarning(), smr_vsetReportError(), smr_vsetReportInfo(), smr_vsetReportWarning(), G4PersistencyManager.Store(), G4OpenInventorXtExaminerViewer.viewPtFileSelectedCB(), and G4RootFileManager.WriteFileImpl().

◆ help

geant4_check_module_cycles.help

Definition at line 44 of file geant4_check_module_cycles.py.

◆ metavar

geant4_check_module_cycles.metavar

Definition at line 43 of file geant4_check_module_cycles.py.

◆ nodes

geant4_check_module_cycles.nodes = line.rstrip("\n").split(" ")

◆ parser

geant4_check_module_cycles.parser

◆ required

geant4_check_module_cycles.required

◆ ts

geant4_check_module_cycles.ts = graphlib.TopologicalSorter(adjList)