Skip to content

Commit 9533e65

Browse files
authored
read AMG files in parallel and add handler for mxm and exit
1 parent 2509d01 commit 9533e65

File tree

7 files changed

+508
-162
lines changed

7 files changed

+508
-162
lines changed

src/Makefile

+62-38
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,97 @@
11
MPI ?= 1
2+
MPIIO ?= 1
23
ADDUS ?= 1
4+
USREXIT ?= 0
35
LIBNAME ?= gs
4-
PREFIX ?= gslib
5-
CBLAS ?= 0
6-
6+
BLAS ?= 0
77
CFLAGS ?= -O2
88

9-
ifeq (0,$(MPI))
10-
LIBNAME = gsserial
11-
else
12-
CPPFLAGS += -DMPI
9+
ifneq (0,$(MPI))
10+
G+=-DMPI
11+
endif
12+
13+
ifneq (0,$(MPIIO))
14+
ifneq (0,$(MPI))
15+
G+=-DUSEMPIIO
16+
endif
1317
endif
1418

1519
ifneq (0,$(ADDUS))
16-
CPPFLAGS += -DUNDERSCORE
20+
G+=-DUNDERSCORE
21+
endif
22+
23+
ifneq (0,$(USREXIT))
24+
G+=-DUSE_USR_EXIT
25+
endif
26+
27+
ifeq (0,$(BLAS))
28+
G+=-DUSE_NAIVE_BLAS
29+
endif
30+
31+
ifeq (1,$(BLAS))
32+
G+=-DUSE_CBLAS
1733
endif
1834

19-
CPPFLAGS += -DPREFIX=$(PREFIX) -DUSE_NAIVE_BLAS -DGLOBAL_LONG_LONG -DAMG_BLOCK_ROWS=2400
20-
# CPPFLAGS += -DPRINT_MALLOCS=1
21-
# CPPFLAGS += -DGS_TIMING -DGS_BARRIER
22-
# CPPFLAGS += -DUSE_NAIVE_BLAS
35+
ifneq ($(PREFIX),)
36+
G+=-DPREFIX=$(PREFIX)
37+
endif
38+
39+
ifneq ($(FPREFIX),)
40+
G+=-DFPREFIX=$(FPREFIX)
41+
endif
2342

24-
CPPFLAGS += -I.
25-
LDLIBS += -l$(LIBNAME) -lm
26-
LDFLAGS += -L.
43+
G+=-DGLOBAL_LONG_LONG
44+
#G+=-DPRINT_MALLOCS=1
45+
#G+=-DGS_TIMING -DGS_BARRIER
2746

28-
RAND_TESTS = obbox_test findpts_el_2_test2 findpts_el_2_test findpts_el_3_test2 findpts_el_3_test \
29-
findpts_local_test findpts_test
47+
CCCMD=$(CC) $(CFLAGS) $(G)
48+
LINKCMD=$(CC) $(CFLAGS) $(G) $^ -o $@ -L./ -l$(LIBNAME) -lm $(LDFLAGS)
3049

31-
NORAND_TESTS = sort_test sort_test2 sarray_sort_test spchol_test \
50+
TESTS=sort_test sort_test2 sarray_sort_test spchol_test \
3251
comm_test crystal_test sarray_transfer_test \
33-
gs_test gs_test_old gs_unique_test \
52+
gs_test gs_unique_test \
3453
xxt_test xxt_test2 crs_test \
35-
poly_test poly_test2 lob_bnd_test
54+
findpts_el_2_test findpts_el_2_test2 \
55+
findpts_el_3_test findpts_el_3_test2 \
56+
findpts_local_test findpts_test \
57+
poly_test poly_test2 lob_bnd_test obbox_test
3658

3759
GS=gs.o sort.o sarray_transfer.o sarray_sort.o \
3860
gs_local.o fail.o crystal.o comm.o tensor.o
39-
4061
XXT=sparse_cholesky.o xxt.o
41-
4262
AMG=amg.o
43-
4463
FWRAPPER=fcrystal.o fcrs.o findpts.o
45-
4664
INTP=findpts_local.o obbox.o poly.o lob_bnd.o findpts_el_3.o findpts_el_2.o
4765

4866
.PHONY: all lib deps tests clean objects odepinfo
4967

5068
all : lib tests
5169

52-
lib: $(GS) $(XXT) $(AMG) $(FWRAPPER) $(INTP)
53-
$(AR) cr lib$(LIBNAME).a $?
54-
ranlib lib$(LIBNAME).a
70+
lib: $(GS) $(XXT) $(AMG) $(FWRAPPER) $(INTP) rand_elt_test.o
71+
@$(AR) cr lib$(LIBNAME).a $?
72+
@ranlib lib$(LIBNAME).a
73+
74+
tests: $(TESTS)
75+
76+
clean: ; @$(RM) *.o *.s *.a $(TESTS)
5577

56-
tests: $(NORAND_TESTS) $(RAND_TESTS)
78+
cmds: ; @echo CC = $(CCCMD); echo LINK = $(LINKCMD);
5779

58-
clean:
59-
$(RM) *.o *.s *.a $(TESTS)
80+
deps: ; ./cdep.py *.c > makefile.cdep;
6081

61-
deps:
62-
./cdep.py *.c > makefile.cdep;
82+
odepinfo: deps objects; @./odep_info.py *.o
6383

64-
odepinfo: deps objects
65-
@./odep_info.py *.o
84+
$(TESTS): % : %.o | lib
85+
$(LINKCMD)
6686

6787
-include makefile.cdep
6888

69-
$(NORAND_TESTS) : % : %.o lib
70-
$(CC) $(LDFLAGS) $< $(LDLIBS) -o $@
89+
%.o: %.c ; $(CCCMD) -c $< -o $@
90+
%.s: %.c ; $(CCCMD) -S $< -o $@
91+
objects: $(OBJECTS) ;
7192

72-
$(RAND_TESTS) : % : %.o rand_elt_test.o lib
73-
$(CC) $(LDFLAGS) $< rand_elt_test.o $(LDLIBS) -o $@
93+
#poly_imp.h: gen_poly_imp.c
94+
# $(RM) poly_imp.h;
95+
# $(CC) -lgmp -lm gen_poly_imp.c -o gen_poly_imp;
96+
# ./gen_poly_imp > poly_imp.h;
97+
# $(RM) gen_poly_imp

0 commit comments

Comments
 (0)