Skip to content
Snippets Groups Projects
Commit f6569110 authored by Josef Ilg's avatar Josef Ilg
Browse files

Revert "add standard functions of MPI + std main file"

This reverts commit d06f8d5b
parent d06f8d5b
No related branches found
No related tags found
1 merge request!1Revert "add standard functions of MPI + std main file"
.PHONY: build clean .PHONY: build clean
build: main mpi cracker build: mpi cracker
main:
$(MAKE) -C src
mpi: mpi:
$(MAKE) -C src/mpi $(MAKE) -C src/mpi
...@@ -12,6 +9,5 @@ cracker: ...@@ -12,6 +9,5 @@ cracker:
$(MAKE) -C src/cracker $(MAKE) -C src/cracker
clean: clean:
$(MAKE) -C src clean
$(MAKE) -C src/mpi clean $(MAKE) -C src/mpi clean
$(MAKE) -C src/cracker clean $(MAKE) -C src/cracker clean
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
#include<stdio.h>
#include"mpi/mpi-layer.h"
int main(int argc, char* argv[]) {
mpi_start(argc, argv);
return 0;
}
CFLAGS += -std=c99 -pedantic -Wall -Werror -Wextra -D_FORTIFY_SOURCE=2 -O3 -fPIC -fstack-protector-all -pie -s CFLAGS += -std=c99 -pedantic -Wall -Werror -Wextra -D_FORTIFY_SOURCE=2 -O3 -fPIC -fstack-protector-all -pie -s
LDFLAGS += -lmpi
CC = mpicc CC = mpicc
.PHONY: all clean .PHONY: all clean
......
#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) {
void init (void) {
return; return;
} }
#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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment