Project

General

Profile

Bug #195

MDRUN segfaults on Intel64 platform due to using wrong data type in MKL FFT

Added by Hirokazu Kobayashi over 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I faced segfault in MDRUN on Intel64 platform with MKL FFT.
I think why it crashes is MKL FFT expects "long" as some arguments while Gromacs passes "int" as arguments.
On 32bit Linux machine, Both "int" and "long" are 32bit and it will run without problem. But 64bit Linux machine often defines "int" as 32bit while "long" as 64bit.

I fixed gmx_fft_mkl.c file and attached it.
I tested this fix with MKL 9.0 and MKL 10.0.
MKL10.0 defines "MKL_LONG" datatype in include file to support ILP64 mode of MKL.
In ILP64 mode MKL_LONG is defined as 64bit int. In LP64 mode (MKL default) it is defined as long.
In MKL 9.0 or lower version, "MKL_LONG" is not defined. So I defined MKL_LONG as long in gms_fft_mkl.c if MKL_LONG is not defined.

The file may violate coding rule of Gromacs, So it need to be reviewed and to be rewritten.

Thanks.
---
Kobayashi

gmx_fft_mkl.c (34 KB) gmx_fft_mkl.c fixed wrong datatype Hirokazu Kobayashi, 05/14/2008 12:20 PM

Related issues

Has duplicate GROMACS - Bug #174: MDRUN segfaults on an AMD64 system using Intel compilers and Intel MKL for FFTClosed10/26/2007

Associated revisions

Revision db48b317 (diff)
Added by Erik Lindahl about 11 years ago

Bugfix from bugzilla #195: Intel MKL is sensitive to long being 64 bits on some x86 platforms.

History

#1 Updated by Hirokazu Kobayashi over 11 years ago

Created an attachment (id=279)
fixed wrong datatype

#3 Updated by Erik Lindahl about 11 years ago

Committed to the release branch.

Also available in: Atom PDF