Skip to content

Commit 5c43581

Browse files
committed
Nbody6++GPU-Dec2017
0 parents  commit 5c43581

File tree

444 files changed

+103665
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+103665
-0
lines changed

.gitignore

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Object files
5+
*.o
6+
*.ko
7+
*.obj
8+
*.elf
9+
10+
# Linker output
11+
*.ilk
12+
*.map
13+
*.exp
14+
15+
# Precompiled Headers
16+
*.gch
17+
*.pch
18+
19+
# Libraries
20+
*.lib
21+
*.a
22+
*.la
23+
*.lo
24+
25+
# Shared objects (inc. Windows DLLs)
26+
*.dll
27+
*.so
28+
*.so.*
29+
*.dylib
30+
31+
# Executables
32+
*.exe
33+
*.out
34+
*.app
35+
*.i*86
36+
*.x86_64
37+
*.hex
38+
*.avx
39+
*.sse
40+
*.mpi
41+
*.gpu
42+
*.b1m
43+
44+
# Debug files
45+
*.dSYM/
46+
*.su
47+
*.idb
48+
*.pdb
49+
50+
# Kernel Module Compile Results
51+
*.mod*
52+
*.cmd
53+
.tmp_versions/
54+
modules.order
55+
Module.symvers
56+
Mkfile.old
57+
dkms.conf
58+

