We got another error report about "GDALIO:
too many files open" recently as well.
The
problem is not in our code. Since your images are so big, too many tiles got created, it looks that GDAL can't merge them. It
looks from your log file that the problem is with the intermediate file B.tif in your output dir, which is a giant VRT (virtual collection of many files).
You have two options at this stage, and regretfully I don't think you can reuse your work. The first is to split the left mapprojected image in two, with some overlap, say 1024 pixels, (likely doing a top half and bottom half will work, as I recall these images
to be very tall), then run parallel_stereo on both, create DEMs, and merge them with point2dem.
The second option is to run parallel_stereo with bigger --job-size-h and --job-size-w, such as with a value of 3072 instead of the default 2048. There's a chance SGM may run out of memory with bigger tiles, then fewer processes may be needed.
It should be possible to reuse your work, but it would be some pain. The offending VRT file, which is your ba_mapped_stereo_build0126_mgm/output-B.tif file, is just a list of files
and coordinates about how those files should be combined in a big file. There are too many files and GDAL complains.
It should be possible to edit this file and break it into two or four smaller VRTs, each still a text file, merge them individually with gdal_translate, get then a small number of
very big files, create a VRT having those, which would have very similar syntax to your original VRT, just file names and coordinates, then merge those with gdal_translate. Looks like doable work but would need some attention to detail.
Sorry. You are hitting the limits of the tools.
Lastly, your choice to use --subpixel-mode 2 will result in the whole thing running for a lot more days after that step. I would suggest --subpixel-mode 3 which is faster and almost
as good.
Lastly, a beefy machine with many nodes is suggested for this kind of work. Waiting 3 days to for something to run is a lot.