9c6e77467db7d54f98e58e1e858ee7afae0e40e5 galt Thu Oct 11 03:07:37 2012 -0700 v12.15 - bugfixes and better support of rlimit for parasol diff --git src/parasol/paraNode/paraNode.c src/parasol/paraNode/paraNode.c index 040eaf5..5606ebc 100644 --- src/parasol/paraNode/paraNode.c +++ src/parasol/paraNode/paraNode.c @@ -366,30 +366,47 @@ { logWarn("memLimit %lld exceeds address space on 32-bit machine, treating it as 4GB limit", memLimit); memLimit = 4294967295LL; } struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = memLimit; if (setrlimit(RLIMIT_DATA, &rlim) < 0) logWarn("setrlimit failed with RLIMIT_DATA rlim_cur=%lld rlim_max=%lld" , (long long) rlim.rlim_cur , (long long) rlim.rlim_max); // although RLIMIT_AS is not supported/enforced on all platforms, // it is useful for linux and some other unix OSes. if (setrlimit(RLIMIT_AS, &rlim) < 0) logWarn("setrlimit failed with RLIMIT_AS rlim_cur=%lld rlim_max=%lld" , (long long) rlim.rlim_cur , (long long) rlim.rlim_max); + { // DEBUG REMOVE + logInfo("memLimit=%lld", memLimit); + struct rlimit rlim; + int rv; + rv = getrlimit(RLIMIT_DATA,&rlim); + if ( rv == -1 ) + logWarn("error getrlimit RLIMIT_DATA %s", strerror(errno)); + else + logInfo("rlimit_data:%lu,%lu\n", rlim.rlim_max, rlim.rlim_cur); + rv = getrlimit(RLIMIT_AS,&rlim); + if ( rv == -1 ) + logWarn("error getrlimit RLIMIT_AS %s", strerror(errno)); + else + logInfo("rlimit_as:%lu,%lu\n", rlim.rlim_max, rlim.rlim_cur); + } + + char *homeDir = ""; /* Change to given user (if root) */ changeUid(user, &homeDir); /* create output files just after becoming user so that errors in the rest * of this proc will go to the err file and be available via para * problems */ setupProcStdio(in, out, err); if (chdir(dir) < 0) errnoAbort("can't chdir to %s", dir); setsid(); // setpgid(0,0); umask(umaskVal);