Skip to content
Extraits de code Groupes Projets
Valider d8101475 rédigé par Thomas DILASSER's avatar Thomas DILASSER
Parcourir les fichiers

added directory containing test files

In order to add a new test, .c file has to be added to tests/
and a new target should be added in the Makefile
parent d0ab2f97
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #1126 annulé
all: plugin
all: TEST1 TEST2 TEST3 TEST4
TEST1=./tests/simple_test1.c
TEST2=./tests/simple_test2.c
TEST3=./tests/split_bloc.c
TEST4=./tests/pragma_test.c
FILE=main.c prog_test.c
PLUGIN=plugin.cpp
CXX=g++_810
CC=gcc_810
......@@ -15,8 +19,14 @@ CFLAGS=-g -O3
libplugin.so: $(PLUGIN)
$(CXX) $(PLUGIN_FLAGS) -o $@ $<
plugin: libplugin.so prog_test.c
$(MPICC) prog_test.c $(CFLAGS) -o $@ -fplugin=./$<
TEST1: libplugin.so $(TEST1)
$(MPICC) $(TEST1) $(CFLAGS) -o $@ -fplugin=./$<
TEST2: libplugin.so $(TEST2)
$(MPICC) $(TEST2) $(CFLAGS) -o $@ -fplugin=./$<
TEST3: libplugin.so $(TEST3)
$(MPICC) $(TEST3) $(CFLAGS) -o $@ -fplugin=./$<
TEST4: libplugin.so $(TEST4)
$(MPICC) $(TEST4) $(CFLAGS) -o $@ -fplugin=./$<
%.pdf: %.dot
dot -Tpdf $< -o $@
......@@ -24,6 +34,7 @@ plugin: libplugin.so prog_test.c
clean:
rm -rf *.pgr *.pdf plugin
rm -rf libplugin.so *.dot plugin
rm -rf TEST*
clean_all: clean
rm -rf libplugin.so *.dot plugin
Fichier déplacé
......@@ -3,7 +3,7 @@
* \brief TEST PLUGIN
*/
#include <stdio.h>
#include "prog_test.h"
#include "pragma_test.h"
#pragma instrumente function mock1
#pragma instrumente function mock2
......
Fichier déplacé
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
void mpi_call(int c)
{
MPI_Barrier(MPI_COMM_WORLD);
if(c<10)
{
printf("je suis dans le if (c=%d)\n", c);
}
else
{
printf("je suis dans le else (c=%d)\n", c);
}
}
int main(int argc, char * argv[])
{
MPI_Init(&argc, &argv);
int i;
int a = 2;
int b = 3;
int c=0;
for(i=0; i<10; i++)
{
mpi_call(c);
c+= (a+b);
}
printf("c=%d\n", c);
MPI_Finalize();
return 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
void mpi_call(int c)
{
MPI_Barrier(MPI_COMM_WORLD);
if(c<10)
{
printf("je suis dans le if (c=%d)\n", c);
MPI_Barrier(MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
}
else
{
printf("je suis dans le else (c=%d)\n", c);
MPI_Barrier(MPI_COMM_WORLD);
}
}
int main(int argc, char * argv[])
{
MPI_Init(&argc, &argv);
int i;
int a = 2;
int b = 3;
int c=0;
for(i=0; i<10; i++)
{
mpi_call(c);
c+= (a+b);
}
printf("c=%d\n", c);
MPI_Finalize();
return 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
int main(int argc, char * argv[])
{
MPI_Init(&argc, &argv);
int i;
int a = 2;
int b = 3;
int c=0;
for(i=0; i<10; i++)
{
MPI_Barrier(MPI_COMM_WORLD);
if(c<10)
{
printf("je suis dans le if (c=%d)\n", c);
MPI_Barrier(MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
if(c <5)
{
a = a*a +1;
}
else
{
c = c*3;
if(c <20)
{
return c;
}
}
}
else
{
printf("je suis dans le else (c=%d)\n", c);
MPI_Barrier(MPI_COMM_WORLD);
return 1;
}
c+= (a+b);
printf("fin du for\n");
}
printf("c=%d\n", c);
MPI_Finalize();
return 1;
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter