main
Gasper Spagnolo 2022-12-07 14:52:58 -05:00
parent c758d3c143
commit 090b940a68
2 changed files with 28 additions and 4 deletions

View File

@ -15,4 +15,4 @@ push:
# #
run_remote: run_remote:
ssh nsc 'cd $(DESTINATION); make clean;module load OpenMPI/4.0.5-GCC-10.2.0; make server;' ssh nsc 'cd $(DESTINATION); make clean;module load OpenMPI/4.0.5-GCC-10.2.0; make server;'
ssh nsc 'module load OpenMPI/4.0.5-GCC-10.2.0; srun --reservation=fri --ntasks=16 --mpi=pmix $(DESTINATION)/server' ssh nsc 'module load OpenMPI/4.0.5-GCC-10.2.0; srun --reservation=fri --ntasks=$(ntasks) --mpi=pmix $(DESTINATION)/server'

View File

@ -7,7 +7,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#define ARRAY_SIZE 50000000 #define ARRAY_SIZE 1000000
#define DEBUG 0 #define DEBUG 0
void segfault_handler(int sig) { void segfault_handler(int sig) {
@ -161,7 +161,6 @@ int main(int argc, char* argv[])
// Sort the array // Sort the array
qsort(recv_arr, counts[taskid], sizeof(double), compare_doubles); qsort(recv_arr, counts[taskid], sizeof(double), compare_doubles);
if(DEBUG) { if(DEBUG) {
for(int i =0; i < counts[taskid]; i++) { for(int i =0; i < counts[taskid]; i++) {
printf("%f ", recv_arr[i]); printf("%f ", recv_arr[i]);
@ -191,7 +190,32 @@ int main(int argc, char* argv[])
printf("\nTotal time: %f\n", total_time); printf("\nTotal time: %f\n", total_time);
} }
MPI_Finalize(); MPI_Finalize();
return 0; return 0;
// 500 000 000
// 1: Total time: 28.816904
// 2: Total time: 17.765614
// 4: Total time: 13.663701
// 8: Total time: 17.332404
// 16: Total time: 19.667273
// 32: Total time: 33.719451
// 100 000 000
// 1: Total time: 9.182889
// 2: Total time: 4.406844
// 4: Total time: 2.873339
// 8: Total time: 3.302755
// 16: Total time: 4.776216
// 32: Total time: 7.725292
// 1 000 000
// 1: Total time: 1.516520
// 2: Total time: 1.035112
// 4: Total time: 1.114661
// 8: Total time: 1.402073
// 16: Total time: 2.096291
// 32: Total time: 3.703796
} }