Advertisement
Guest User

Untitled

a guest
Jul 25th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.77 KB | None | 0 0
  1. CFLAGS= -g -O3
  2. DEPS =
  3. OBJOMP = bucketomp.o
  4. OBJPT = bucketpt.o
  5. LIBOMP = -fopenmp
  6. LIBPT = -ggdb -pthread
  7.  
  8. ini: run1 run2 clean
  9.  
  10. bucketomp.o: bucketomp.c $(DEPS)
  11.     $(CC) $(CFLAGS) -c -o $@ $< $(LIBOMP)
  12. bucketpt.o: bucketpt.c $(DEPS)
  13.     $(CC) $(CFLAGS) -c -o $@ $< $(LIBPT)
  14.  
  15. bucketomp: $(OBJOMP)
  16.     gcc $(CFLAGS) -o $@ $^ $(LIBOMP)
  17. bucketpt: $(OBJPT)
  18.     gcc $(CFLAGS) -o $@ $^ $(LIBPT)
  19.  
  20.  
  21. run1: bucketomp
  22.     echo Utilizando OpenMP: > resultado.txt
  23.     echo 1 Thread: >> resultado.txt
  24.     ./bucketomp 1000 1 >> resultado.txt
  25.     ./bucketomp 10000 1 >> resultado.txt
  26.     ./bucketomp 20000 1 >> resultado.txt
  27.     echo 2 Threads: >> resultado.txt
  28.     ./bucketomp 1000 2 >> resultado.txt
  29.     ./bucketomp 10000 2 >> resultado.txt
  30.     ./bucketomp 20000 2 >> resultado.txt
  31.     echo 4 Threads: >> resultado.txt
  32.     ./bucketomp 1000 4 >> resultado.txt
  33.     ./bucketomp 10000 4 >> resultado.txt
  34.     ./bucketomp 20000 4 >> resultado.txt
  35.     echo 8 Threads: >> resultado.txt
  36.     ./bucketomp 1000 8 >> resultado.txt
  37.     ./bucketomp 10000 8 >> resultado.txt
  38.     ./bucketomp 20000 8 >> resultado.txt
  39.     echo --------------------------------- >> resultado.txt
  40.  
  41. run2: bucketpt
  42.     echo Utilizando PThread: >> resultado.txt
  43.     echo 1 Thread: >> resultado.txt
  44.     ./bucketpt 1000 1 >> resultado.txt
  45.     ./bucketpt 10000 1 >> resultado.txt
  46.     ./bucketpt 20000 1 >> resultado.txt
  47.     echo 2 Threads: >> resultado.txt
  48.     ./bucketpt 1000 2 >> resultado.txt
  49.     ./bucketpt 10000 2 >> resultado.txt
  50.     ./bucketpt 20000 2 >> resultado.txt
  51.     echo 4 Threads: >> resultado.txt
  52.     ./bucketpt 1000 4 >> resultado.txt
  53.     ./bucketpt 10000 4 >> resultado.txt
  54.     ./bucketpt 20000 4 >> resultado.txt
  55.     echo 8 Threads: >> resultado.txt
  56.     ./bucketpt 1000 8 >> resultado.txt
  57.     ./bucketpt 10000 8 >> resultado.txt
  58.     ./bucketpt 20000 8 >> resultado.txt
  59. clean:
  60.     rm *.o
  61.     rm bucketomp
  62.     rm bucketpt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement