diff --git a/llo-index.yml b/llo-index.yml new file mode 100644 index 0000000..b07b12f --- /dev/null +++ b/llo-index.yml @@ -0,0 +1,50 @@ +--- # Programming language + name: "mpi" + language: "c" + created-at: "21-07-2020" + creator: "root Apostolos" + git_url: "https://git.swarmlab.io:3000/labs/examples-mpi2.git" + base_dir: "examples-mpi2" + llospec0: + display_name: "title" + dir: "llo" + swarmlabservice: "os2" + info: + subdir: "" + asciidoc: "adoc" + file: "nmap.adoc" + mimetype: "text/x-python" + code: + subdir: "" + lang: "c" + version: "2" + file: "squares.c" + options: "" + mimetype: "text/plain" + challenge: + subdir: "" + question: "q-info.sh" + codehelp: "codehelp.sh" + codeanswer: "codeanswer.sh" + points: "1" # ELO + mimetype: "text/x-python" + llospec1: + display_name: "title1" + dir: "net1" + swarmlabservice: "os21" + info: + asciidoc: "adoc1" + file: "nmap.adoc1" + mimetype: "text/x-python" + code: + lang: "bash1" + version: "21" + file: "nmap.sh1" + options: " -c " + mimetype: "text/x-python" + challenge: + question: "q-info.sh1" + codehelp: "codehelp.sh1" + codeanswer: "codeanswer.sh1" + points: "1" # ELO + mimetype: "text/x-python" diff --git a/swarmlab/llo/squares.c b/swarmlab/llo/squares.c new file mode 100644 index 0000000..e37fcea --- /dev/null +++ b/swarmlab/llo/squares.c @@ -0,0 +1,60 @@ +#include +#include "mpi.h" + +main(int argc, char** argv) +{ + int my_rank; + int p,k,res,finres,num; + int source,target; + int tag1=50, tag2=60, tag3=70; + int plithos; + int data[100]; + int data_loc[100]; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); + MPI_Comm_size(MPI_COMM_WORLD, &p); + + if (my_rank == 0) { + printf("Dose plithos aritmon:\n"); + scanf("%d", &plithos); + printf("Dose tous %d arithmous:\n", plithos); + for (k=0; k