Skip to content

Instantly share code, notes, and snippets.

@AxoyTO
Created March 27, 2022 16:37
Show Gist options
  • Select an option

  • Save AxoyTO/e19a0e1c6c9e927a29d77c39d788906a to your computer and use it in GitHub Desktop.

Select an option

Save AxoyTO/e19a0e1c6c9e927a29d77c39d788906a to your computer and use it in GitHub Desktop.
Makefile to run C++11 MPI Project
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