From b4ea6bf9c3bb07f5642f6ecda9a1639da252606a Mon Sep 17 00:00:00 2001 From: Rafael Ravedutti <rafaelravedutti@gmail.com> Date: Wed, 22 Feb 2023 00:42:16 +0100 Subject: [PATCH] Update Makefile and do not use graphviz for now Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com> --- Makefile | 23 ++++++++++++++--------- src/pairs/sim/simulation.py | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 4fa66c9..d2f5783 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,36 @@ .PHONY: all build clean +PYCMD=python3 +CC=mpicxx +NVCC=nvcc +CUDA_PATH=/apps/SPACK/0.18.0/opt/linux-almalinux8-zen/gcc-8.5.0/cuda-11.6.2-mlkhyhqwqk7cyltlmvw7n4ofdui5ocup + all: clean build lj_cpu lj_gpu @echo "Everything was done!" build: @echo "Building pairs package..." - python3 setup.py build && python3 setup.py install --user + $(PYCMD) setup.py build && $(PYCMD) setup.py install --user lj_ns.cpp: @echo "Generating and compiling Lennard-Jones example for CPU..." - python3 examples/lj_func.py cpu + $(PYCMD) examples/lj_func.py cpu lj_ns.cu: @echo "Generating and compiling Lennard-Jones example for GPU..." - python3 examples/lj_func.py gpu + $(PYCMD) examples/lj_func.py gpu # Targets lj_cpu: lj_ns.cpp # g++ -o lj_cpu lj_ns.cpp -DDEBUG - mpic++ -O3 -o lj_cpu lj_ns.cpp runtime/pairs.cpp runtime/domain/regular_6d_stencil.cpp runtime/devices/dummy.cpp -DDEBUG + $(CC) -O3 -o lj_cpu lj_ns.cpp runtime/pairs.cpp runtime/domain/regular_6d_stencil.cpp runtime/devices/dummy.cpp -DDEBUG lj_gpu: lj_ns.cu - mpic++ -c -o pairs.o runtime/pairs.cpp -DDEBUG - mpic++ -c -o regular_6d_stencil.o runtime/domain/regular_6d_stencil.cpp -DDEBUG - nvcc -c -o cuda_runtime.o runtime/devices/cuda.cu -DDEBUG - nvcc -c -o lj_gpu.o lj_ns.cu -DDEBUG - mpic++ -o lj_gpu lj_gpu.o cuda_runtime.o pairs.o regular_6d_stencil.o -lcudart -L/usr/local/cuda/lib64 + $(CC) -c -o pairs.o runtime/pairs.cpp -DDEBUG + $(CC) -c -o regular_6d_stencil.o runtime/domain/regular_6d_stencil.cpp -DDEBUG + $(NVCC) -c -o cuda_runtime.o runtime/devices/cuda.cu -DDEBUG + $(NVCC) -c -o lj_gpu.o lj_ns.cu -DDEBUG + $(CC) -o lj_gpu lj_gpu.o cuda_runtime.o pairs.o regular_6d_stencil.o -lcudart -L$(CUDA_PATH)/lib64 clean: @echo "Cleaning..." diff --git a/src/pairs/sim/simulation.py b/src/pairs/sim/simulation.py index 495b5b9..027124c 100644 --- a/src/pairs/sim/simulation.py +++ b/src/pairs/sim/simulation.py @@ -9,7 +9,7 @@ from pairs.ir.properties import Properties from pairs.ir.symbols import Symbol from pairs.ir.types import Types from pairs.ir.variables import Variables -from pairs.graph.graphviz import ASTGraph +#from pairs.graph.graphviz import ASTGraph from pairs.mapping.funcs import compute from pairs.sim.arrays import ArraysDecl from pairs.sim.cell_lists import CellLists, CellListsBuild, CellListsStencilBuild @@ -284,5 +284,5 @@ class Simulation: # For this part on, all bin ops are generated without usage verification self.check_decl_usage = False - ASTGraph(self.functions, "functions").render() + #ASTGraph(self.functions, "functions").render() self.code_gen.generate_program(program) -- GitLab