m_exit/enable_timelimit_in [ Functions ]

Eable time limit handler in the given function if not already done in one of the callers.
Return the name of procedure that is handling the time limit.
Example:
! enable time limit handler if not done in callers.
if (enable_timelimit_in(ABI_FUNC) == ABI_FUNC) then
write(std_out,*)"Enabling timelimit check in function: ",trim(ABI_FUNC)," with timelimit: ",trim(sec2str(get_timelimit()))
end if

m_exit/exit_check [ Functions ]

This routine checks whether the CPU time limit is exceeded or not.
If openexit is non-zero, it also checks the "filename" file
for the "exit" character string in its first line and returns the location
of the string on the line (0 if not found). Maps both strings to upper case
before attempting to match them. Also checks for the existence
of the "abinit.exit" file in the directory where the job was started.
Finally, checks whether the CPU time limit was not exceeded.
If one of these conditions occurs, will induce graceful exit of iterations.

INPUTS

cpus = CPU time limit
filename = character string giving name of file to be opened
iout = unit number to print output to
openexit = if 1, open the "filename" and "abinit.exit" files
comm=MPI communicator.

OUTPUT

iexit = index of "exit" on first line of file (0 if not found),
or -1 if the exit was ordered through the existence of the "exit" file
or -2 if the exit was ordered through the CPU time limit.