Linux Gromacs compilation

Questions and Answers : Unix/Linux : Linux Gromacs compilation

To post messages, you must log in.

AuthorMessage
Profile Krzysztof Piszczek - wspieram Polski Projekt Boinc
Project administrator
Project developer
Project tester
Avatar

Send message
Joined: 8 Nov 10
Posts: 125
Credit: 5,508,546
RAC: 2,495
Message 5067 - Posted: 18 Oct 2017, 13:56:59 UTC - in response to Message 5065.  

For persons, who have some knowledge about Linux.

You can compile Gromacs yourself which allow you to use quickes instruction set available for your CPU and seriously decrease application execution time.
This is quite simple process:

1. Downioad gromacs archive from gromacs.org site.
2. Unpack it to your home folder.
3. In unpacked folder create "build" folder (or name it whatsoever you want).
4. Go to created folder.
5. Do:
For CUDA:
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=on -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_BUILD_SHARED_EXE=OFF

For OpenCL:
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=on -DGMX_USE_OPENCL=on -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_BUILD_SHARED_EXE=OFF

6. Do "make" (compiling with multithread is also possible, use -j parameter for it).
7. As root, do "make install" to have Gromacs tailored to your hardware...
Krzysztof 'krzyszp' Piszczek

Member of Radioactive@Home project team and Universe@Home admin.
ID: 5067 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile Krzysztof Piszczek - wspieram Polski Projekt Boinc
Project administrator
Project developer
Project tester
Avatar

Send message
Joined: 8 Nov 10
Posts: 125
Credit: 5,508,546
RAC: 2,495
Message 5087 - Posted: 19 Oct 2017, 14:43:35 UTC - in response to Message 5067.  

If somebody want to run two or more tasks on single card then need to add app_config.xml file to project directory:
<app_config>
	<app>
		<name>gmx</name>
		<max_concurrent>2</max_concurrent>
		<gpu_versions>
			<gpu_usage>0.5</gpu_usage>
			<cpu_usage>1</cpu_usage>
		</gpu_versions>
	</app>
</app_config>

"0.5" means "compute two tasks on single GPU".
For four tasks this value will be 0.25.
Krzysztof 'krzyszp' Piszczek

Member of Radioactive@Home project team and Universe@Home admin.
ID: 5087 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
langfod

Send message
Joined: 3 Aug 17
Posts: 19
Credit: 4,367,692
RAC: 1,498
Message 5096 - Posted: 19 Oct 2017, 21:42:11 UTC - in response to Message 5067.  
Last modified: 19 Oct 2017, 21:51:02 UTC

I built a gromacs binary using ARMv8/NEON_ASIMD/CUDA and it passed the tests during make check.
Install appears to have placed the binary file ARM_NEON_ASIMDgmx in the folder /usr/local/gromacs/bin.

Any tips to get work units and use this binary?

thank you
ID: 5096 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile Krzysztof Piszczek - wspieram Polski Projekt Boinc
Project administrator
Project developer
Project tester
Avatar

Send message
Joined: 8 Nov 10
Posts: 125
Credit: 5,508,546
RAC: 2,495
Message 5098 - Posted: 19 Oct 2017, 21:54:34 UTC - in response to Message 5096.  

