- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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 kopiert
5 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
'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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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/
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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]

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite