generated from feelpp/feelpp-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from feelpp/139-add-integration-tests-for-ci
139 add integration tests for ci
- Loading branch information
Showing
12 changed files
with
272 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"machine": "gaya", | ||
"targets":["production:builtin:"], | ||
// "partitions":["*"], | ||
// "platform":"apptainer", | ||
// "prog_environments":["*"], | ||
"execution_policy": "async", | ||
"reframe_base_dir":"$PWD/build/reframe", | ||
"reports_base_dir":"$PWD/reports/", | ||
"input_dataset_base_dir":"$PWD", | ||
"output_app_dir":"$PWD", | ||
"containers":{ | ||
"apptainer":{ | ||
"image_base_dir":"/data/scratch/", | ||
"options":[ | ||
"--sharens", | ||
"--bind /opt/:/opt/" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"executable": "{{machine.input_dataset_base_dir}}/tests/data/parallelSum", | ||
"output_directory": "{{machine.output_app_dir}}/tests/data/outputs/parallelSum", | ||
"use_case_name": "parallel_sum", | ||
"timeout":"0-0:5:0", | ||
"options": [ | ||
"{{parameters.elements.value}}", | ||
"{{output_directory}}/{{instance}}" | ||
], | ||
"outputs": [ | ||
{ | ||
"filepath":"{{output_directory}}/{{instance}}/outputs.csv", | ||
"format":"csv" | ||
} | ||
], | ||
"scalability": { | ||
"directory": "{{output_directory}}/{{instance}}/", | ||
"stages": [ | ||
{ | ||
"name":"", | ||
"filepath": "scalability.json", | ||
"format": "json", | ||
"variables_path":"*" | ||
} | ||
] | ||
}, | ||
"sanity": { | ||
"success": ["[SUCCESS]"], | ||
"error": ["[OOPSIE]","Error"] | ||
}, | ||
"parameters": [ | ||
{ | ||
"name": "nb_tasks", | ||
"sequence": [ | ||
{"tasks" : 1, "exclusive_access":true}, | ||
{"tasks" : 2, "exclusive_access":true}, | ||
{"tasks" : 4, "exclusive_access":true}, | ||
{"tasks" : 8, "exclusive_access":true}, | ||
{"tasks" : 16, "exclusive_access":true} | ||
] | ||
}, | ||
{ | ||
"name":"elements", | ||
"linspace":{ | ||
"min":100000000, | ||
"max":1000000000, | ||
"n_steps":4 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"plots":[ | ||
{ | ||
"title": "Absolute performance", | ||
"plot_types": [ "stacked_bar", "grouped_bar" ], | ||
"transformation": "performance", | ||
"variables": [ "computation_time" ], | ||
"names": ["Time"], | ||
"xaxis":{ | ||
"parameter":"nb_tasks.tasks", | ||
"label":"Number of tasks" | ||
}, | ||
"yaxis":{"label":"Execution time (s)"}, | ||
"secondary_axis":{ | ||
"parameter":"elements", | ||
"label":"N" | ||
} | ||
}, | ||
{ | ||
"title": "Absolute performance", | ||
"plot_types": [ "stacked_bar", "table" ], | ||
"transformation": "performance", | ||
"variables": [ "computation_time" ], | ||
"names": ["Time"], | ||
"xaxis":{ | ||
"parameter":"elements", | ||
"label":"N" | ||
}, | ||
"yaxis":{"label":"Execution time (s)"}, | ||
"secondary_axis":{ | ||
"parameter":"nb_tasks.tasks", | ||
"label":"Number of tasks" | ||
} | ||
}, | ||
{ | ||
"title": "Speedup", | ||
"plot_types": [ "scatter" ], | ||
"transformation": "speedup", | ||
"variables": [ "computation_time" ], | ||
"names": ["Time"], | ||
"xaxis": { | ||
"parameter": "nb_tasks.tasks", | ||
"label": "Number of tasks" | ||
}, | ||
"yaxis": { | ||
"label": "Execution time (s)" | ||
}, | ||
"secondary_axis":{ | ||
"parameter":"elements", | ||
"label":"N" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ plotly | |
setuptools | ||
nbformat | ||
Jinja2 | ||
ReFrame-HPC | ||
ReFrame-HPC==4.6.3 | ||
pandas | ||
nbmake | ||
traitlets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#include <mpi.h> | ||
#include <iostream> | ||
#include <fstream> | ||
#include <vector> | ||
#include <numeric> | ||
#include <string> | ||
#include <filesystem> | ||
|
||
namespace fs = std::filesystem; | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
MPI_Init(&argc, &argv); | ||
|
||
int rank, size; | ||
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
MPI_Comm_size(MPI_COMM_WORLD, &size); | ||
|
||
if ( argc < 3 ) | ||
{ | ||
if (rank == 0) | ||
std::cerr << "Usage: " << argv[0] << " <N> <output_directory>\n"; | ||
MPI_Finalize(); | ||
return 1; | ||
} | ||
int N = std::stoi(argv[1]); | ||
fs::path output_dir = argv[2]; | ||
int base_chunk_size = N / size; | ||
int remainder = N % size; | ||
|
||
int local_start = rank * base_chunk_size + std::min(rank, remainder); | ||
int local_end = local_start + base_chunk_size + (rank < remainder ? 1 : 0); | ||
|
||
std::vector<double> local_array(local_end - local_start, 1.0); | ||
|
||
double start_time = MPI_Wtime(); | ||
double local_sum = std::accumulate(local_array.begin(), local_array.end(), 0.0); | ||
double end_time = MPI_Wtime(); | ||
|
||
double start_comm_time = MPI_Wtime(); | ||
double global_sum = 0.0; | ||
MPI_Reduce(&local_sum, &global_sum, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); | ||
double end_comm_time = MPI_Wtime(); | ||
if ( rank == 0 ) | ||
{ | ||
double computation_time = end_time - start_time; | ||
double communication_time = end_comm_time - start_comm_time; | ||
std::cout << "Global sum = " << global_sum << "\n"; | ||
std::cout << "Computation time: " << computation_time << " seconds\n"; | ||
std::cout << "Communication time: " << communication_time << " seconds\n"; | ||
|
||
if (!fs::exists(output_dir)) | ||
fs::create_directories(output_dir); | ||
|
||
fs::path filename = "scalability.json"; | ||
|
||
std::ofstream scal_outfile(output_dir/filename); | ||
if ( scal_outfile.is_open() ) | ||
{ | ||
scal_outfile << "{\n"; | ||
scal_outfile << " \"computation_time\": " << computation_time << ",\n"; | ||
scal_outfile << " \"communication_time\": " << communication_time << ",\n"; | ||
scal_outfile << " \"num_processes\": " << size << ",\n"; | ||
scal_outfile << " \"N\": " << N << ",\n"; | ||
scal_outfile << " \"sum\": " << global_sum << "\n"; | ||
scal_outfile << "}\n"; | ||
scal_outfile.close(); | ||
} | ||
else | ||
std::cerr << "[OOPSIE] Error opening file for writing." << std::endl; | ||
|
||
fs::path out_filename = "outputs.csv"; | ||
std::ofstream out_outfile(output_dir/out_filename); | ||
if (out_outfile.is_open()) | ||
{ | ||
out_outfile << "N,sum\n"; | ||
out_outfile << N << "," <<global_sum; | ||
out_outfile.close(); | ||
} | ||
else | ||
std::cerr << "[OOPSIE] Error opening file for writing [outputs]." << std::endl; | ||
|
||
std::cout << "[SUCCESS]" << std::endl; | ||
} | ||
|
||
MPI_Finalize(); | ||
|
||
|
||
return 0; | ||
} |