Skip to content

Commit

Permalink
close a breach that could lead to optimistic done
Browse files Browse the repository at this point in the history
  • Loading branch information
cesar-douady committed Apr 15, 2024
1 parent c6d20b6 commit c648f5d
Show file tree
Hide file tree
Showing 45 changed files with 1,070 additions and 877 deletions.
2 changes: 2 additions & 0 deletions Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ unit_tests/critical2.py
unit_tests/cwd.py
unit_tests/cycle.py
unit_tests/depend.py
unit_tests/depend2.py
unit_tests/depend_verbose.py
unit_tests/dup.py
unit_tests/dyn_accesses.py
Expand All @@ -177,6 +178,7 @@ unit_tests/hard_lnks.py
unit_tests/hello_world.py
unit_tests/hide.py
unit_tests/home.py
unit_tests/hot.py
unit_tests/ignore.py
unit_tests/ignore_err.py
unit_tests/jemalloc.py
Expand Down
1 change: 0 additions & 1 deletion TO_DO
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ items :
****************************************************************************************************

* crash if python() dynamic attribute returns None
* crash in regexpr (cf mail NM 2024/04/08 21:29)
* fix compilation with LMAKE_FLAGS=ST
* missing some deps when reading elf
- it seems that libc.so is missing at least in some occasions
Expand Down
2 changes: 1 addition & 1 deletion _bin/sys_config
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CXX=${CXX:-g++}
type -p $CXX >/dev/null || { echo cannot find c++ compiler $CXX ; exit 1 ; }

case "$($CXX --version|head -1)" in
*clang* ) CXX_FLAVOR=clang ; v=$($CXX -dumpversion) ; [ ${v%%.*} -lt 15 ] && { echo clang version must be at least 15 ; exit 1 ; } ;;
*clang* ) CXX_FLAVOR=clang ; v=$($CXX -dumpversion) ; [ ${v%%.*} -lt 14 ] && { echo clang version must be at least 14 ; exit 1 ; } ;;
*g++* ) CXX_FLAVOR=gcc ; v=$($CXX -dumpversion) ; [ ${v%%.*} -lt 11 ] && { echo gcc version must be at least 11 ; exit 1 ; } ;;
* ) echo cannot recognize c++ compiler $CXX ; exit 1 ;;
esac
Expand Down
89 changes: 45 additions & 44 deletions _lib/lmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,54 +45,55 @@ def version(major,minor) :
#_group = _os.getgroups()[0]

