Browse Source

increase the stack size limit in the constructor

tags/v0.2.16.rc1
Werner Saar 10 years ago
parent
commit
0d22551a6b
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      driver/others/memory.c

+ 14
- 0
driver/others/memory.c View File

@@ -104,6 +104,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <errno.h>
#include <linux/unistd.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/resource.h>
#endif

#if defined(OS_FREEBSD) || defined(OS_DARWIN)
@@ -1361,6 +1363,18 @@ void CONSTRUCTOR gotoblas_init(void) {
gotoblas_memory_init();
#endif

#if defined(OS_LINUX)
struct rlimit curlimit;
if ( getrlimit(RLIMIT_STACK, &curlimit ) == 0 )
{
if ( curlimit.rlim_cur != curlimit.rlim_max )
{
curlimit.rlim_cur = curlimit.rlim_max;
setrlimit(RLIMIT_STACK, &curlimit);
}
}
#endif

#ifdef SMP
if (blas_cpu_number == 0) blas_get_cpu_number();
#ifdef SMP_SERVER


Loading…
Cancel
Save