Skip to content

Commit b694bca

Browse files
committed
Merge branch 'main' into issue-1144-new-continuous-integration
2 parents 285d0e1 + af37bfe commit b694bca

16 files changed

Lines changed: 105 additions & 101 deletions

File tree

lib/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: Makefile
2-
LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
2+
AMUSE_LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
33

44

55
# We build sapporo_light separately and only on demand, because it needs CUDA and we
@@ -10,9 +10,9 @@ LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
1010

1111

1212
.PHONY: install uninstall clean distclean
13-
install uninstall clean distclean: $(LIBS)
13+
install uninstall clean distclean: $(AMUSE_LIBS)
1414

15-
.PHONY: $(LIBS)
16-
$(LIBS):
15+
.PHONY: $(AMUSE_LIBS)
16+
$(AMUSE_LIBS):
1717
$(MAKE) -C $@ $(MAKECMDGOALS)
1818

lib/sapporo_light/sapporo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,8 @@ int sapporo::get_ngb_list(int cluster_id,
270270
sort(nbl, nbl + min(nblen, maxlength));
271271
return overflow;
272272
}
273+
274+
int sapporo::get_nj_max() const
275+
{
276+
return nj_max;
277+
}

lib/sapporo_light/sapporo.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ extern "C"
103103
{
104104
int get_device_count();
105105
cudaError_t host_evaluate_gravity(sapporo_multi_struct);
106+
int g6_get_nj_max_();
106107
}
107108

108109
class sapporo {
@@ -169,7 +170,7 @@ class sapporo {
169170

170171
predict = false;
171172
nj_modified = 0;
172-
173+
173174
device.address_j = NULL;
174175

175176
device.t_j = NULL;
@@ -182,13 +183,15 @@ class sapporo {
182183
device.acc_i = NULL;
183184
device.vel_i = NULL;
184185
device.jrk_i = NULL;
186+
185187

186188
};
187189
~sapporo() {};
188190

189191
int open(int cluster_id);
190192
int close(int cluster_id);
191193
int get_n_pipes();
194+
int get_nj_max() const;
192195
int set_ti(int cluster_id, double ti);
193196

194197
int set_j_particle(int cluster_id,

lib/sapporo_light/sapporoG6lib.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ extern "C" {
4949
return grav.calc_lasthalf2(*cluster_id, *nj, *ni,
5050
index, xi, vi, *eps2, h2, acc, jerk, pot, inn);
5151
}
52+
int g6_get_nj_max_() {
53+
return grav.get_nj_max();
54+
}
5255

5356
int g6_initialize_jp_buffer_(int* cluster_id, int* buf_size) {return 0;}
5457
int g6_flush_jp_buffer_(int* cluster_id) {return 0;}
@@ -80,4 +83,3 @@ extern "C" {
8083

8184

8285
}
83-

lib/sapporo_light/send_fetch_data.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ void sapporo::send_j_particles_to_device(int ignore) {
6565
dev_struct &dev = device;
6666

6767
int nj = address_j.size();
68+
69+
if (nj > nj_max) {
70+
fprintf(stdout, "ERROR: nj = %d exceeds GPU capacity nj_max = %d\n", nj, nj_max);
71+
abort;
72+
}
6873

6974
CUDA_SAFE_CALL(cudaMemcpy( dev.address_j, &address_j[0], nj * sizeof(int), cudaMemcpyHostToDevice));
7075
CUDA_SAFE_CALL(cudaMemcpy( &dev.t_j [nj_max], &t_j[0], nj * sizeof(DS2), cudaMemcpyHostToDevice));

src/amuse/support/options.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
from amuse.support.core import late
88
from amuse.support import exceptions
99

10-
try:
11-
import pkg_resources
12-
except ImportError:
13-
pkg_resources = None
14-
1510

1611
class GlobalOptions:
1712
INSTANCE = None
@@ -21,11 +16,6 @@ def __init__(self):
2116
self.overriden_options = {}
2217

2318
def load(self, preloadfp=None):
24-
if pkg_resources is not None:
25-
if pkg_resources.resource_exists("amuse", "amuserc"):
26-
resourcerc = pkg_resources.resource_filename("amuse", "amuserc")
27-
self.config.read(resourcerc)
28-
2919
rootrc = os.path.join(self.amuse_rootdirectory, self.rcfilename)
3020
self.config.read(rootrc)
3121

src/amuse_gadget2/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ build_%:
2424
build_%/makefile_options: makefile_options_% | build_%
2525
cp makefile_options_$* $@
2626

27-
build_%/$(CODELIB) build_%/allvars.o &: build_%/makefile_options FORCE
27+
build_%/$(CODELIB): build_%/makefile_options FORCE
2828
$(MAKE) -C build_$* -f ../src/Makefile -j $(CPU_COUNT) all VPATH=../src
2929

30+
build_%/allvars.o: build_%/$(CODELIB) FORCE
31+
@true
32+
3033

3134
# Load code configuration
3235
OPT :=

src/amuse_mesa_r15140/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ src/bin/fpx3_deps: | src/fpx3_deps
114114

115115
$(MESA_DIR)/utils/makedepf90-2.8.8: | $(MESA_DIR)
116116
cd $(MESA_DIR)/utils && tar xzf makedepf90-2.8.8.tar.gz -m
117+
touch $(MESA_DIR)/utils/makedepf90-2.8.8/configure
117118

118119
src/bin/makedepf90: | $(MESA_DIR)/utils/makedepf90-2.8.8 src/bin
119120
touch $(MESA_DIR)/utils/makedepf90-2.8.8/configure

src/amuse_ph4/interface.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,3 +936,9 @@ int get_id_of_updated_particle(int index, int * index_of_particle, int * status)
936936
*status = jd->UpdatedParticles[index].status;
937937
return 0;
938938
}
939+
940+
int get_nj_max(int * value)
941+
{
942+
*value = jd->get_nj_max();
943+
return 0;
944+
}

src/amuse_ph4/interface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,13 @@ def recompute_timesteps():
464464
function.result_type = 'int32'
465465
return function
466466

467+
@legacy_function
468+
def get_nj_max():
469+
function = LegacyFunctionSpecification()
470+
function.addParameter('nj_max', dtype='int32',
471+
direction=function.OUT)
472+
function.result_type = 'int32'
473+
return function
467474

468475
class ph4(GravitationalDynamics,GravityFieldCode):
469476

0 commit comments

Comments
 (0)