From 0fe553c5a8676a6be01b179e2ad1f549f4ae2fa2 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Sun, 3 Mar 2024 19:10:03 +0100 Subject: [PATCH] stuff --- .gitmodules | 3 +++ Makefile | 14 ++++++++++---- deps/psblas | 1 + psblas-example.f90 | 22 ++++++++++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) create mode 160000 deps/psblas create mode 100644 psblas-example.f90 diff --git a/.gitmodules b/.gitmodules index 22ca580..10f75bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = deps/petsc url = https://gitlab.com/petsc/petsc.git branch = release +[submodule "deps/psblas"] + path = deps/psblas + url = https://github.com/sfilippone/psblas3.git diff --git a/Makefile b/Makefile index cdccf03..016e6d7 100644 --- a/Makefile +++ b/Makefile @@ -21,13 +21,17 @@ CUDAC_FLAGS := $(shell pkg-config --variable=cudaflags_extra $(PACKAGES)) CUDA_LIB := $(shell pkg-config --variable=cudalib $(PACKAGES)) CUDA_INCLUDE := $(shell pkg-config --variable=cudainclude $(PACKAGES)) -all: setup ./bin/main +all: setup deps ./bin/main setup: mkdir -p bin mkdir -p deps - cd deps/petsc && ./configure - cd deps/petsc && make + +deps: deps/petsc deps/psblas + +deps/%: + cd $@ && ./configure + cd $@ && make print: @echo ====== PETSc ====== @@ -52,8 +56,10 @@ print: @echo CUDA_LIB=$(CUDA_LIB) @echo CUDA_INCLUDE=$(CUDA_INCLUDE) -bin/% : %.c +bin/%: %.c $(LINK.cc) -o $@ $^ $(LDLIBS) +bin/%.o: %.f90 + $(FC) $(OUTPUT_OPTION) $< bin/%.o: %.cxx $(COMPILE.cc) $(OUTPUT_OPTION) $< bin/%.o: %.c diff --git a/deps/psblas b/deps/psblas new file mode 160000 index 0000000..8633e76 --- /dev/null +++ b/deps/psblas @@ -0,0 +1 @@ +Subproject commit 8633e76cb0a7c5a7e8090de1496f1515b83df319 diff --git a/psblas-example.f90 b/psblas-example.f90 new file mode 100644 index 0000000..27777d7 --- /dev/null +++ b/psblas-example.f90 @@ -0,0 +1,22 @@ +program hello + implicit none + type(psb_ctxt_type) :: icontxt + integer(psb_ipk_) :: iam, np, ip, jp, idummy + + call psb_init(icontxt) + call psb_info(icontxt,iam,np) + ! have all processes check in + if ((iam >= 0).and.(iam < np)) then + if (iam == 0) then + do ip = 1, np-1 + call psb_rcv(icontxt,idummy,ip) + enddo + write(*,*) 'Hello, world: all ',np, & + & ' processes checked in!' + else + ip = 0 + call psb_snd(icontxt,idummy,ip) + endif + end if + call psb_exit(icontxt) +end program hello \ No newline at end of file