このページの更新は終了しました。

最新の情報はTSUBAME3.0計算サービスのWebページをご覧ください。

TSUBAME2.5からTSUBAME3.0へのデータ移行方法の資料はこちら

The notes of the distributed file with MPI ?

 In the case od a distributed file,be careful of the following point by MPI.

1.The input of data
  Small files, such as rose meter, are read and distributed by rank=0. 
  Similarly, the output of a small text file, etc. are collected and outputted by rank=0.

 2.Description by a program 
  In this program, N is divided by making arrangement A (N, M) into all the domains. 
   N and M are distributed. Its domain in its duty is determined after reception. 

      integer irank, isize,ierr,NM(2)
      call MPI_init(ierr)
      call MPI_Comm_size(MPI_COMM_WORLD, isize, ierr)
      call MPI_Comm_rank(MPI_COMM_WORLD, irank, ierr)
      if(irank.eq.0)  read(5,*) NM(1),NM(2)
      call MPI_Bcast(NM,2,mpi_integer,0,MPI_COMM_WORLD,ierr)
      N=NM(1)
      M=NM(2)
!  ----- set of a parameter,Its charge is determind henceforth
      Nsize=N/isize
      Nst=Nsize*irank + 1
      Ned=Nsize*(irank+1)
      write(*,*) irank,Nsize,isize,Nst,Ned   ←(check)
!  ----- start
      ALLOCATE ( A(Nst:Ned,M) )
      do j=1,M
         do i=Nst,Ned
       :

3.Output result 
 In the case of a MPI program, there is fear of overwrite. 
 Please consider so that each file becomes unique. 
 As one of the methods of making it unique, a process number is put into a file name. 

      character*4 crank
      character*12 fname
      write(crank,' (i4.4) ') irank
      fname='out.'//crank
      open(10,file=fname,status='new',form='unformatted')
      write(10) A

 This outpits a file,as a result of calling it out.0000 - .....

4.notes
An output is a unformated and becomes processing that a package output is the earliest. 
In continuation outputs, such as a text file, the load of Lustre becomes high.