Makefile

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Makefile for NBODY6++ June 2003 R.Sp., Changed by Long Wang on Aug 20, 2014
3+
#
4+
# Please use:
5+
# make
6+
# make install
7+
#
8+
9+
RESULT = nbody6++
10+
INSTALLDIR = /usr/local
11+
EXTRATOOLS = nb6++dumpb2a libinitial.so libnb6out3.so nb6++snapshot
12+
ifeq ("x", "x $(EXTRATOOLS)")
13+
EXTRAOBJS = installtools
14+
endif
15+
16+
VPATH=./build
17+
18+
$(RESULT) :
19+
$(MAKE) -C ./build
20+
21+
clean:
22+
rm -f ./build/*.o ./build/*.so ./build/$(RESULT) $(EXTRATARGET)
23+
24+
install: $(RESULT) $(EXTRAOBJS)
25+
@[ -d $(INSTALLDIR)/bin ] || mkdir $(INSTALLDIR)/bin
26+
@[ -d $(INSTALLDIR)/share ] || mkdir $(INSTALLDIR)/share
27+
@[ -d $(INSTALLDIR)/share/doc ] || mkdir $(INSTALLDIR)/share/doc
28+
cp ./build/$(RESULT) $(INSTALLDIR)/bin
29+
cp ./doc/nbody6++_manual.pdf $(INSTALLDIR)/share/doc/
30+
31+
32+
installtools:
33+
@[ -d $(INSTALLDIR)/bin ] || mkdir $(INSTALLDIR)/bin
34+
@[ -d $(INSTALLDIR)/include ] || mkdir $(INSTALLDIR)/include
35+
@[ -d $(INSTALLDIR)/lib ] || mkdir $(INSTALLDIR)/lib
36+
cp ./build/nb6++dumpb2a $(INSTALLDIR)/bin
37+
cp ./build/nb6++snapshot $(INSTALLDIR)/bin
38+
cp ./include/initial.h $(INSTALLDIR)/include
39+
cp ./build/libinitial.so $(INSTALLDIR)/lib
40+
cp ./include/nb6out3.h $(INSTALLDIR)/include
41+
cp ./build/libnb6out3.so $(INSTALLDIR)/lib
42+
43+
uninstall:
44+
rm -f $(INSTALLDIR)/bin/$(RESULT)
45+
rm -f $(INSTALLDIR)/lib/libinitial.so $(INSTALLDIR)/lib/libnb6out3.so
46+
rm -f $(INSTALLDIR)/share/doc/nbody6++_manual.pdf
47+
rm -f $(INSTALLDIR)/bin/nb6++dumpb2a $(INSTALLDIR)/bin/nb6++snapshot

Makefile.in

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Makefile for NBODY6++ June 2003 R.Sp., Changed by Long Wang on Aug 20, 2014
3+
#
4+
# Please use:
5+
# make
6+
# make install
7+
#
8+
9+
RESULT = nbody6++@RESULT@
10+
INSTALLDIR = @prefix@
11+
EXTRATOOLS = nb6++dumpb2a libinitial.so libnb6out3.so nb6++snapshot
12+
ifeq ("x@EXTRARESULT@", "x $(EXTRATOOLS)")
13+
EXTRAOBJS = installtools
14+
endif
15+
16+
VPATH=./build
17+
18+
$(RESULT) @EXTRARESULT@:
19+
$(MAKE) -C ./build
20+
21+
clean:
22+
rm -f ./build/*.o ./build/*.so ./build/$(RESULT) $(EXTRATARGET)
23+
24+
install: $(RESULT) $(EXTRAOBJS)
25+
@[ -d $(INSTALLDIR)/bin ] || mkdir $(INSTALLDIR)/bin
26+
@[ -d $(INSTALLDIR)/share ] || mkdir $(INSTALLDIR)/share
27+
@[ -d $(INSTALLDIR)/share/doc ] || mkdir $(INSTALLDIR)/share/doc
28+
cp ./build/$(RESULT) $(INSTALLDIR)/bin
29+
cp ./doc/nbody6++_manual.pdf $(INSTALLDIR)/share/doc/
30+
31+
32+
installtools: @EXTRARESULT@
33+
@[ -d $(INSTALLDIR)/bin ] || mkdir $(INSTALLDIR)/bin
34+
@[ -d $(INSTALLDIR)/include ] || mkdir $(INSTALLDIR)/include
35+
@[ -d $(INSTALLDIR)/lib ] || mkdir $(INSTALLDIR)/lib
36+
cp ./build/nb6++dumpb2a $(INSTALLDIR)/bin
37+
cp ./build/nb6++snapshot $(INSTALLDIR)/bin
38+
cp ./include/initial.h $(INSTALLDIR)/include
39+
cp ./build/libinitial.so $(INSTALLDIR)/lib
40+
cp ./include/nb6out3.h $(INSTALLDIR)/include
41+
cp ./build/libnb6out3.so $(INSTALLDIR)/lib
42+
43+
uninstall:
44+
rm -f $(INSTALLDIR)/bin/$(RESULT)
45+
rm -f $(INSTALLDIR)/lib/libinitial.so $(INSTALLDIR)/lib/libnb6out3.so
46+
rm -f $(INSTALLDIR)/share/doc/nbody6++_manual.pdf
47+
rm -f $(INSTALLDIR)/bin/nb6++dumpb2a $(INSTALLDIR)/bin/nb6++snapshot

README

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Welcome to use Nbody6++, which is the parallel version of Nbody6.
2+
Please send Email to [email protected] if you find some problems during using the code.
3+
4+
---------------------------------------------------------------------
5+
To install Nbody6++, please use:
6+
./configure [options]
7+
make
8+
make install
9+
10+
The configure has several optional features, please use
11+
./configure --help
12+
to check these features.
13+
14+
----------------------
15+
Some basice features:
16+
17+
--Install path:
18+
The default install path is /usr/local, if you want to change another path, please use:
19+
./configure --prefix=[YOURPATH]
20+
Replace [YOURPATH] to the full path that you want to install Nbody6++.
21+
There will be "bin", "doc", ["include", "lib"] created in your install path.
22+
23+
--GPU:
24+
The GPU support is enabled in default case, if you want to disable GPU acceleration, please use:
25+
./configure --disable-gpu
26+
27+
--MPI:
28+
The MPI is enabled in default case, if you want to disable MPI, please use:
29+
./configure --disable-mpi
30+
31+
--AVX/SSE:
32+
The AVX is enable in default case, you can choose no AVX/SSE, SSE and AVX, the option is:
33+
./configure --enable-simd=[arg]
34+
Replace [arg] by "no", "sse", "avx".
35+
36+
--HDF5 output format:
37+
The HDF5 is disabled in default case, if you want to enable it, please use:
38+
./configure --enable-hdf5
39+
40+
--extra tools:
41+
There are some extra tools and libraries for reading conf.3 and do some basic analysis, the default case it's disabled, if you want to compile them, please use:
42+
./configure --enable-tools
43+
44+
All these options can be used in the same time. For example:
45+
./configure --prefix=/opt/nbody6++ --enable-tools --enable-hdf5
46+
47+
---------------------------------------------------------------------
48+
***Important notice:
49+
50+
* When large NMAX is used, sometimes the segmentational fault happened after the simulation begin. This is due to the stack memory overflow. In this case, you should always run
51+
$ ulimit -s unlimited
52+
before the code is started in the same shell.
53+
Be careful that the "ulimit" only works for current shell, thus it's need to be used every time when a new shell is opened.
54+
You can put it in .bashrc or .bash_profile to always load it when a new shell is open.
55+
56+
* In some Linux systems (e.g. Ubuntu), when the large NMAX is used, the compiling crash with the error:
57+
"*** R_X86_64_PC32 against symbol ***"
58+
This error is related to the memory model of the Linux system. The detail of memory model is shown in https://software.intel.com/en-us/node/579558
59+
The solution is to add the configure option "--enable-mcmodel=large"
60+
In this case, the code performance may slightly decrease compared with "mcmodel=medium/small"
61+
62+
---------------------------------------------------------------------
63+
Please check doc/Nbody6++_manual.pdf for the detail description of Nbody6++
64+

README.local

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
3+
Note: simple desktop/laptop try:
4+
5+
./configure --disable-mpi --disable-gpu [--disable-simd --disable-openmp]
6+
7+
---------------------------------------------------
8+
March 2017, local psk compilation, or on laptop
9+
10+
ssh to psk1 - psk4
11+
12+
check module avail
13+
14+
module load openmpi-x86_64
15+
16+
make sure the CUDA environment is there, for example which nvcc
17+
if not load module or ask system manager, we need cuda, cuda-sdk, cudalib
18+
cuda 5.0 ie enough, higher is pk
19+
20+
./configure --enable-simd=avx --disable-hdf5 --enable-mpi --enable-tools --enable-gpu --with-cuda --with-cuda_sdk --enable-mcmodel=large --enable-option-checking --with-par=1024k
21+
22+
./configure --enable-simd=avx --disable-hdf5 --enable-mpi --enable-tools --enable-gpu --with-cuda --with-cuda_sdk --enable-option-checking --with-par=128k
23+
24+
#### THE FOLLOWING configure WORKS
25+
./configure --enable-simd=avx --enable-hdf5 --enable-mpi --enable-tools --enable-gpu --with-cuda --with-cuda_sdk --enable-mcmodel=large --enable-option-checking --with-par=1m
26+
27+
Configure example for laptop single core:
28+
29+
./configure --disable-simd --disable-gpu --disable-mpi --with-par=128k
30+
31+
check in ./build/Makefile these lines:
32+
33+
FC = mpif77
34+
CXX = g++
35+
CC = gcc
36+
NVCC = nvcc
37+
38+
For laptop use export FC = gfortran before configure; in build/Makefile the line GPU_FLAGS = -D GPU has
39+
to be commented out by #
40+
41+
if FC is not correct, or if the configure fails with error message 'there is no GNU compiler" try:
42+
43+
export FC=mpif77
44+
45+
and rerun configure...
46+
---------------------------
47+
48+
cp -p -i build/nbody6++.avx.gpu.mpi ../run-nnnn your run directory
49+
nbody6++
50+
51+
--------------------------
52+
53+
How to run the code if interactive parallel runs are allowed (and if the
54+
GPUs are on this local node)
55+
56+
mpirun -n 2 ./nbody6++.avx.gpu.mpi < abbas.inp 1>> abbas.out 2>> abbas.err &
57+
--------------------------
58+
59+
sources are in ./src/Main *.[fF] includes are in ./include *.h
60+
-------------------------
61+
62+
to recompile few files )in Nbody6pp-master directory only it works)::
63+
64+
rm build/myobject.o
65+
rm build/execfile (for example nbody6++.avx.mpi.gpu )
66+
make
67+
68+
-----------------------
69+
NEW-27/03/2017
70+
71+
before running configure use:
72+
module load mvapich2-x86_64
73+
74+
use the following command before compiling the code:
75+
scl enable devtoolset-2 bash

0 commit comments

Comments
 (0)