Over many years of working in software development, managing dependencies to you code, whether in binary or source code format has always been a pain, to be honest. Take your pick from:
Anyway, having installed a new Ubuntu partition I wanted to get back the development environment I'd been using for the last couple of years. This is what I did...
Install Visual Studio Code
It's my tool of choice for Python. On Ubuntu I followed these instructions
I then installed the Python and Pylance extensions for VS Code
To check the Python environment being used, Open the Command Palette with Ctrl-Shift-P and then Python : Select Interpreter
Install Anaconda
It has its quirks but I have been using Anaconda. I installed from scratch using the instructions here.
The default installation included all the necessary libraries for simple machine learning code.
Installing Cirq
I've been looking at Quantum Computing over the last year using Cirq. I couldn't get this installed using the instructions here.
However python -m pip install Cirq worked and it appeared in my Anaconda base (root) environment in VS Code. Success!
Installing Pygame
And finally, for some playing around with game programming I installed Pygame with python -m pip install pygame.
So my environment is back up and running on a new OS installation.
My Physics analysis code runs in 3 modes. For 1996 data, for 1997 data and for both year's data. The 3rd mode also runs over different values of cuts. This is so as to build a set of results that can be used to estimate systematic errors in the analysis. For example, changing the value of the cut on Calorimeter energy can provide an indication of how well is is modeled.
To run all these checks a number of "Steering card" files were created. Each one listing out the cuts to be made for a single batch run. The analysis would then run over the entire set of '96/'97 data for each batch in turn and build a list of result ntuples.
Now, while running '96 and '97 individually was successful, when running both, on the second iteration the process crashed with the following.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In years gone by, I would have taken the approach of writing loads of print(*,*) statements around the "ANALYSE: File contains..." log and eventually homed in on the offending code but surely I can do better now!
It turns out I can. I can add a DEBUG flag: -fcheck=all -g
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fcheck=all adds runtime checks for array bounds amongst other checks, -g adds extra information for the gdb debugger)
The line in isr_cuts96.fpp is:
call hf1(510,temp,1.)
This is filling a histogram with data. The fact it's failing on the second iteration of the batch suggests the histogram isn't being correctly cleared down after the first run.
The module I have to do the clearing down is called terminate.fpp
CALLHDELETID Action:Deletes a histogram and releases the corresponding storage space. Input parameter description: IDidentifier of a histogram.ID deletes all existing histograms.
Adding this to terminate.fpp fixed the problem and I am now able to run multiple batches in the same process
call hdelet(0)
Why this ran OK back in 2000 is probably a combination of the older CernLib library and Fortran compiler.