forked from davidzarruk/Parallel_Computing
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile~
44 lines (31 loc) · 907 Bytes
/
Makefile~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Home directory
HOMET=/home/davidza/
# Ask the number of cores to be used in the parallelization:
CORES := $(shell bash -c 'read -p "Enter the number of cores for parallelization: " pwd; echo $$pwd')
# Execute the code for each language
cpp:
g++ Cpp_main.cpp -fopenmp -o Cpp_main
export OMP_NUM_THREADS=$(CORES); ./Cpp_main;
rm Cpp_main
julia_parallel:
julia -p$(CORES) Julia_main_parallel.jl
julia_pmap:
julia -p$(CORES) Julia_main_pmap.jl
Rcpp:
export OMP_NUM_THREADS=$(CORES); Rscript Rcpp_main.R;
R:
Rscript R_main.R $(CORES)
python:
python Python_main.py $(CORES)
matlab:
matlab -nodesktop -nodisplay -r "Matlab_main $(CORES)"
MPI:
mpic++ -g MPI_main.cpp -o main
mpirun -np $(CORES) -hostfile MPI_host_file ./main
rm main
CUDA:
export PATH=/usr/local/cuda/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
nvcc CUDA_main.cu -o main
./main
rm main