EDIT: So as mentioned in comments, my question was not accurate enough. My exact task is to "create an application that counts number of characters saved in .txt file using MPI - application should be synchronous".
I got to the point where I'm opening a file, and after that closing it. But have no idea what to do next. I think I should use MPI_File_read, but don't really know how to use it to count characters.
This is my code right now:
#include "stdafx.h"
#include "mpi.h"
using namespace std;
int _tmain(int argc, char *argv[])
{
    int rank;
    MPI_Status status;
    MPI_File fh;
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_File_open(MPI_COMM_WORLD, "file.txt", MPI_MODE_RDONLY, MPI_INFO_NULL, &fh);
    MPI_File_close(&fh);
    MPI_Finalize();
    return 0;
}
