Your program looks ok, and I could not reproduce the problem on a PVFS1 file
system I have access to. Check if your PVFS2 installation works outside of
MPI-IO, say with a POSIX I/O equivalent of the same program.

Rajeev

> Date: Fri, 16 Nov 2007 20:46:08 -0500
> From: xuechen zhang <[EMAIL PROTECTED]>
> Subject: [Pvfs2-users] The unexpected results of running MPI-IO on
>       PVFS2
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=UTF-8
> 
> I just configure my cluster according to the instruction of 
> quick start.
> And everything goes well until I run my first MPI-IO code.
> I got the unexpected results which are listed below.
> 
> [EMAIL PROTECTED] exp1]$ mpiexec -np 1 sample
> outdata:abcdefghi
> Wrote only 5023040 of 10 bytes!
> Read only 5023040 of 10 bytes!
> Indata:@o?=L
> 
> Here are my codes. Please give me some suggestion. Thank you!.
> *************************sample.c****************************
> #include "mpi.h"
> #include "mpio.h"
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> 
> int main(int argc, char *argv[])
> {
>         MPI_File fh;
>         MPI_Status status;
>         int nprocs,rank;
> 
>         int count=0;
>         char outdata[10]={'a', 'b' ,'c', 'd', 'e', 'f', 'g', 'h', 'i',
> '\0'};
>         char indata[10];
> 
>         MPI_Init(&argc,&argv);
>         MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
>         MPI_Comm_rank(MPI_COMM_WORLD,&rank);
> 
>         printf("outdata:%s\n",outdata);
> 
>         
> MPI_File_open(MPI_COMM_WORLD,"/mnt/pvfs2/matrix",MPI_MODE_RDWR|
> MPI_MODE_CREATE,MPI_INFO_NULL,&fh);
> 
>         MPI_File_seek(fh,rank*10,MPI_SEEK_SET);
> 
>         MPI_File_write(fh,outdata,10,MPI_CHAR,&status);
>         MPI_Get_count(&status,MPI_CHAR,&count);
> 
>         if(count!=10)
>                 printf("Wrote only %d of %d bytes!\n",count,10);
> 
>         MPI_File_seek(fh,rank*10,MPI_SEEK_SET);
>         MPI_File_read(fh,indata,10,MPI_CHAR,&status);
>         MPI_Get_count(&status,MPI_CHAR,&count);
>         if(count!=10)
>                 printf("Read only %d of %d bytes!\n",count,10);
> 
>         printf("Indata:%s\n",indata);
> 
>         MPI_File_close(&fh);
> 
>         MPI_Barrier(MPI_COMM_WORLD);
> 
>         MPI_Finalize();
> }

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to