//  run with MPI:  ff-mpirun -np 4 script.edp
// NBPROC 4


verbosity=100;
cout << " rank = " << mpirank << " " << " size " << mpisize << endl;
if ( mpisize > 1) 
  if( mpirank==0) 
    {
      cout << " send to 1 " << endl;
      processor(1) << 123456;
    }
  else if (mpirank==1) 
    {
      int k;
      processor(0) >> k;
      cout << " recived " << k << endl;
    }
int l= mpirank+100;
cout << " l == " << l << " broadcast l from 0   mpirank = " << mpirank << endl;
broadcast(processor(0),l);
cout << " l == " << l << "  mpirank ="<< mpirank << endl;

matrix<complex> A;

if( mpirank==0)
   A=[[1+1i,1i],[0,2-1i]];
broadcast(processor(0),A);

if (mpirank==1)
  { A=A+A;
    processor(0) << A;
  }
 else if(mpirank==0)
   processor(1) >>  A;
cout << " mpirank = " << " A =  " <<  A << endl;

cout << " " <<  norm(A(1,1) - 2-1i) << endl;
if( mpisize>4)
{
int[int] procs=[1,0,3];
mpiGroup group(procs);
}
