Topic: Program randomly (it seems) halts execution
I am struggling with an issue with my simulation program where it just halts execution at random points. Sometimes when restarted, it will halt at the same point but other times will just continue to some other point. Note too that when I say halts, I mean the console that the code runs in just stops, no error messages, segmentation faults or anything. The CPU just goes less busy (I have other simulations running simultaneously on my development system) and that is how I know it has halted.
Understand that this code is "stable" in the sense that I am currently running about 8 simulations on 4 different machines (Win 7 Pro and Win10 Pro). These instances may run for weeks/months without being stopped unless there is power outage that forces the issue.
I saw in some previous posts that if I run the code in debug mode, it will stop at the offending part of the code. However, I am trying this but the code refuses to halt in this mode. Also I am running the debug, non-optimized version outside the debugger and so far it has not halted. As time goes on, I wonder if the issue has something to do with the optimization I am using but again, all these other instances that are currently running made with full optimization do not show this problem. I have seen this on these other machines but usually restarting the sim will make the problem go away.
I am using SF 2.41 build 2559, developing the F90 executable as a Win64 console application on a Win10 Pro 64 OS. The program seems memory stable and the instance I am testing is using about 32 Mbytes.
At this point I am just grasping for help from anyone would might have seen this sort of thing.
Thanks in advance.
Rod
Oh, here is the latest make file:
#
# Automagically generated by Approximatrix Simply Fortran 2.41
#
FC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe"
CC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe"
AR="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe"
WRC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe"
RM=rm -f
OPTFLAGS= -g -mtune=broadwell
SPECIALFLAGS=$(IDIR)
RCFLAGS=-O coff
PRJ_FFLAGS= -fopenmp
PRJ_CFLAGS=
PRJ_LFLAGS=-Wl,--stack,150000000 -lgomp
FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules
CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)
"build\riod.o": ".\riod.f90"
@echo Compiling .\riod.f90
@$(FC) -c -o "build\riod.o" $(FFLAGS) ".\riod.f90"
clean: .SYMBOLIC
@echo Deleting build\riod.o and related files
@$(RM) "build\riod.o"
@echo Deleting default icon resource
@$(RM) "build\sf_default_resource.res"
@echo Deleting riod.exe
@$(RM) "riod.exe"
"riod.exe": "build\riod.o" "build\Riod-MP-F90.prj.target"
@echo Generating riod.exe
@$(FC) -o "riod.exe" -static -fopenmp "build\riod.o" $(LDIR) $(PRJ_LFLAGS)
all: "riod.exe" .SYMBOLIC