[gmx-developers] gmx master: compiling on mac and segfault

Jochen Hub jhub at gwdg.de
Fri Jul 27 11:18:49 CEST 2012



Am 7/27/12 12:07 AM, schrieb Roland Schulz:
> On Thu, Jul 26, 2012 at 8:09 AM, Jochen Hub <jhub at gwdg.de> wrote:
>> Hi,
>>
>> I am trying to compile and run the git master on my Macbook air (OS X
>> Lion). Without success. If I compile with a newer gcc (4.5 or newer,
>> installed from Macports), I get errors like (does this have to do with AVX?)
>>
>> [  1%] Building C object
>> src/gromacs/CMakeFiles/libgromacs.dir/gmxpreprocess/add_par.c.o
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:66:no such
>> instruction: `vmovups 0(%r13), %ymm0'
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:69:no such
>> instruction: `vmovups %ymm0, 24(%rdi)'
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:79:no such
>> instruction: `vmovss 0(%r13), %xmm1'
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:83:no such
>> instruction: `vmovss %xmm1, 24(%rdi,%r9,4)'
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:99:no such
>> instruction: `vmovss 0(%r13), %xmm2'
>> /var/folders/ys/rh9lzqpj7854h34d2__mznph0000gn/T//ccPxJmjg.s:102:no such
>> instruction: `vmovss %xmm2, 24(%rdi,%r9,4)'
>
> What is GMX_ACCELERATION set to? Make sure it isn't set to AVX or that
> if it is that your cflags contain -mavx.

This error comes with auto acceleration detection. And it also comes 
with export CFLAGS="-mavx" and cmake -DCMAKE_C_FLAGS="-mavx". Without 
accelleration (-DGMX_ACCELERATION=NONE) this compile error does not 
occur (but still the segfault).

>
>> On a gcc 4.4 or earlier, compiling works fine, but mdruns stops with a
>> segfault. A backtrace in gdb gives the following. Seems like something
>> goes wrong in FFTW (which was compiled with the same gcc and with
>> --enable-threads --enable-sse --enable-sse2).
>>
>> Program received signal EXC_BAD_ACCESS, Could not access memory.
>> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000048
>> [Switching to process 44300 thread 0x1b03]
>> 0x0000000100050ebd in gomp_resolve_num_threads ()
>> (gdb) bt
>> #0  0x0000000100050ebd in gomp_resolve_num_threads ()
>> #1  0x0000000100050fc3 in GOMP_parallel_start ()
>> #2  0x00000001004c0bc2 in fft5d_plan_3d ()
>> #3  0x0000000100434a52 in gmx_parallel_3dfft_init ()
>> #4  0x000000010046b6fc in gmx_pme_init ()
>> #5  0x0000000100026ab3 in mdrunner (nthreads_requested=4, fplog=0x0,
>> cr=0x102100b40, nfile=36, fnm=0x103808200, oenv=0x101000c10, bVerbose=0,
>> bCompact=1, nstglobalcomm=-1, ddxyz=0x1013c0e04, dd_node_order=1, rdd=0,
>> rconstr=0, dddlb_opt=0x10002e26a "auto", dlb_scale=0.800000012,
>> ddcsx=0x0, ddcsy=0x0, ddcsz=0x0, nstepout=100, resetstep=-1,
>> nmultisim=0, repl_ex_nst=0, repl_ex_nex=0, repl_ex_seed=-1, pforce=-1,
>> cpt_period=15, max_hours=-1, deviceOptions=0x10002e276 "", Flags=7168)
>> at /Users/jhub/src/gmx/gromacs/src/programs/mdrun/runner.c:844
>> #6  0x0000000100024f2d in mdrunner_start_fn (arg=0x101005d60) at
>> /Users/jhub/src/gmx/gromacs/src/programs/mdrun/runner.c:173
>> #7  0x0000000100242bfb in tMPI_Thread_starter ()
>> #8  0x00007fff9785f8bf in _pthread_start ()
>> #9  0x00007fff97862b75 in thread_start ()
>
> Did you try a version which included the bugfix for issue 900
> (002c4985c1d839810816b5c1ba347634b7d7cabb)?
> What exact compiler did you try? Is it LLVM-gcc or gcc with gcc
> backend (not llvm)? Also so far we only saw OpenMP problems with
> llvm-gcc 4.2 not 4.4. So more details would be useful to know.

This segfault comes with the gcc-llvm and with all gcc from Macports. 
Btw, the segfault does not appear with mdrun -nt 1 (as Szilard pointed 
out), and it does not appear with -DGMX_OPENMP=OFF (as David pointed out).

I didnt' manage to test the bugfix. With git cherry-pick 
002c4985c1d8398... I get

# On branch master_segfault
nothing to commit (working directory clean)
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

     git commit --allow-empty

Otherwise, please use 'git reset'

Sorry stil git beginner...

Jochen

>
>> Can anyone give me a hint how to fix this? Or is the master so
>> experimental that it is not interned to be used at all right now?
> No it should work pretty well and the testsuite is run before any
> commit. And the Jenkins configuration does include gcc 4.2 and 4.6 on
> Mac. So it is somewhat surprising that you have 2 independent
> problems.
>
> Roland
>
>>
>> Many thanks,
>> Jochen
>>
>>
>> --
>> ---------------------------------------------------
>> Dr. Jochen Hub
>> Computational Molecular Biophysics Group
>> Institute for Microbiology and Genetics
>> Georg-August-University of Göttingen
>> Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.
>> Phone: +49-551-39-14189
>> http://cmb.bio.uni-goettingen.de/
>> ---------------------------------------------------
>> --
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> http://lists.gromacs.org/mailman/listinfo/gmx-developers
>> Please don't post (un)subscribe requests to the list. Use the
>> www interface or send it to gmx-developers-request at gromacs.org.
>>
>>
>>
>>
>
>
>

-- 
---------------------------------------------------
Dr. Jochen Hub
Computational Molecular Biophysics Group
Institute for Microbiology and Genetics
Georg-August-University of Göttingen
Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.
Phone: +49-551-39-14189
http://cmb.bio.uni-goettingen.de/
---------------------------------------------------



More information about the gromacs.org_gmx-developers mailing list