config = pdict(
heartbeat = 10 # in seconds, minimum interval between 2 heartbeat checks (and before first one) for the same job (no heartbeat if None)
, heartbeat_tick = 0.1 # in seconds, minimum internval between 2 heartbeat checks (globally) (no heartbeat if None)
, link_support = 'Full' # symlinks are supported. Other values are 'None' (no symlink support) or 'File' (symlink to file only support)
#, local_admin_dir = 'LMAKE_LOCAL' # directory in which to store data that are private to the server (not accessed by remote executing hosts) (default is within LMAKE dir)
, max_dep_depth = 1000 # used to detect infinite recursions and loops
, max_error_lines = 100 # used to limit the number of error lines when not reasonably limited otherwise
, network_delay = 1 # delay between job completed and server aware of it. Too low, there may be spurious lost jobs. Too high, tool reactivity may rarely suffer.
, path_max = 400 # max path length, but a smaller value makes debugging easier (by default, not activated)
#, reliable_dirs = False # if true, close to open coherence is deemed to encompass enclosing directory coherence (improve performances)
# # - forced true if only local backend is used
# # - set true for ceph
# # - leave false for NFS
#, remote_admin_dir = 'LMAKE_REMOTE' # directory in which to store job trace during remote job execution (default is within LMAKE dir)
#, remote_tmp_dir = 'LMAKE_TMP' # directory in which to store tmp data during remote job execution (not used when keep_tmp is enforced) (default is within LMAKE dir)
#, rules_module = 'rules' # module to import to define rules . By default, rules are directly defined in Lmakefile.py
#, sources_module = 'sources' # module to import to define sources. By default, 'lmake.auto_sources' which lists files in Manifest or searches git (recursively) if lmake.sources is not set
, sub_prio_boost = 1 # increment to add to rules defined in sub-repository (multiplied by directory depth of sub-repository) to boost local rules
, console = pdict( # tailor output lines
date_precision = None # number of second decimals in the timestamp field
, host_length = None # length of the host field (lines will be misaligned if a host is longer)
, has_exec_time = True # if True, output the exec_time field
disk_date_precision = 0.010 # in seconds, precisions of dates on disk, must account for date granularity and date discrepancy between executing hosts and disk servers
, heartbeat = 10 # in seconds, minimum interval between 2 heartbeat checks (and before first one) for the same job (no heartbeat if None)
, heartbeat_tick = 0.1 # in seconds, minimum internval between 2 heartbeat checks (globally) (no heartbeat if None)
, link_support = 'Full' # symlinks are supported. Other values are 'None' (no symlink support) or 'File' (symlink to file only support)
#, local_admin_dir = 'LMAKE_LOCAL' # directory in which to store data that are private to the server (not accessed by remote executing hosts) (default is within LMAKE dir)
, max_dep_depth = 1000 # used to detect infinite recursions and loops
, max_error_lines = 100 # used to limit the number of error lines when not reasonably limited otherwise
, network_delay = 1 # delay between job completed and server aware of it. Too low, there may be spurious lost jobs. Too high, tool reactivity may rarely suffer.
, path_max = 400 # max path length, but a smaller value makes debugging easier (by default, not activated)
#, reliable_dirs = False # if true, close to open coherence is deemed to encompass enclosing directory coherence (improve performances)
# # - forced true if only local backend is used
# # - set true for ceph
# # - leave false for NFS
#, remote_admin_dir = 'LMAKE_REMOTE' # directory in which to store job trace during remote job execution (default is within LMAKE dir)
#, remote_tmp_dir = 'LMAKE_TMP' # directory in which to store tmp data during remote job execution (not used when keep_tmp is enforced) (default is within LMAKE dir)
#, rules_module = 'rules' # module to import to define rules . By default, rules are directly defined in Lmakefile.py
#, sources_module = 'sources' # module to import to define sources. By default, 'lmake.auto_sources' which lists files in Manifest or searches git (recursively) if lmake.sources is not set
, sub_prio_boost = 1 # increment to add to rules defined in sub-repository (multiplied by directory depth of sub-repository) to boost local rules
, console = pdict( # tailor output lines
date_precision = None # number of second decimals in the timestamp field
, host_length = None # length of the host field (lines will be misaligned if a host is longer)
, has_exec_time = True # if True, output the exec_time field
)
, n_tokens_tab = pdict() # table of number of tokens referenced by rules. This indirection allows dynamic update of this value while rules cannot be dynamically updated
, backends = pdict( # PER_BACKEND : provide a default configuration for each backend
precisions = pdict( # precision of resources allocated for jobs, one entry for each standard resource (for all backends).
cpu = 4 # encodes the highest number with full granularity, 4 is a reasonable value
, mem = 4 # 4 means possible values are 1 2, 3, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40...
, tmp = 4 # 8 would mean possible values are 1 2, 3, 4, 5, 6, 7, 8, 10, ...
, n_tokens_tab = pdict() # table of number of tokens referenced by rules. This indirection allows dynamic update of this value while rules cannot be dynamically updated
, backends = pdict( # PER_BACKEND : provide a default configuration for each backend
precisions = pdict( # precision of resources allocated for jobs, one entry for each standard resource (for all backends).
cpu = 4 # encodes the highest number with full granularity, 4 is a reasonable value
, mem = 4 # 4 means possible values are 1 2, 3, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40...
, tmp = 4 # 8 would mean possible values are 1 2, 3, 4, 5, 6, 7, 8, 10, ...
)
, local = pdict( # entries mention the total availability of resources
# interface = _interface # address at which lmake can be contacted from jobs launched by this backend, can be :
# # - '' : loop-back address (127.0.0.1) for local backend, hostname for remote backends
# # - standard dot notation : for example '192.168.0.1'
# # - network interface name : the address of the host on this interface (as shown by ifconfig)
# # - a host name : the address of the host as found in networkd database (as shown by ping)
# # - default is loopback for local backend and hostname for the others
cpu = _cpu # total number of cpus available for the process, and hence for all jobs launched locally
, mem = str(_mem>>20)+'M' # total available memory in MBytes
, tmp = 0 # total available temporary disk space in MBytes
, local = pdict( # entries mention the total availability of resources
# interface = _interface # address at which lmake can be contacted from jobs launched by this backend, can be :
# # - '' : loop-back address (127.0.0.1) for local backend, hostname for remote backends
# # - standard dot notation : for example '192.168.0.1'
# # - network interface name : the address of the host on this interface (as shown by ifconfig)
# # - a host name : the address of the host as found in networkd database (as shown by ping)
# # - default is loopback for local backend and hostname for the others
cpu = _cpu # total number of cpus available for the process, and hence for all jobs launched locally
, mem = str(_mem>>20)+'M' # total available memory in MBytes
, tmp = 0 # total available temporary disk space in MBytes
)
)
, caches = pdict( # PER_CACHE : provide an explanation for each cache method
# dir = pdict( # when rule specifies cache = 'dir' , this cache is selected
# tag = 'dir' # specify the caching method, must be one of the supported method
# , repo = root_dir # an id that identifies the repository, no more than one entry is stored in the cache for a given job and tag
# , dir = '/cache_dir' # the directory in which cached results are stored
# , size = 10<<30 # the overall size of this cache
# , group = _group # the group used to write to the cache. If user does not belong to this group, read-only access is still possible
, caches = pdict( # PER_CACHE : provide an explanation for each cache method
# dir = pdict( # when rule specifies cache = 'dir' , this cache is selected
# tag = 'dir' # specify the caching method, must be one of the supported method
# , repo = root_dir # an id that identifies the repository, no more than one entry is stored in the cache for a given job and tag
# , dir = '/cache_dir' # the directory in which cached results are stored
# , size = 10<<30 # the overall size of this cache
# , group = _group # the group used to write to the cache. If user does not belong to this group, read-only access is still possible
# )
)
, colors = pdict(
Expand Down
9 changes: 9 additions & 0 deletions doc/lmake.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,15 @@ Recognized attributes are :
@multitable @columnfractions 0.1 0.07 0.05 0.78
@headitem Attribute @tab Default @tab Update @tab Description

@item @code{disk_date_precision}
@tab @code{0.010}
@tab Static
@tab This attribute instruct @lmake to take some margin (expressed in seconds) when it must rely on file dates to decide about event orders.
It must account for file date granularity (generally a few ms) and date discrepancy between executing hosts and disk servers (generally a few ms when using NTP).
If too low, there are risks that @lmake consider that data read by a job are up to date while they have been modified shortly after.
If too high, there is a small impact on performance as @lmake will consider out of date data that are actually up to date.
The default value should be safe in usual cases and user should hardly need to modify it.

@item @code{heartbeat}
@tab @code{10}
@tab Static
Expand Down
1 change: 1 addition & 0 deletions docker/ubuntu22.docker
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt-get update --fix-missing # 1 : in case of failure, try to incremen
RUN apt-get install -y build-essential
RUN apt-get install -y ed g++-12 git texinfo libseccomp-dev
RUN apt-get install -y python2 python3-dev python3-numba python3-venv
RUN apt-get install -y clang

RUN useradd --uid 1001 --home-dir /home/cdy cdy
USER 1001:1001
Expand Down
2 changes: 1 addition & 1 deletion src/autodep/clmake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static PyObject* depend( PyObject* /*null*/ , PyObject* args , PyObject* kwds )
Ptr<Dict> res { New } ;
if (+files) { // fast path : else, depend on no files
//
JobExecRpcReply reply = _g_record.direct(JobExecRpcReq( Proc::DepInfos , ::copy(files) , ad , no_follow , true/*sync*/ , "depend" )) ;
JobExecRpcReply reply = _g_record.direct(JobExecRpcReq( Proc::DepVerbose , ::copy(files) , ad , no_follow , true/*sync*/ , "depend" )) ;
//
SWEAR( reply.dep_infos.size()==files.size() , reply.dep_infos.size() , files.size() ) ;
for( size_t i=0 ; i<reply.dep_infos.size() ; i++ ) {
Expand Down
Loading

0 comments on commit c648f5d

Please sign in to comment.