Skip to content

Commit

Permalink
Update PeTar version (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
rieder authored Jun 14, 2021
1 parent 788b877 commit 380eaa3
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/amuse/community/petar/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# standard amuse configuration include
# config.mk will be made after ./configure has run
# # don't run make directly in the PeTar/amuse-interface directory, this is used inside amuse.
# don't run make directly in the PeTar/amuse-interface directory, this is used inside amuse.
AMUSE_DIR?=$(shell amusifier --get-amuse-dir)
-include $(AMUSE_DIR)/config.mk

Expand Down Expand Up @@ -53,7 +53,7 @@ clean:
# make -C src clean

distclean: clean
make -C src $(FILELIST)
rm -rf src $(FILELIST)

#$(CODELIB):
# make -C src all
Expand All @@ -76,6 +76,9 @@ __init__.py:

$(FILELIST): |download

src/PeTar/src/get_version.hpp: src/PeTar/src/get_version.hpp.in |src/PeTar
sed 's/@VERSION@/'`cat src/PeTar/VERSION`'_'`cat src/SDAR/VERSION`'/g' src/PeTar/src/get_version.hpp.in >src/PeTar/src/get_version.hpp

test_interface: $(OBJS) test_interface.o
$(MPICXX) $(CXXFLAGS) $(OBJS) test_interface.o -o $@

Expand All @@ -88,5 +91,5 @@ worker_code.h: interface.py
petar_worker: worker_code.cc worker_code.h $(CODELIB) $(OBJS) interface.h
$(MPICXX) $(CXXFLAGS) $(SC_FLAGS) $(AM_CFLAGS) $(LDFLAGS) $< $(OBJS) $(CODELIB) -o $@ $(SC_MPI_CLIBS) $(LIBS) $(AM_LIBS)

.cc.o: $<
interface.o: interface.cc src/PeTar/src/get_version.hpp
$(MPICXX) $(CXXFLAGS) $(SC_FLAGS) -c -o $@ $<
6 changes: 3 additions & 3 deletions src/amuse/community/petar/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GetCodeFromHttp:
filename_template = "{version}.tar.gz"
name = ["PeTar", "SDAR", "FDPS"]
url_template = [
"https://github.com/AICS-SC-GROUP/PeTar/archive/{version}.tar.gz",
"https://github.com/lwang-astro/PeTar/archive/{version}.tar.gz",
"https://github.com/lwang-astro/SDAR/archive/{version}.tar.gz",
"https://github.com/FDPS/FDPS/archive/{version}.tar.gz",
]
Expand Down Expand Up @@ -101,14 +101,14 @@ def new_option_parser():
result = OptionParser()
result.add_option(
"--petar-version",
default='26ad74251a9d788bbdab3f9bcc75f65be55b22fb',
default='1b7c279fbb94af558952c56f4fd746fcf730ce83',
dest="petar_version",
help="PeTar commit hash to download",
type="string"
)
result.add_option(
"--sdar-version",
default='1a0261bd0060b27055ceedfe95245507ea71ef77',
default='2d0f79f259ffd6dd972f27548698d91e7cd476d7',
dest="sdar_version",
help="SDAR commit hash to download",
type="string"
Expand Down
52 changes: 52 additions & 0 deletions src/amuse/community/petar/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,50 @@ def set_theta():
"""
return function

#@legacy_function
#def get_gravitational_constant():
# """
# Get the value of gravitational constant
# """
# function = LegacyFunctionSpecification()
# function.addParameter(
# 'gravitational_constant', dtype='float64', direction=function.OUT,
# description=(
# "gravitational constant:"
# " positive"
# )
# )
# function.result_type = 'int32'
# function.result_doc = """
# 0 - OK
# the parameter was retrieved
# -1 - ERROR
# could not retrieve parameter
# """
# return function
#
#@legacy_function
#def set_gravitational_constant():
# """
# Set gravitational constant
# """
# function = LegacyFunctionSpecification()
# function.addParameter(
# 'gravitational_constant', dtype='float64', direction=function.IN,
# description=(
# "gravitational constant:"
# " between 0 and 1"
# )
# )
# function.result_type = 'int32'
# function.result_doc = """
# 0 - OK
# the parameter was set
# -1 - ERROR
# could not set parameter
# """
# return function

@legacy_function
def get_changeover_rout():
"""
Expand Down Expand Up @@ -383,6 +427,14 @@ def define_parameters(self, handler):
default_value=0.3
)

#handler.add_method_parameter(
# "get_gravitational_constant",
# "set_gravitational_constant",
# "gravitational_constant",
# "Gravitational constant",
# default_value=0.3
#)

handler.add_method_parameter(
"get_tree_step",
"set_tree_step",
Expand Down

0 comments on commit 380eaa3

Please sign in to comment.