在较新的Linux系统中使用Materials Studio 2019和旧版Intel MPI

在较新的Linux系统中(如CentOS 8),Intel MPI 2018及之前的版本都无法使用,运行MPI任务会直接报错Segmentation Fault。当然,一般来说直接用最新版的就没问题了。但是,Materials Studio 2019在运行时使用的是它自带的Intel MPI 2018,于是由于这个问题,新版的Linux就无法运行MS2019。Intel在2021年3月左右在其官网提供了解决方法,但最近发现不知为何那个页面已经被删除了,本文即分享该解决方法。原本一直懒得写,但考虑到原文链接已失效、如果有人碰到相同的问题,怕是根本无法找到解决办法,于是还是早早分享出来。

  • 更新:该方法对于MS仍然有局限性(一些模块不识别LD_PRELOAD环境变量),对于MS现推荐容器方案。

这里也宣传一下我们的超算,最近半年一直在和Jincheng Liu一起做超算,积累了不少技术经验,等超算全部做好之后我也准备写一些面向科研人员的计算机教程。虽然受限于资金和精力现在规模还很小,但使用体验方面可以说是国内最好,性价比也是最高的,价格最低可至6分/核时。如果有朋友需要租用机时,可以扫下面的二维码联系我,可提供2000核时试用。

Resolving Segfaults in Legacy Intel® MPI Library on Newer Linux Distributions

原文链接(已失效):https://software.intel.com/content/www/us/en/develop/articles/resolving-segfaults-in-legacy-intel-mpi-library-on-newer-linux-distributions.html

  1. 点击这里下载补丁文件

  2. 编译:
    gcc -c -Wall -Werror -fpic ./strtok_proxy.c
    gcc -ldl -shared -o ./strtok_proxy.so ./strtok_proxy.o

  3. 上面两步最终会生成strtok_proxy.so文件。将其放置在任意目录下。

  4. 在执行MPI任务前,使用下面的命令加载上面生成的文件:
    export LD_PRELOAD=/full_path_to/strtok_proxy.so

不建议把上面这行加入到~/.bashrc里,否则可能会对其它程序造成影响。在执行MPI程序前执行就可以了。如果使用队列系统,则加入到提交脚本里即可。

Resolving Segfaults in Legacy Intel® MPI Library on Newer Linux Distributions

English:

This patch fixes the “Segmentation fault” problem when using Intel MPI 2018 on newer Linux distributions (such as CentOS 8). This is especially useful for running Materials Studio 2019 on newer Linux, because MS2019 uses a bundled Intel MPI 2018 and you cannot choose a newer one. The patch was released on Intel website a few months ago but was recently deleted for some reason.

  1. Download the fix code
  2. Compile the code by
    gcc -c -Wall -Werror -fpic ./strtok_proxy.c
    gcc -ldl -shared -o ./strtok_proxy.so ./strtok_proxy.o
  3. You will get a library file named strtok_proxy.so. You can save it anywhere.
  4. Apply the generated library at runtime using the following:
    export LD_PRELOAD=/full_path_to/strtok_proxy.so

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。