- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I execute, on the terminal I got the message of "Segmentation fault."
This message starts appearing after I increase the size of array in my code.
Looks like there is a specific size of variables we can allocate, and if we allocate more than this size, "Segmentation fault" message comes.
So I think I can solve this problem by increasing the stack-size.
Probably this question should not be posted here, could anybody please let me know how I can increase the stack size on Mac OSX?
I found several similar threads here and other sites, but they were not helpful for me.
So if anybody could explain the detail very much (like explain to a child), I appreciate it.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - nalgenbottle
When I execute, on the terminal I got the message of "Segmentation fault."
This message starts appearing after I increase the size of array in my code.
Looks like there is a specific size of variables we can allocate, and if we allocate more than this size, "Segmentation fault" message comes.
So I think I can solve this problem by increasing the stack-size.
Probably this question should not be posted here, could anybody please let me know how I can increase the stack size on Mac OSX?
I found several similar threads here and other sites, but they were not helpful for me.
So if anybody could explain the detail very much (like explain to a child), I appreciate it.
maybe this has the answer you are looking for?
How to increase the stack size on Mac OS X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'ulimit -s' is the unix command to show the maximum stack size.
'ulimit -s unlimited' will put your stack size to unlimited.
hope this will help you.
'ulimit -s unlimited' will put your stack size to unlimited.
hope this will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the article pointed to earlier (PDF) is a good one.
Here is a simplified article, but remember -heap-arrays (using this you may not need additional stack). Look for the linker switch for Mac OS X.
http://software.intel.com/en-us/articles/intel-fortran-compiler-increased-stack-usage-of-80-or-higher-compilers-causes-segmentation-fault/
Here is a simplified article, but remember -heap-arrays (using this you may not need additional stack). Look for the linker switch for Mac OS X.
http://software.intel.com/en-us/articles/intel-fortran-compiler-increased-stack-usage-of-80-or-higher-compilers-causes-segmentation-fault/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you all.
I understand how I can compile one single file with a larger stack size.
But what I want to do is compiling several files together and making a one executable file.
I made "Makefile" to do so, but still I do not know how I can compile them with a larger size.
Probably I should have said this first, but could anybody tell me how I can compile several files in "Makefile" with a larger stack size together?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - nalgenbottle
thank you all.
I understand how I can compile one single file with a larger stack size.
But what I want to do is compiling several files together and making a one executable file.
I made "Makefile" to do so, but still I do not know how I can compile them with a larger size.
Probably I should have said this first, but could anybody tell me how I can compile several files in "Makefile" with a larger stack size together?
For instance, I use this make file for one of my codes. You can choose two compilers and has diferent flags for debugging or production. If you can't figure it out maybe you could post your makefile so we can help?
[shell].SUFFIXES: .f90
.f90.o:
$(FC) $(FFLAGS) -c $<
#FC = gfortran
FC = ifort
EXE = dissip.$(FC)
LD = $(FC)
#FLAGS
ifndef L
L=0
endif
ifndef ARCH
ifeq ("$(FC)", "gfortran")
ARCH=native
endif
ifeq ("$(FC)", "ifort")
ARCH=pentium4
endif
endif
ifeq ("$(L)", "0")
ifeq ("$(FC)", "gfortran")
FFLAGS = -O0 -g3 -ggdb -mtune=$(ARCH)
-fbounds-check -Wuninitialized -Wunused-variable
-Wunderflow -Wunused-parameter
-pedantic-errors -Wall
-fbacktrace
-pedantic
endif
ifeq ("$(FC)", "ifort")
FFLAGS = -O0 -g -debug all -debug-parameters all -DD -C
-traceback -warn all -check all
-fp-model precise -fp-stack-check
-heap-arrays
#
# -check arg_temp_created
endif
else ifeq ("$(L)", "4")
ifeq ("$(FC)", "gfortran")
FFLAGS = -O3 -ftree-vectorize -mtune=native -ffast-math
-fopenmp
endif
ifeq ("$(FC)", "ifort")
FFLAGS = -O$(L) -xHost -heap-arrays -fp-model precise
-openmp -parallel
endif
else
ifeq ("$(FC)", "gfortran")
FFLAGS = -O3 -ftree-vectorize -mtune=native -ffast-math
endif
ifeq ("$(FC)", "ifort")
FFLAGS = -O$(L) -xHost -heap-arrays -fp-model precise
endif
endif
LDFLAGS = $(FFLAGS)
LIBS=-lm
OBJS = mod_gendef.o
ensightio.o
io.o
calc.o
analisys.o
all: $(OBJS) dissip_main.o
$(LD) $(LDFLAGS) dissip_main.o $(OBJS) $(LIBS) -o $(EXE)
# - BURGERS -----------------------------------------------------------
burgers: $(BOJS) burgers.o
$(LD) $(LDFLAGS) $(BOJS) burgers.o $(LIBS) -o burgers.$(FC)
clean:
rm -f *.o *.mod $(EXE)
%.o : %.mod
[/shell]

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page