Skip to content

Commit

Permalink
read AMG files in parallel and add handler for mxm and exit
Browse files Browse the repository at this point in the history
  • Loading branch information
stgeke authored Oct 12, 2017
1 parent 2509d01 commit 9533e65
Show file tree
Hide file tree
Showing 7 changed files with 508 additions and 162 deletions.
100 changes: 62 additions & 38 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,73 +1,97 @@
MPI ?= 1
MPIIO ?= 1
ADDUS ?= 1
USREXIT ?= 0
LIBNAME ?= gs
PREFIX ?= gslib
CBLAS ?= 0

BLAS ?= 0
CFLAGS ?= -O2

ifeq (0,$(MPI))
LIBNAME = gsserial
else
CPPFLAGS += -DMPI
ifneq (0,$(MPI))
G+=-DMPI
endif

ifneq (0,$(MPIIO))
ifneq (0,$(MPI))
G+=-DUSEMPIIO
endif
endif

ifneq (0,$(ADDUS))
CPPFLAGS += -DUNDERSCORE
G+=-DUNDERSCORE
endif

ifneq (0,$(USREXIT))
G+=-DUSE_USR_EXIT
endif

ifeq (0,$(BLAS))
G+=-DUSE_NAIVE_BLAS
endif

ifeq (1,$(BLAS))
G+=-DUSE_CBLAS
endif

CPPFLAGS += -DPREFIX=$(PREFIX) -DUSE_NAIVE_BLAS -DGLOBAL_LONG_LONG -DAMG_BLOCK_ROWS=2400
# CPPFLAGS += -DPRINT_MALLOCS=1
# CPPFLAGS += -DGS_TIMING -DGS_BARRIER
# CPPFLAGS += -DUSE_NAIVE_BLAS
ifneq ($(PREFIX),)
G+=-DPREFIX=$(PREFIX)
endif

ifneq ($(FPREFIX),)
G+=-DFPREFIX=$(FPREFIX)
endif

CPPFLAGS += -I.
LDLIBS += -l$(LIBNAME) -lm
LDFLAGS += -L.
G+=-DGLOBAL_LONG_LONG
#G+=-DPRINT_MALLOCS=1
#G+=-DGS_TIMING -DGS_BARRIER

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

NORAND_TESTS = sort_test sort_test2 sarray_sort_test spchol_test \
TESTS=sort_test sort_test2 sarray_sort_test spchol_test \
comm_test crystal_test sarray_transfer_test \
gs_test gs_test_old gs_unique_test \
gs_test gs_unique_test \
xxt_test xxt_test2 crs_test \
poly_test poly_test2 lob_bnd_test
findpts_el_2_test findpts_el_2_test2 \
findpts_el_3_test findpts_el_3_test2 \
findpts_local_test findpts_test \
poly_test poly_test2 lob_bnd_test obbox_test

GS=gs.o sort.o sarray_transfer.o sarray_sort.o \
gs_local.o fail.o crystal.o comm.o tensor.o

XXT=sparse_cholesky.o xxt.o

AMG=amg.o

FWRAPPER=fcrystal.o fcrs.o findpts.o

INTP=findpts_local.o obbox.o poly.o lob_bnd.o findpts_el_3.o findpts_el_2.o

.PHONY: all lib deps tests clean objects odepinfo

all : lib tests

lib: $(GS) $(XXT) $(AMG) $(FWRAPPER) $(INTP)
$(AR) cr lib$(LIBNAME).a $?
ranlib lib$(LIBNAME).a
lib: $(GS) $(XXT) $(AMG) $(FWRAPPER) $(INTP) rand_elt_test.o
@$(AR) cr lib$(LIBNAME).a $?
@ranlib lib$(LIBNAME).a

tests: $(TESTS)

clean: ; @$(RM) *.o *.s *.a $(TESTS)

tests: $(NORAND_TESTS) $(RAND_TESTS)
cmds: ; @echo CC = $(CCCMD); echo LINK = $(LINKCMD);

clean:
$(RM) *.o *.s *.a $(TESTS)
deps: ; ./cdep.py *.c > makefile.cdep;

deps:
./cdep.py *.c > makefile.cdep;
odepinfo: deps objects; @./odep_info.py *.o

odepinfo: deps objects
@./odep_info.py *.o
$(TESTS): % : %.o | lib
$(LINKCMD)

-include makefile.cdep

$(NORAND_TESTS) : % : %.o lib
$(CC) $(LDFLAGS) $< $(LDLIBS) -o $@
%.o: %.c ; $(CCCMD) -c $< -o $@
%.s: %.c ; $(CCCMD) -S $< -o $@
objects: $(OBJECTS) ;

$(RAND_TESTS) : % : %.o rand_elt_test.o lib
$(CC) $(LDFLAGS) $< rand_elt_test.o $(LDLIBS) -o $@
#poly_imp.h: gen_poly_imp.c
# $(RM) poly_imp.h;
# $(CC) -lgmp -lm gen_poly_imp.c -o gen_poly_imp;
# ./gen_poly_imp > poly_imp.h;
# $(RM) gen_poly_imp
Loading

0 comments on commit 9533e65

Please sign in to comment.