diff --git a/Makefile b/Makefile index 44945b2246ff9fa096f70c00f96e26ef7b2fc646..920c5258a790f663161bf5db06685b4843f64da3 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,13 @@ .PHONY: build clean -build: main mpi cracker - -main: - $(MAKE) -C src +build: mpi cracker mpi: $(MAKE) -C src/mpi - + cracker: $(MAKE) -C src/cracker clean: - $(MAKE) -C src clean $(MAKE) -C src/mpi clean $(MAKE) -C src/cracker clean diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 64a45daadf9ad4cfc6797b5d9ce8439e8e1f6023..0000000000000000000000000000000000000000 --- a/src/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CFLAGS += -std=c99 -pedantic -Wall -Werror -Wextra -D_FORTIFY_SOURCE=2 -O3 -fPIC -fstack-protector-all -pie -s -LDFLAGS += -lmpi -CC = mpicc -.PHONY: all clean - -all: main - -main: mpi/mpi-layer.o main.o - $(CC) -o $@ $^ $(LDFLAGS) - -%.o: %.c %.h - $(CC) $(CPPFLAGS) -c $(CFLAGS) $(LDFLAGS) -o $@ $< - -clean: - rm -f *.o diff --git a/src/main.c b/src/main.c deleted file mode 100644 index d869f4c0dd81f3e35dd4c774c2c1595d7d2e8bd2..0000000000000000000000000000000000000000 --- a/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include<stdio.h> -#include"mpi/mpi-layer.h" - -int main(int argc, char* argv[]) { - mpi_start(argc, argv); - return 0; -} diff --git a/src/mpi/Makefile b/src/mpi/Makefile index 12de88eafc17c0e9d1e119eb071e9e5fd556c502..9e9f5c3abe3939784a4c19ae4bdbde3f686dbf28 100644 --- a/src/mpi/Makefile +++ b/src/mpi/Makefile @@ -1,4 +1,5 @@ CFLAGS += -std=c99 -pedantic -Wall -Werror -Wextra -D_FORTIFY_SOURCE=2 -O3 -fPIC -fstack-protector-all -pie -s +LDFLAGS += -lmpi CC = mpicc .PHONY: all clean diff --git a/src/mpi/mpi-layer.c b/src/mpi/mpi-layer.c index e50e9cd7649bf179c511fa675d6da7ab6f020ca4..d06636efb168920d5c69fa63119a1c5e2e853f06 100644 --- a/src/mpi/mpi-layer.c +++ b/src/mpi/mpi-layer.c @@ -1,23 +1,6 @@ -#include "mpi-layer.h" +#include <stdlib.h> +#include <mpi.h> -int mpi_start (int argc, char* argv[]) { - int rank, size; - - MPI_Init(&argc, &argv); /* starts MPI */ - MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* get current process id */ - MPI_Comm_size(MPI_COMM_WORLD, &size); /* get number of processes */ - - printf("Process %d of %d: Hello!\n", rank, size); - node_logic(rank); - - //TODO: Signal handler for soft abort - MPI_Abort(MPI_COMM_WORLD, 0); - - MPI_Finalize(); - return 0; -} - -void node_logic (int rank) { - - return; +void init (void) { + return; } diff --git a/src/mpi/mpi-layer.h b/src/mpi/mpi-layer.h deleted file mode 100644 index cca3754e1272fea5b3ffd57421f1ea3472861bb8..0000000000000000000000000000000000000000 --- a/src/mpi/mpi-layer.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef MPI_INIT_H_ -#define MPI_INIT_H_ - -#include <stdlib.h> -#include <stdio.h> -#include <mpi.h> -#include <sys/wait.h> - -int mpi_start(int, char*[]); -void node_logic(int); -#endif