From 0632e99d569ffe74a5de5a0339a56f65f1316cf4 Mon Sep 17 00:00:00 2001 From: Duncan Macleod <duncan.macleod@ligo.org> Date: Fri, 5 Feb 2021 00:35:52 +0000 Subject: [PATCH] gstlal-burst: only call setrlimit on linux it causes errors on macos with python3 --- gstlal-burst/bin/gstlal_snax_extract | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/gstlal-burst/bin/gstlal_snax_extract b/gstlal-burst/bin/gstlal_snax_extract index 7c0b126c64..c933afcd13 100755 --- a/gstlal-burst/bin/gstlal_snax_extract +++ b/gstlal-burst/bin/gstlal_snax_extract @@ -72,16 +72,17 @@ def setrlimit(res, lim): resource.setrlimit(res, (lim if lim is not None else hard_lim, hard_lim)) -# set the number of processes and total set size up to hard limit and -# shrink the per-thread stack size (default is 10 MiB) -setrlimit(resource.RLIMIT_NPROC, None) -setrlimit(resource.RLIMIT_AS, None) -setrlimit(resource.RLIMIT_RSS, None) - -# FIXME: tests at CIT show that this next tweak has no effect. it's -# possible that SL7 has lowered the default stack size from SL6 and we -# don't need to do this anymore. remove? -setrlimit(resource.RLIMIT_STACK, 1024 * 1024) # 1 MiB per thread +if sys.platform == "linux": + # set the number of processes and total set size up to hard limit and + # shrink the per-thread stack size (default is 10 MiB) + setrlimit(resource.RLIMIT_NPROC, None) + setrlimit(resource.RLIMIT_AS, None) + setrlimit(resource.RLIMIT_RSS, None) + + # FIXME: tests at CIT show that this next tweak has no effect. it's + # possible that SL7 has lowered the default stack size from SL6 and we + # don't need to do this anymore. remove? + setrlimit(resource.RLIMIT_STACK, 1024 * 1024) # 1 MiB per thread # ============================= -- GitLab