diff --git a/test/perf/354969.output b/test/perf/354969.output new file mode 100644 index 0000000000000000000000000000000000000000..e0d4cad330cbc39c41782eb620f770461f53afb1 --- /dev/null +++ b/test/perf/354969.output @@ -0,0 +1,3 @@ +slowest time: 52.718333 +total Mbytes: 102400.000000 +rate: 1942.398284 diff --git a/test/perf/README b/test/perf/README index e3919d335f149e1c971dbd11cfe696d1eddf731b..9cf3f448676baa1eb3ec34f44b5b664430bc4f3c 100644 --- a/test/perf/README +++ b/test/perf/README @@ -17,16 +17,26 @@ Logs * 350892.output * harms_IOR_id1350892_2-9-74258_1.darshan.gz +354969 + * partshared run that creates shared files that are used by a subset of ranks + * 354969.output + * harms_partshared_id354969_2-25-56979_1.darshan.gz + Check Performance ------------------ -Add all the performance test runs (both read and write) and the compute the average. +Add all the performance test runs (both read and write) and the compute the average for IOR test cases. awk 'BEGIN {sum=0;count=0;} /^(write|read)/ { sum+=$2; count+=1; } END { print "avg: " sum/count; }' xxxx.output -darshan-parser --perf log.gz +darshan-parser --perf Compare the four methods to the calculated average. +For partshared: +grep "rate" 354969.output + +Then compare with darshan-parser --perf + IOR Commands ------------ # File Per Proc with Multiple Files @@ -38,3 +48,11 @@ qsub -q prod -A Operations -t 60 -n 512 --mode vn --env BG_COREDUMPDISABLED=1 IO # Both I/O methods in one run qsub -q prod -A Operations -t 60 -n 512 --mode vn --env BG_COREDUMPDISABLED=1 IOR/src/C/IOR -f single_and_multi_file.ior +Partial Shared Files +-------------------- +# a subset of ranks access the same file +qsub -q prod -A Operations -t 60 -n 512 --mode vn --env BG_COREDUMPDISABLED=1 ./partshared + +partshared +---------- +mpicc -o partshared partshared.c diff --git a/test/perf/harms_partshared_id354969_2-25-56979_1.darshan.gz b/test/perf/harms_partshared_id354969_2-25-56979_1.darshan.gz new file mode 100644 index 0000000000000000000000000000000000000000..7a5c45a8c3c20db9caa0a399fa553d05d342a416 Binary files /dev/null and b/test/perf/harms_partshared_id354969_2-25-56979_1.darshan.gz differ diff --git a/test/perf/partshared.c b/test/perf/partshared.c new file mode 100644 index 0000000000000000000000000000000000000000..20172f17502d74c93433b2228ec5cba0f8f2bf63 --- /dev/null +++ b/test/perf/partshared.c @@ -0,0 +1,129 @@ +#include +#include +#include +#include + +#define FILE_COUNT (64) + +int main (int argc, char **argv) +{ + int rc; + int world_rank; + int world_size; + int sub_rank; + int count; + char* zerobuf; + double stime; + double etime; + double ttime; + double maxtime; + char fname[256]; + MPI_Offset offset; + MPI_Comm sub_comm; + MPI_File fh; + MPI_Status status; + + count = 1024*1024*50; + + zerobuf = malloc(count); + assert(zerobuf); + memset(zerobuf, 0, count); + + rc = MPI_Init(&argc, &argv); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_Init failed: %d\n", rc); + } + + rc = MPI_Comm_rank (MPI_COMM_WORLD, &world_rank); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_Comm_rank failed: %d\n", rc); + } + + rc = MPI_Comm_size (MPI_COMM_WORLD, &world_size); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_Comm_size failed: %d\n", rc); + } + + if ((world_size % FILE_COUNT) && (world_rank == 0)) + { + fprintf(stderr, "Not evenly disible node size\n"); + } + + rc = MPI_Comm_split(MPI_COMM_WORLD, + (world_rank%FILE_COUNT), + world_rank, + &sub_comm); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_Comm_split failed: %d\n", rc); + } + + rc = MPI_Comm_rank(sub_comm, &sub_rank); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_Comm_rank2 failed: %d\n", rc); + } + + memset(fname, 0, sizeof(fname)); + + if (sub_rank == 0) + { + sprintf(fname, "%s.%d", "partfile", world_rank); + } + + MPI_Barrier(sub_comm); + + MPI_Bcast(fname, sizeof(fname), MPI_BYTE, 0, sub_comm); + + MPI_Barrier(MPI_COMM_WORLD); + + stime = MPI_Wtime(); + + rc = MPI_File_open(sub_comm, + fname, + (MPI_MODE_CREATE|MPI_MODE_DELETE_ON_CLOSE|MPI_MODE_RDWR), + MPI_INFO_NULL, + &fh); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_File_open failed: %d\n", rc); + } + + offset = sub_rank * count; + + rc = MPI_File_write_at(fh, offset, zerobuf, count, MPI_BYTE, &status); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_File_write_at failed: %d\n", rc); + } + + rc = MPI_File_close(&fh); + if (rc != MPI_SUCCESS) + { + fprintf(stderr, "MPI_File_close failed: %d\n", rc); + } + + etime = MPI_Wtime(); + ttime = etime-stime; + + MPI_Comm_free (&sub_comm); + + MPI_Barrier(MPI_COMM_WORLD); + + rc= MPI_Reduce(&ttime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD); + + if (world_rank == 0) + { + double total_Mbytes = ((double)count * (double)world_size) / (1024.0*1024.0); + printf("slowest time: %lf\n", maxtime); + printf("total Mbytes: %lf\n", total_Mbytes); + printf("rate: %lf\n", (total_Mbytes/maxtime)); + } + + MPI_Finalize(); + + return 0; +}