Skip to content
Snippets Groups Projects
Commit a9418c87 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add stack check for unix (same as the one we use in getdp)
parent c2ce0452
No related branches found
No related tags found
No related merge requests found
// $Id: Box.cpp,v 1.33 2006-12-16 15:44:27 geuzaine Exp $
// $Id: Box.cpp,v 1.34 2007-03-18 14:12:20 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -21,6 +21,7 @@
#include <signal.h>
#include "Gmsh.h"
#include "OS.h"
#include "Numeric.h"
#include "Geo.h"
#include "Generator.h"
......@@ -95,6 +96,8 @@ int GMSHBOX(int argc, char *argv[])
signal(SIGFPE, Signal);
#endif
CheckResources();
GMSH_PluginManager::instance()->registerDefaultPlugins();
check_gsl();
......
# $Id: Makefile,v 1.34 2007-02-26 16:24:23 geuzaine Exp $
# $Id: Makefile,v 1.35 2007-03-18 14:12:20 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
......@@ -53,8 +53,8 @@ depend:
# DO NOT DELETE THIS LINE
Box.o: Box.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h ../Geo/Geo.h \
../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \
../DataStr/List.h ../DataStr/Tree.h ../Common/OS.h ../Numeric/Numeric.h \
../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \
../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \
../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \
......
// $Id: OS.cpp,v 1.5 2006-11-27 22:22:07 geuzaine Exp $
// $Id: OS.cpp,v 1.6 2007-03-18 14:12:20 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -91,6 +91,23 @@ void GetResources(double *s, long *mem)
#endif
}
void CheckResources(){
#if !defined (WIN32) || defined(__CYGWIN__)
static struct rlimit r;
getrlimit(RLIMIT_STACK, &r);
// Try to get at least 1 MB of stack. Running with too small a stack
// can cause crashes in the recursive calls (e.g. for tet
// classification in 3D Delaunay)
if(r.rlim_cur < 1024 * 1024){
Msg(INFO, "Increasing process stack size (%d kB < 1 MB)", r.rlim_cur / 1024);
r.rlim_cur = r.rlim_max;
setrlimit(RLIMIT_STACK, &r);
}
#endif
}
double Cpu()
{
long mem = 0;
......
......@@ -23,6 +23,7 @@
double GetTimeInSeconds();
void SleepInSeconds(double s);
void GetResources(double *s, long *mem);
void CheckResources();
double Cpu();
int GetProcessId();
int UnlinkFile(char *name);
......
// $Id: Main.cpp,v 1.104 2007-02-04 11:24:55 geuzaine Exp $
// $Id: Main.cpp,v 1.105 2007-03-18 14:12:20 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -25,6 +25,7 @@
#include "GUI.h"
#include "Gmsh.h"
#include "GmshUI.h"
#include "OS.h"
#include "Geo.h"
#include "Generator.h"
#include "CreateFile.h"
......@@ -105,6 +106,8 @@ int main(int argc, char *argv[])
signal(SIGFPE, Signal);
#endif
CheckResources();
// Initialize the default plugins
GMSH_PluginManager::instance()->registerDefaultPlugins();
......
# $Id: Makefile,v 1.126 2007-02-28 06:58:46 geuzaine Exp $
# $Id: Makefile,v 1.127 2007-03-18 14:12:20 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
......@@ -68,28 +68,28 @@ Main.o: Main.cpp GUI.h Opengl_Window.h Colorbar_Window.h \
SpherePosition_Widget.h ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \
../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \
../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \
../Numeric/Numeric.h ../Mesh/Generator.h ../Parser/CreateFile.h \
../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h \
../Common/VertexArray.h ../Common/SmoothData.h \
../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
../Common/Options.h ../Parser/Parser.h ../Parser/OpenFile.h \
../Common/CommandLine.h Solvers.h ../Plugin/PluginManager.h \
../Plugin/Plugin.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \
../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \
../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h \
../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h \
../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/MElement.h ../Geo/MVertex.h \
../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h ../Common/Hash.h \
../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \
../Geo/ExtrudeParams.h ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h \
../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/MElement.h ../Geo/SPoint2.h \
../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h ../Geo/GRegion.h \
../Geo/GEntity.h ../Geo/MElement.h ../Geo/ExtrudeParams.h \
../Geo/SBoundingBox3d.h
../Common/OS.h ../Geo/Geo.h ../Common/GmshDefines.h \
../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \
../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \
../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/SPoint2.h \
../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Numeric/Numeric.h \
../Mesh/Generator.h ../Parser/CreateFile.h ../Graphics/Draw.h \
../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
../Common/SmoothData.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
../Common/Context.h ../Common/Options.h ../Parser/Parser.h \
../Parser/OpenFile.h ../Common/CommandLine.h Solvers.h \
../Plugin/PluginManager.h ../Plugin/Plugin.h ../Geo/GModel.h \
../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \
../Geo/SBoundingBox3d.h ../Geo/MVertex.h ../Geo/SPoint3.h \
../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h \
../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \
../Geo/MElement.h ../Geo/MVertex.h ../Geo/MEdge.h ../Geo/MVertex.h \
../Geo/SVector3.h ../Common/Hash.h ../Geo/MFace.h ../Geo/MVertex.h \
../Geo/SVector3.h ../Geo/ExtrudeParams.h ../Geo/GFace.h ../Geo/GPoint.h \
../Geo/GEntity.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/MElement.h \
../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h \
../Geo/GRegion.h ../Geo/GEntity.h ../Geo/MElement.h \
../Geo/ExtrudeParams.h ../Geo/SBoundingBox3d.h
Message.o: Message.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment