From bfd754e22c4744785c8b91ef6cd45c9252f9dd1f Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Sat, 13 Feb 2021 14:34:54 -0500
Subject: [PATCH] Add valgrind makefile command

I'm not sure if it's very helpful with MPI, but at least it's there
---
 makefile                |  6 ++++++
 valgrind_supression.txt | 12 ++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 valgrind_supression.txt

diff --git a/makefile b/makefile
index 3aafc50..595fb14 100644
--- a/makefile
+++ b/makefile
@@ -29,3 +29,9 @@ all: $(TARGET)
 # Compile target if dependencies update. Then run.
 run: $(TARGET)
 	@$(EXE) -n $(CORES) --oversubscribe ./$(TARGET) $(ARGS)
+
+
+# Compile target if dependencies update. Then run.
+valgrind: $(TARGET)
+	@rm ./logs/*
+	@$(EXE) -n $(CORES) --oversubscribe valgrind --leak-check=full --suppressions=valgrind_supression.txt --log-file=./logs/vg.%p ./$(TARGET) $(ARGS)
diff --git a/valgrind_supression.txt b/valgrind_supression.txt
new file mode 100644
index 0000000..e97463d
--- /dev/null
+++ b/valgrind_supression.txt
@@ -0,0 +1,12 @@
+{
+   ignore_unversioned_libs
+   Memcheck:Leak
+   ...
+   obj:*/lib*/lib*.so
+}
+{
+   ignore_versioned_libs
+   Memcheck:Leak
+   ...
+   obj:*/lib*/lib*.so.*
+}
-- 
GitLab