LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Aidaros Dev (aidaros.dev_at_[hidden])
Date: 2006-08-25 10:41:54


*Kyle Wheeler,**Brian Barrett thanks for reply,
*

Im still have same problem even i use ffulsh(NULL), i don't know why these
two processros run in serial.

here is my MPI part in my code, it works fine in other single multiprocessor
computer but in this cluster doesn't.

          char processor_name[MPI_MAX_PROCESSOR_NAME];
          MPI_Init(&argc,&argv);
          MPI_Comm_size(MPI_COMM_WORLD,&np);
          MPI_Comm_rank(MPI_COMM_WORLD,&myid);
          MPI_Get_processor_name(processor_name,&namelen);

        fprintf(stderr,"\n Processor %d on %s\n",myid, processor_name);

                if( (stream = fopen( "1k.txt", "r" )) != NULL )
                {
          length = fread( data, sizeof( char ),MAX_MESSAGE_LENGTH , stream
);
      fclose( stream );
                }

stime=MPI_Wtime();

        if (myid==0){
                AES(ciphertext, fragment,0, e_keys, ENCRYPT, "ECB", NULL);//
input is byt
               MPI_Recv(digest, 32, MPI_CHAR, 1, tag, MPI_COMM_WORLD,
&status);
               DIG(OUTPUT, digest,digest_length, e_keys, ENCRYPT, "ECB",
NULL);// input is bytes
                        } //end myid=0

        if(myid==1){

printf("start myid 1");

  result=Hmac(digest, fragment, frag_size, keys, key_length);
 assert (result == 0);
 MPI_Send(digest,32 , MPI_CHAR, 0, tag, MPI_COMM_WORLD);
                        }// here finish pro 0 if 1 fragment

        MPI_Barrier(MPI_COMM_WORLD);

        if(myid==0)
{
        etime=MPI_Wtime();
        printf("\nTime MPI finish in %d = %f seconds\n",myid,etime-stime);
printf("Encrypted data\n");
for (i=0;i<digest_length;i++){ // printf cihper digest
printf("%02x",cipherdigest[i]);}
}
MPI_Finalize();
}

HMAC function is the fastest.
when i run: mpirun -nolocal -np 2 machinefile -machines ./out
the output:

-------------------------------------------------------------

processor 0 in computer -0-0

processro 1 in computer -0-1

Time MPI finish in 0 .0003 seconds

Encrypted data

000000000000000000000000000000000000

start myid 1

--------------------------------------------------------------------

means that it start with myid 0 and process the three functions, then skip
barriar then print the time and rubbish output then start myid 1

in myid 0 , the function depond on output from myid 1, but myid 0 ignore it
and that's why we got rubbish output.

Why the myid 0 block untill myid 1 finish and vice versa? these two
processors should work at the same time ,not in serial.
Why the MPI_Barriar has been skipped? one processor should wait until other
call it.

Im using Rock cluster 16 node each has 2 processors, using mpich 1.2.7p1 in
my Unix platform,

Any one can tell me what im missing.
Thanks in advance.

-- 
223,1         Bot