Makefile 591 B

12345678910111213141516171819202122232425262728
  1. CC=gcc
  2. XMPCC=xmpcc
  3. LIBS=-L/usr/lib -lmpi
  4. INCL=-I /usr/lib/openmpi/include
  5. OBJM=manager-spawn.o
  6. OBJW=init.o
  7. all: manager worker_program
  8. manager-spawn.o: manager-spawn.c
  9. $(CC) -c $(INCL) manager-spawn.c
  10. init.o: init.c
  11. $(XMPCC) -c init.c
  12. manager: $(OBJM)
  13. $(CC) -o manager $(OBJM) $(LIBS)
  14. worker_program: $(OBJW)
  15. $(XMPCC) -o worker_program $(OBJW) $(LIBS)
  16. run: worker_program
  17. cp worker_program /usr/local/var/mpishare
  18. mpirun -host mpihead,mpinode1,mpinode2,mpinode3 -n 4 /usr/local/var/mpishare/worker_program
  19. clean:
  20. rm *.o manager worker_program