Created
March 27, 2022 16:37
-
-
Save AxoyTO/e19a0e1c6c9e927a29d77c39d788906a to your computer and use it in GitHub Desktop.
Makefile to run C++11 MPI Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHELL = /bin/bash # -> IBM POLUS | |
| #SHELL = /bin/sh # -> MY COMPUTER | |
| SRC = main.cpp functions.cpp | |
| BIN = main | |
| C++FLAGS = -o $(BIN) -std=c++11 | |
| C++ = mpic++ | |
| #C++POLUS = xlc++ | mpixlc | |
| DATE = $(shell date +%d/%m/%y) | |
| POLUS_MPI_SOURCE = $(shell . mpi_source.sh) | |
| .PHONY: all compile run test clean | |
| all: compile | |
| # -echo $${POLUS_MPI_SOURCE} | |
| # $(MAKE) compile | |
| compile: | |
| @echo " * Compiling" | |
| -$(C++) $(SRC) $(C++FLAGS) | |
| # -$(C++POLUS) $(SRC) $(C++FLAGS) | |
| @echo " * Created on: $(DATE)" | |
| @echo " * Author: Aksoy Tevfik Oguzhan, 323" | |
| run: | |
| mpirun -np $(p) ./main $(s) | |
| @# P = Processes | |
| @# S = SIZE | |
| #test1: | |
| # mpirun -n 4 ./main 4 | |
| #For local test run | |
| clean: | |
| rm $(BIN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment