diff -cr espresso-3.2.2/ChangeLog-3.2.3 espresso-3.2.3/ChangeLog-3.2.3 *** espresso-3.2.2/ChangeLog-3.2.3 Thu May 31 15:16:27 2007 --- espresso-3.2.3/ChangeLog-3.2.3 Fri Jun 15 18:45:35 2007 *************** *** 0 **** --- 1,11 ---- + 31-may PW/pwscf.f90 clib/Makefile clib/stack.c + Finally found (maybe) a reliable fix for mysterious crashes with intel + compiler. Apparently the reason is insufficient stack size, but it may + not be sufficient to use command "limits" o "ulimit", because the stack + size seems to be reset either by queueing systems or by the code itself. + A C routine that removes stack limits has been added and is called at the + beginning of the run. + + 15-jun PW/pw_restart.f90 + Believe it or not, phonon with pools and lsda was still not working! + A needed correction had been forgotten in the previous patch, my fault (PG). diff -cr espresso-3.2.2/Gamma/phcg.f90 espresso-3.2.3/Gamma/phcg.f90 *** espresso-3.2.2/Gamma/phcg.f90 Wed Apr 12 16:18:05 2006 --- espresso-3.2.3/Gamma/phcg.f90 Thu May 31 22:14:59 2007 *************** *** 29,34 **** --- 29,39 ---- LOGICAL :: exst INTEGER :: i ! + #if defined __INTEL + ! ... Intel compilers v .ge.8 allocate a lot of stack space + ! ... Stack limit is often small, thus causing SIGSEGV and crash + CALL remove_stack_limit ( ) + #endif ! CALL check_stop_init () ! diff -cr espresso-3.2.2/PH/phonon.f90 espresso-3.2.3/PH/phonon.f90 *** espresso-3.2.2/PH/phonon.f90 Thu May 31 14:58:53 2007 --- espresso-3.2.3/PH/phonon.f90 Thu May 31 21:49:08 2007 *************** *** 55,60 **** --- 55,65 ---- CHARACTER (LEN=256) :: auxdyn, filname, filint CHARACTER(LEN=6), EXTERNAL :: int_to_char ! + #if defined __INTEL + ! ... Intel compilers v .ge.8 allocate a lot of stack space + ! ... Stack limit is often small, thus causing SIGSEGV and crash + CALL remove_stack_limit ( ) + #endif ! CALL init_clocks( .TRUE. ) ! diff -cr espresso-3.2.2/PP/postproc.f90 espresso-3.2.3/PP/postproc.f90 *** espresso-3.2.2/PP/postproc.f90 Tue Oct 17 11:04:26 2006 --- espresso-3.2.3/PP/postproc.f90 Thu May 31 22:16:19 2007 *************** *** 27,32 **** --- 27,38 ---- IMPLICIT NONE CHARACTER(len=256) :: filplot ! + #if defined __INTEL + ! ... Intel compilers v .ge.8 allocate a lot of stack space + ! ... Stack limit is often small, thus causing SIGSEGV and crash + CALL remove_stack_limit ( ) + #endif + ! ! initialise parallel environment ! CALL start_postproc (nd_nmbr) diff -cr espresso-3.2.2/PW/pw_restart.f90 espresso-3.2.3/PW/pw_restart.f90 *** espresso-3.2.2/PW/pw_restart.f90 Thu May 31 14:58:53 2007 --- espresso-3.2.3/PW/pw_restart.f90 Fri Jun 15 18:42:52 2007 *************** *** 2427,2433 **** IF ( nspin == 2 ) THEN ! ispin = 1 ! isk(ik) = 1 ! IF ( ionode ) THEN ! --- 2427,2435 ---- IF ( nspin == 2 ) THEN ! ispin = 1 ! ! ... no need to read isk here: they are read from band structure ! ! ... and correctly distributed across pools in read_file ! !!! isk(ik) = 1 ! IF ( ionode ) THEN ! *************** *** 2447,2453 **** ! ispin = 2 ik_eff = ik + num_k_points ! isk(ik_eff) = 2 ! IF ( ionode ) THEN ! --- 2449,2456 ---- ! ispin = 2 ik_eff = ik + num_k_points ! ! ... no need to read isk here (see above why) ! !isk(ik_eff) = 2 ! IF ( ionode ) THEN ! *************** *** 2467,2473 **** ! ELSE ! ! isk(ik) = 1 ! IF ( noncolin ) THEN ! --- 2470,2477 ---- ! ELSE ! ! ! ... no need to read isk here (see above why) ! !isk(ik) = 1 ! IF ( noncolin ) THEN ! diff -cr espresso-3.2.2/PW/pwscf.f90 espresso-3.2.3/PW/pwscf.f90 *** espresso-3.2.2/PW/pwscf.f90 Wed Jun 7 09:47:13 2006 --- espresso-3.2.3/PW/pwscf.f90 Thu May 31 15:11:32 2007 *************** *** 31,36 **** --- 31,41 ---- ! CHARACTER (LEN=9) :: code = 'PWSCF' ! + #if defined __INTEL + ! ... Intel compilers v .ge.8 allocate a lot of stack space + ! ... Stack limit is often small, thus causing SIGSEGV and crash + CALL remove_stack_limit ( ) + #endif ! ! ... use ".FALSE." to disable all clocks except the total cpu time clock ! ... use ".TRUE." to enable clocks diff -cr espresso-3.2.2/clib/Makefile espresso-3.2.3/clib/Makefile *** espresso-3.2.2/clib/Makefile Mon Mar 5 15:24:40 2007 --- espresso-3.2.3/clib/Makefile Thu May 31 15:12:25 2007 *************** *** 3,8 **** --- 3,9 ---- include ../make.sys OBJS = \ + stack.o \ c_mkdir.o \ cptimer.o \ fft_stick.o \ *************** *** 20,25 **** co -l $(OBJS:.o=.c) clean : ! - rm -f clib.a *.o *.mod *.i core* *.L include make.depend --- 21,26 ---- co -l $(OBJS:.o=.c) clean : ! - rm -f clib.a *.o *.mod *.i core* include make.depend diff -cr espresso-3.2.2/clib/stack.c espresso-3.2.3/clib/stack.c *** espresso-3.2.2/clib/stack.c Thu May 31 15:16:35 2007 --- espresso-3.2.3/clib/stack.c Thu May 31 22:08:56 2007 *************** *** 0 **** --- 1,22 ---- + /* + Copyright (C) 2007 Quantum-Espresso group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . + */ + + #include + #include + #include + #include "c_defs.h" + + void F77_FUNC(remove_stack_limit,REMOVE_STACK_LIMIT) (void) { + + struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY }; + + if ( setrlimit(RLIMIT_STACK, &rlim) == -1 ) { + perror("setrlimit error"); + exit(1); + } + }