Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
Projet 3 - Q6
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneur
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Giovanna Stefanelli
Projet 3 - Q6
Validations
14040ae8
Valider
14040ae8
rédigé
5 years ago
par
Giovanna Stefanelli
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Update README.txt
parent
fb416ed8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline
#6171
en échec
5 years ago
Étape : external
Modifications
1
Pipelines
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
README.txt
+35
-9
35 ajouts, 9 suppressions
README.txt
avec
35 ajouts
et
9 suppressions
README.txt
+
35
−
9
Voir le fichier @
14040ae8
README
README
Program: "fact"
Program
me
: "fact"
## TABLE OF CONTENTS
## TABLE OF CONTENTS
* [0. General Info]
* [0. General Info]
...
@@ -28,21 +28,45 @@ the programme "fact" can be updated by changing the constant MAX_NO_THREADS
...
@@ -28,21 +28,45 @@ the programme "fact" can be updated by changing the constant MAX_NO_THREADS
## 1. Installation Steps
## 1. Installation Steps
The programme directory includes 4 files:
The programme directory includes several files, a list is provided herebelow:
a. the C programme file "fact.c"
a. The C programme file "fact.c"
b. the "Makefile" with three basic "make" operations:
b. The "Makefile" with three basic "make" operations:
- "make fact" compiles "fact.c" and create the executable "fact"
- "make fact" compiles "fact.c" and create the executable "fact"
- "make test" compiles "fact.c" and performs the unit tests
(Note: in Windows we have "fact.exe")
- "make test" compiles "Fact_UnitTest.c", the unit tests are performed
with the command "make cunit", (Note: in Windows we have "Fact_UnitTest.exe").
- "make clean" deletes the executable "fact", all the output files
- "make clean" deletes the executable "fact", all the output files
with the prefix "out" (e.g. output.txt, out_result.txt, out.txt, ...)
with the prefix "out" (e.g. output.txt, out_result.txt, out.txt, ...)
and the files produced by unit tests.
and the files produced by unit tests.
c. the input file "example_input.txt" contains the numbers to be factorized (one
To these basic operations more tags are provided, in particular:
- "make cunit" prepares the environment and execute the Cunit test
on the main "fact" functions. The result is redirected into the file
"Cunit_test_file.txt"
- "make valgrind" executes the tool valgrind on "fact" and the results
are redirected into the file "valgrind_fact.txt"
- "make cppcheck" executes the tool cppcheck on "fact" and the results
are redirected into the file "cppcheck_fact.txt".
- "make valgrind_cunit" executes the tool valgrind on "Fact_UnitTest"
and the results are redirected into the file "valgrind_cunit.txt".
- "make cppcheck_cunit" executes the tool cppcheck on "Fact_UnitTest"
and the results are redirected into the file "cppcheck_cunit.txt".
c. The input file "example_input.txt" contains the numbers to be factorized (one
per line). This file allows to verify the correct calculation by comparing the
per line). This file allows to verify the correct calculation by comparing the
ouput with the results stored into another file: "example_output.txt".
ouput with the results stored into another file: "example_output.txt".
Note: "example_input.txt" and "example_output.txt" are the files provided by
Note: "example_input.txt" and "example_output.txt" are the files provided by
the project specification (at the initial project stage). These files
the project specification (at the initial project stage). These files
are not deleted by "make clean".
are not deleted by "make clean".
d. The input file "incorrect_numbers.txt" contains numbers out of the scope of the
programme fact (e.g. numbers < 2). This file can be used for testing purposes.
e. The file "Fact_UnitTest.c" contains the unit tests code exploiting the facility
of the "CUnit" library.
f. The files "valgrind_fact.txt", "cppcheck_fact.txt" and "Cunit_test_file.txt"
are the output of valgrind, cppcheck tools and CUnit tests.
## 2. Programme General Architecture
## 2. Programme General Architecture
...
@@ -123,7 +147,7 @@ As drawn in the scheme of the "Programme General Architecture" the programme
...
@@ -123,7 +147,7 @@ As drawn in the scheme of the "Programme General Architecture" the programme
because the function "is_prime" is more cpu time demanding.
because the function "is_prime" is more cpu time demanding.
-> bool is_prime(unsigned long nbr)
-> bool is_prime(unsigned long nbr)
This function determines if a number is prime. To speed up the
This function determines if a number is prime. To speed up the
computation, the algorithm is based on the "Crible d'
É
ratosth
è
ne"
computation, the algorithm is based on the "Crible d'
É
ratosth
è
ne"
(see "https://fr.wikipedia.org/wiki/Nombre_premier")
(see "https://fr.wikipedia.org/wiki/Nombre_premier")
-> bool is_div(unsigned long numbr, unsigned long i)
-> bool is_div(unsigned long numbr, unsigned long i)
This function exploits the operator "%" (modulo) to determine if
This function exploits the operator "%" (modulo) to determine if
...
@@ -131,7 +155,9 @@ As drawn in the scheme of the "Programme General Architecture" the programme
...
@@ -131,7 +155,9 @@ As drawn in the scheme of the "Programme General Architecture" the programme
Finally, the "main" is charged to check the programme arguments correctness
Finally, the "main" is charged to check the programme arguments correctness
(argc and argv[]) and, in case of error, a message is provided to
(argc and argv[]) and, in case of error, a message is provided to
the user. The "main" performs the following sequential actions:
the user. The "fact" programme cannot calculate numbers < 2, a warning is
provided.
The "main" performs the following sequential actions:
- the start of cpu time,
- the start of cpu time,
- the input and output files are opened, in case of error this is reported,
- the input and output files are opened, in case of error this is reported,
- the mutex is initialised,
- the mutex is initialised,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter