Hi,
Thanks for all and I'll test this on my environment as soon as possible.
On Tue, May 13, 2008 at 5:23 PM, <[EMAIL PROTECTED]> wrote:
>
> Hi all:
>
> Really, the number "100" of the MPI_Receive is not the problem, because
> the fprintf() look for a NULL character. The problem may be is that is
> opening the file a lot of times.
> I ran this code and it works with pvfs...
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include "mpi.h"
>
> int main(int argc, char** argv) {
> int my_rank; /* Rank of process */
> int p; /* Number of processes */
> int source; /* Rank of sender */
> int dest; /* Rank of receiver */
> int tag = 50; /* Tag for messages */
> char message[100]; /* Storage for the message */
> char new_string[100];
> MPI_Status status; /* Return status for receive */
> MPI_Init(&argc, &argv);
> MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
> MPI_Comm_size(MPI_COMM_WORLD, &p);
>
> FILE *pfile;
>
> if (my_rank != 0) {
> sprintf(message, "Greetings from process %d!", my_rank);
> dest = 0;
> //pfile = fopen("/mnt/pvfs2/teste.txt","w");
> /* Use strlen(message)+1 to include '\0' */
> MPI_Send(message, strlen(message)+1, MPI_CHAR, dest,
> tag,MPI_COMM_WORLD);
>
> } else { /* my_rank == 0 */
> pfile = fopen("/mnt/pvfs2/teste.txt","a+");
> for (source = 1 ; source < p ; source++)
> {
> MPI_Recv(message, 100, MPI_CHAR, source, tag,MPI_COMM_WORLD,
> &status);
> fprintf(pfile,"%s\n", message);
> }
> fclose(pfile);
> }
>
> MPI_Finalize();
>
> return 0;
> } /* main */
>
> Try it. Good luck...
>
>> Hi all,
>>
>> I'm trying to run some programs using MPI-IO, like MPI-IO Test, and
>> I'm with some problems. Trying to discover what is happening, I build
>> a simple distributed IO program with MPI and "fprintf" function, like
>> above, but the output is not correctly when is executed in PVFS.
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include "mpi.h"
>>
>> int main(int argc, char** argv) {
>> int my_rank; /* Rank of process */
>> int p; /* Number of processes */
>> int source; /* Rank of sender */
>> int dest; /* Rank of receiver */
>> int tag = 50; /* Tag for messages */
>> char message[100]; /* Storage for the message */
>> MPI_Status status; /* Return status for receive */
>> MPI_Init(&argc, &argv);
>> MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
>> MPI_Comm_size(MPI_COMM_WORLD, &p);
>>
>> FILE *pfile;
>>
>> if (my_rank != 0) {
>> sprintf(message, "Greetings from process %d!", my_rank);
>> dest = 0;
>> pfile = fopen("teste.txt","w");
>> /* Use strlen(message)+1 to include '\0' */
>> MPI_Send(message, strlen(message)+1, MPI_CHAR, dest, tag,
>> MPI_COMM_WORLD);
>>
>> } else { /* my_rank == 0 */
>> for (source = 1 ; source < p ; source++) {
>> MPI_Recv(message, 100, MPI_CHAR, source, tag,
>> MPI_COMM_WORLD, &status);
>> pfile = fopen("teste.txt","a");
>> fprintf(pfile,"%s\n", message);
>> }
>> }
>> fclose(pfile);
>> MPI_Finalize();
>>
>> return 0;
>> } /* main */
>>
>> When i execute him with 25 nodes on NFS, the output is:
>>
>> Greetings from process 24!
>> Greetings from process 23!
>> Greetings from process 22!
>> Greetings from process 21!
>> Greetings from process 20!
>> Greetings from process 19!
>> Greetings from process 18!
>> Greetings from process 17!
>> Greetings from process 16!
>> Greetings from process 15!
>> Greetings from process 14!
>> Greetings from process 13!
>> Greetings from process 12!
>> Greetings from process 11!
>> Greetings from process 10!
>> Greetings from process 9!
>> Greetings from process 8!
>> Greetings from process 7!
>> Greetings from process 6!
>> Greetings from process 5!
>> Greetings from process 4!
>> Greetings from process 3!
>> Greetings from process 2!
>> Greetings from process 1!
>>
>> But with PVFS, is only:
>>
>> Greetings from process 1!
>>
>> I'm using the last version of PVFS2 with 1 MDS and 3 IOS. The content
>> of file pvfs2tab is:
>>
>> tcp://campogrande01:3334/pvfs2-fs /mnt/pvfs2 pvfs2 rw,user,noauto 0 0
>>
>>
>> Someone can help me, please ?!
>>
>> --
>> Davi Vercillo Carneiro Garcia
>>
>> Universidade Federal do Rio de Janeiro
>> Departamento de Ciência da Computação
>> DCC-IM/UFRJ - http://www.dcc.ufrj.br
>>
>> "Good things come to those who... wait." - Debian Project
>>
>> "A computer is like air conditioning: it becomes useless when you open
>> windows." - Linus Torvalds
>>
>> _______________________________________________
>> Pvfs2-users mailing list
>> [email protected]
>> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users
>>
>
>
--
Davi Vercillo Carneiro Garcia
Universidade Federal do Rio de Janeiro
Departamento de Ciência da Computação
DCC-IM/UFRJ - http://www.dcc.ufrj.br
"Good things come to those who... wait." - Debian Project
"A computer is like air conditioning: it becomes useless when you open
windows." - Linus Torvalds
"Há duas coisas infinitas, o universo e a burrice humana. E eu estou
em dúvida quanto o primeiro." - Albert Einstein
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users