Commit 7635afda authored by Marc Vef's avatar Marc Vef
Browse files

ifs_test: MPI test shows progress every 10% of a rank's workload

parent f96d588c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -28,14 +28,15 @@ int main(int argc, char* argv[]) {

    auto start_t = get_time::now();
    auto end_tmp = start_t;
    auto progress_ind = filen / 10;
    int fd;
    for (int i = 0; i < filen; ++i) {
        string p = "/tmp/mountdir/file" + to_string(rank) + "_" + to_string(i);
        fd = creat(p.c_str(), 0666);
        if (i % 25000 == 0) {
        if (i % progress_ind == 0) {
            end_tmp = get_time::now();
            auto diff_tmp = end_tmp - start_t;
            cout << "Rank " << rank << ":\t" << i << " files processed.\t "
            cout << "Rank " << rank << ":\t" << i << " files processed.\t " << (i / (progress_ind)) * 10 << "%\t"
                 << (i / (chrono::duration_cast<ns>(diff_tmp).count() / 1000000000.)) << " ops/sec" << endl;
        }
        close(fd);