You have to use app_info (or app_config, can't remember) to use it as "anonymous" platform... I never do this, but probably some users can help.
Krzysztof 'krzyszp' Piszczek

Member of Radioactive@Home project team and Universe@Home admin.
ID: 5098 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
langfod

Send message
Joined: 3 Aug 17
Posts: 19
Credit: 4,367,692
RAC: 1,498
Message 5115 - Posted: 20 Oct 2017, 20:17:10 UTC - in response to Message 5098.  

It looks like part of the issue that you are using some sort of wrapper program that the system does not have.
ID: 5115 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile Krzysztof Piszczek - wspieram Polski Projekt Boinc
Project administrator
Project developer
Project tester
Avatar

Send message
Joined: 8 Nov 10
Posts: 125
Credit: 5,508,546
RAC: 2,495
Message 5116 - Posted: 20 Oct 2017, 20:28:27 UTC - in response to Message 5115.  

It looks like part of the issue that you are using some sort of wrapper program that the system does not have.

True, I think he have to compile BOINC wrapper also...
Krzysztof 'krzyszp' Piszczek

Member of Radioactive@Home project team and Universe@Home admin.
ID: 5116 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
mmonnin

Send message
Joined: 25 Jan 17
Posts: 34
Credit: 6,961,791
RAC: 1,471
Message 5117 - Posted: 20 Oct 2017, 23:21:09 UTC - in response to Message 5098.  

You have to use app_info (or app_config, can't remember) to use it as "anonymous" platform... I never do this, but probably some users can help.


app_info to run a custom exe file instead of the one provided by a project. I've never set one up myself. SETI Lunatics is an installer that sets one up if a user wants an example.
ID: 5117 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
langfod

Send message
Joined: 3 Aug 17
Posts: 19
Credit: 4,367,692
RAC: 1,498
Message 5118 - Posted: 21 Oct 2017, 2:25:56 UTC
Last modified: 21 Oct 2017, 2:26:11 UTC

Getting closer but now it seems to be complaining about the job file.


<core_client_version>7.9.0</core_client_version>
<![CDATA[
<message>process exited with code 148 (0x94, -108)</message>
<stderr_txt>
21:20:08 (21643): wrapper (7.9.26016): starting
21:20:08 (21643): can't open job file job.xml
21:20:08 (21643): can't parse job file: -108
21:20:08 (21643): called boinc_finish(-108)
</stderr_txt>
]]>
ID: 5118 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
langfod

Send message
Joined: 3 Aug 17
Posts: 19
Credit: 4,367,692
RAC: 1,498
Message 5125 - Posted: 22 Oct 2017, 0:11:47 UTC
Last modified: 22 Oct 2017, 0:16:20 UTC

Yeah! First test job competed successfully - only 14 hours! lol :)

Here is what I ended up with:

I copied four files into /var/lib/boinc-client/projects/boinc.drugdiscoveryathome.com:

app_info.xml <- app_info.xml file
tegra_job.xml <- just a copy of the DD gromacs job.xml file
wrapper <- compiled boinc wrapper
ARM_NEON_ASIMDgmx <- compiled Gromac gmx (ARMv8,NEON_ASIMD,CUDA - yes yes very silly...)

app_info.xml:
<app_info>
<app>
    <name>gmx</name>
</app>
<file_info>
    <name>wrapper</name>
    <executable/>
</file_info>
<file_info>
    <name>ARM_NEON_ASIMDgmx</name>
    <executable/>
</file_info>
<file_info>
      <name>tegra_job.xml</name>
</file_info>
<app_version>
    <app_name>gmx</app_name>
    <version_num>16</version_num>
    <api_version>16</api_version>
    <file_ref>
      <file_name>tegra_job.xml</file_name>
      <open_name>job.xml</open_name>
    </file_ref>
    <file_ref>
      <file_name>ARM_NEON_ASIMDgmx</file_name>
      <open_name>gmx</open_name>
    </file_ref>
    <coproc>
       <type>CUDA</type>
       <count>1</count>
    </coproc>
    <file_ref>
      <file_name>wrapper</file_name>
      <main_program/>
    </file_ref>
</app_version>
</app_info>
ID: 5125 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
[VENETO] sabayonino

Send message
Joined: 7 Apr 10
Posts: 1
Credit: 2,042,251
RAC: 600
Message 5134 - Posted: 23 Oct 2017, 20:07:11 UTC

Hi guys

I'm running boinc on Gentoo-Linux (Nvidia GTX 980 , drivers:384.90)

Compiled Gromacs-2016.4 (cmake options were passed by ebuild scripts) with :
cmake -C /var/tmp/portage/sci-chemistry/gromacs-2016.4/work/gromacs-2016.4_float/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DGMX_FFT_LIBRARY=fftw3 -DGMX_X11=no -DGMX_EXTERNAL_BLAS=no -DGMX_EXTERNAL_LAPACK=no -DGMX_OPENMP=yes -DGMX_COOL_QUOTES=no -DGMX_USE_TNG=yes -DGMX_BUILD_MANUAL=no -DGMX_HWLOC=yes -DGMX_DEFAULT_SUFFIX=off -DGMX_SIMD=AVX2_256 -DGMX_LIB_INSTALL_DIR=lib64 -DGMX_VMD_PLUGIN_PATH=/usr/lib64/vmd/plugins/*/molfile/ -DBUILD_TESTING=OFF -DGMX_BUILD_UNITTESTS=OFF -DGMX_EXTERNAL_TINYXML2=ON -DGMX_DOUBLE=OFF -DGMX_MPI=OFF -DGMX_THREAD_MPI=yes -DGMX_GPU=ON  -DGMX_BINARY_SUFFIX= -DGMX_LIBS_SUFFIX= -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/sci-chemistry/gromacs-2016.4/work/gromacs-2016.4_float/gentoo_rules.cmake -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sci-chemistry/gromacs-2016.4/work/gromacs-2016.4_float/gentoo_toolchain.cmake  /var/tmp/portage/sci-chemistry/gromacs-2016.4/work/gromacs-2016.4


As you can see : -DGMX_SIMD=AVX2_256 is passed

but https://boinc.drugdiscoveryathome.com/result.php?resultid=12189274 (and others WUs)
SIMD instructions most likely to fit this hardware: AVX2_256
SIMD instructions selected at GROMACS compile time: SSE2


Systeminfo :
Portage 2.3.8 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r4, 4.12.12-gentoo x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770_CPU_@_3.40GHz-with-gentoo-2.4.1
KiB Mem:     8051228 total,    138544 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 22 Oct 2017 09:44:26 +0000
Head commit of repository gentoo: e57a5886e9ae10e5cea2b7f14aa501c49e1587e3

sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.2.4 [enabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.26.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo


Gromacs compiled with :
* sci-chemistry/gromacs-2016.4
   Install date: Thu Oct 19 23:24:50 2017
   USE="cuda openmp -X -blas -+doc --double-precision -+fftw -+hwloc -lapack -mkl -mpi -+offensive -+single-precision -test -+threads -+tng -${ACCE_IUSE}"
   CFLAGS="-O2 -pipe -march=native -mfpmath=sse -fopenmp   CXXFLAGS="-O2 -pipe -march=native -mfpmath=sse -fopenmp   LDFLAGS="-Wl,-O1,--as-needed,--hash-style=gnu -fopenmp"

and only avx/avx2 cpuflags are enabled
CPU_FLAGS_X86="avx avx2 -fma4 -sse2 -sse4_1"


Nvidia-cuda-toolkit :
* dev-util/nvidia-cuda-toolkit-8.0.61
   Install date: Thu Oct 19 02:13:37 2017
   USE=" -debugger -doc -eclipse -profiler"
   CFLAGS="-O2 -pipe -march=native -mfpmath=sse -fopenmp   CXXFLAGS="-O2 -pipe -march=native -mfpmath=sse -fopenmp   LDFLAGS="-Wl,-O1,--as-needed,--hash-style=gnu -fopenmp"


CPU-Flags:
# lshw -c cpu
  *-cpu                     
       description: CPU
       product: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
       vendor: Intel Corp.
       physical id: 53
       bus info: cpu@0
       version: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
       slot: SOCKET 1150
       size: 3400MHz
       capacity: 3800MHz
       width: 64 bits
       clock: 100MHz
       capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm arat pln pts cpufreq
       configuration: cores=4 enabledcores=4 threads=8



What was wrong ?
WUs take ~6-8 hours to be completed
ID: 5134 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
langfod

Send message
Joined: 3 Aug 17
Posts: 19
Credit: 4,367,692
RAC: 1,498
Message 5135 - Posted: 23 Oct 2017, 20:20:06 UTC - in response to Message 5134.  

Did you try just using the normal cmake instead of the eclipse stuff?
ID: 5135 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile Krzysztof Piszczek - wspieram Polski Projekt Boinc
Project administrator
Project developer
Project tester
Avatar

Send message
Joined: 8 Nov 10
Posts: 125
Credit: 5,508,546
RAC: 2,495
Message 5136 - Posted: 23 Oct 2017, 20:58:55 UTC - in response to Message 5134.  

Use your compiled gmx executable file instead the one from project.
Krzysztof 'krzyszp' Piszczek

Member of Radioactive@Home project team and Universe@Home admin.
ID: 5136 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote

Questions and Answers : Unix/Linux : Linux Gromacs compilation


©2017 All rights reserved | Design by Digital BioPharm Ltd