Package: availsim4
AvailSim4Availsim 4 is a software to predict reliability and availability of modern particle accelerators and the related
technical systems. It is based on a Monte Carlo Discrete Event Simulation algorithm and allows for advanced availability
and reliability statistics.RequirementsPython >=3.7, <4Installation(Optional:) Pre-requirement for Windows usersOne of the external dependencies requires Windows users to install Microsoft Visual C++ 14.0 or greater. It can be downloaded from "Microsoft C++ Build Tools":https://visualstudio.microsoft.com/visual-cpp-build-tools/, this requirement is needed to use the Quasi-Monte-Carlo algorithm. CERN's Windows users might prefer to use SWAN notebooks which are running on Linux machines.(Optional:) Visualization toolsTo generate a diagram of the architecture tree, AvailSim4 requires PyGraphviz package and Graphviz to be installed. More information and OS-specific installation guide of Graphviz:https://graphviz.org/download/and of PyGraphviz:https://pygraphviz.github.io/documentation/stable/install.html. General instructions:Linux: install Graphviz through your system package manager and then make sure to install PyGraphviz withpiporconda:apt-get update,apt-get install libgraphviz-dev,pip install pygraphviz.Windows: Graphviz installation wizard can be downloaded manually from the website. Then proceed to install PyGraphviz withpiporconda. Make sure thatdotprogram's plugins are configured by runningdot -ccommand in your environment. May also require Microsoft C++ Build Tools as a pre-requirement .MacOS: you can install Graphviz using Homebrew package manager by running commandbrew install graphvizand thenpip install pygraphviz.(Recommended:) GitlabClone the project fromhttps://gitlab.cern.ch/availsim4/availsim4core(Optional) create a dedicated virtual environment. In the context of CERN
follow :https://wikis.cern.ch/display/ACCPY/Getting+started+with+Acc-PyInstall the dependenciespip install -r requirements.txtorconda install --file requirements.txtFor CERN users, dependencies could be installed in a dedicated folder to ease the load on the file system when executing larger number of jobs in parallel:pip install --target=/afs/cern.ch/work/U/USERNAME/pipinstall -r requirements.txt(see user guide,Running the codesection)pypiAvailSim4 can also be installed via pip from PyPipip install availsim4UsageAvailSim4 input arguments are the following ones:availsim4.py[-h]--systemSYSTEM--simulationSIMULATION--output_folderOUTPUT_FOLDER[--sensitivity_analysisSENSITIVITYANALYSIS][--HTCondor][--HTCondor_extra_argumentOPTIONAL_EXTRA_ARGUMENT][--nb_processesNB_PROCESS][--children_logicPYTHON_FILE]Example of a call for an execution on a local machine within a terminal from the project root directory:python3availsim4.py--systemavailsim4core/test/E2E/input/convergence/convergence_test_system.xlsx--simulationavailsim4core/test/E2E/input/convergence/N1000_simulation.xlsx--output_folderoutput/E2E_example/One can import Availsim4 and start it from a python script:from availsim4core.main import main


main.start( path_simulation = 'path_to_siulation_file/simulation_file.xlsx',
            path_system = 'path_to_system_file/system_file.xlsx',
            path_sensitivity_analysis=None,
            output_folder = 'path_to_output_folder/',
            HTCondor=False,
            nb_processes=1)A notebook,call_AvailSim4.ipynb, is provided to make calls to AvailSim4 in jupyter (e.g. SWAN for CERN users).Example of a call for an execution on a cluster handle with HTCondor is described in the user guide.User documentationA guide is provided indoc/user_guide/LicenseCopyright © CERN 2021. Released under theGPL 3.0 only license. All rights not expressly granted are reserved.