[mpich-discuss] MPI I/O vs Sequential I/O

Rajeev Thakur thakur at mcs.anl.gov
Wed Mar 20 10:07:02 CDT 2013


fwrite() does buffered I/O, which will perform better for small writes. A better comparison would be to use write(), which is what MPI-IO uses internally.

Rajeev

On Mar 18, 2013, at 3:49 PM, Muhammad Zulfikar Handana wrote:

> hello, i have some questions about MPI-I/O.
> 
> 1) when i trying execute my program using MPI-I/O. why when iam execute
> with 1 proses, execute time more good than when iam execute with 2 proses.
> am i wrong? this is my source code.
>        MPI_File_open (MPI_COMM_WORLD, file_akhir, MPI_MODE_CREATE |
> MPI_MODE_WRONLY, MPI_INFO_NULL, &hasil);
>         int jumlah1 = (((block-1)*16)+pad);
>            int  jumlah = jumlah1 / size;
> 
> 
>               MPI_File_set_view(hasil, rank * jumlah *
> sizeof(char),MPI_CHAR, MPI_CHAR, "native", MPI_INFO_NULL);
>               MPI_File_write (hasil, output, jumlah1, MPI_CHAR,
> MPI_STATUS_IGNORE);
> 
>         MPI_File_close(&hasil);
> 
> 2) and after that i have compared that source using MPI - I/O and with
> sequential I/O, apparently, sequential i / o is better than the parallel i
> / o. how it could be happen? this is my sequential source.
> if (rank==0) {
> 
>         hasil = fopen (file_akhir, "wb");
>         int test = (((block-1)*16)+pad);
>           fwrite (output, sizeof(char), test, hasil );
>        fclose (hasil);
>      }
> 
> thanks a lot for your attention _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss




More information about the discuss mailing list