Article: 91 of npac.cmmd Newsgroups: npac.cmmd Path: npac.syr.edu!xshen@owl.npac.syr.edu From: xshen@owl.npac.syr.edu (Xianneng Shen) Subject: (none) Message-ID: <9311111604.AA11113@owl.npac.syr.edu> Originator: daemon@spica.npac.syr.edu Sender: usenet@npac.syr.edu Nntp-Posting-Host: spica-gw.npac.syr.edu Organization: NPAC/SCCS Date: Thu, 11 Nov 93 11:04:21 GMT- 9:33 Hi, I have the following I/O problems. 1)Parallel io: use CMMD_global_write to a data vault file in a f77 hostless program. Then, read in using CMF_CM_ARRAY_FROM_FILE_SO in a CM fortran program. I found out it complete different with what has been written. Is it wrong period or it can be done? Attached is the f77 and cmf programs. 2) Serial io: I notice the problem of f77 buffer. I have tried use --fileopt='BUFFER=n'-- in open statement, where n is the desired buffer size. open(unit=11,file='a.dat',access='squential',status='unknown',fileopt=' BUFFER=n') It passed compiler ok, but gives me runtime error about FILEOPT option. By the way, I used CMMD_sync_seq io mode. what can I do to make it work? Any comment and suggestion are welcome. Thank you. Shennon Shen NPAC, Syracuse University c-- f77 code Program Test implicit none include '/usr/include/cm/cmmd_fort.h' complex a(100,100),b(100),ac(100,100),bc(100) real cc integer N,M,ier,i,j integer my_address,nodes integer nbytes,iwrite my_address = CMMD_self_address() nodes = CMMD_partition_size() N= 32 M = 1 do i=1,M do j=1,N cc=j*1.0 a(j,i) = cmplx(1.0,cc)*my_address enddo enddo do i=1,N cc=i*1.0 b(i) = cmplx(1.0,cc)*my_address enddo ier = 0 nbytes = n*m*8 ier = CMMD_set_io_mode(11,CMMD_sync_seq) ier =0 ier = CMMD_set_open_mode(CMMD_sync_seq) if(ier .ne. 0) then call CMMD_error('Error in open') endif open(unit=11,file='dvvax:/xshen/a.dat',access='sequential', & status ='unknown') iwrite=CMMD_global_write(11,a,nbytes) close(11) ier =0 ier = CMMD_set_io_mode(12,CMMD_sync_seq) open(unit=12,file='dvvax:/xshen/b.dat',access='sequential', & status ='unknown') nbytes = n*8 iwrite=CMMD_global_write(12,b,n*8) close(12) ier = CMMD_set_io_mode(12,CMMD_sync_seq) open(13,file='a.dat',access='sequential', & status ='unknown') write(13,*)((a(i,j),i=1,N),j=1,M) close(13) ier = CMMD_set_io_mode(14,CMMD_sync_seq) open(14,file='b.dat',access='sequential', & status ='unknown') write(14,*)(b(i),i=1,N) close(14) nbytes = n*m*8 open(unit=11,file='dvvax:/xshen/a.dat',access='sequential', & status ='unknown') iwrite=CMMD_global_read(11,ac,nbytes) close(11) open(13,file='ac.dat',access='sequential', & status ='unknown') do i=1,M do j=1,N write(13,*)i,j,ac(j,i) enddo enddo close(13) open(unit=12,file='dvvax:/xshen/b.dat',access='sequential', & status ='unknown') nbytes = n*8 iwrite=CMMD_global_read(12,b,n*8) close(12) open(14,file='bc.dat',access='sequential', & status ='unknown') do i=1,N write(14,*)i,bc(i) enddo close(14) stop end c--- cm fortram code c This is a CMF code: read in CZ, CV from data vault. c call CMSSL LU and SOLVE routines solve for CI, then write ci into c a data vault file. Program ISLOVER integer nurow integer n_ex include '/usr/include/cm/CMF_defs.h' c print*,'Enter nu,n_ex ' c read(5,*)nurow,n_ex nurow = 32 n_ex = 32 write(6,*)nurow,n_ex call solution(nurow,n_ex) stop end subroutine solution(nukns,n_ex) include "/usr/include/cm/cmssl-cmf.h" include '/usr/include/cm/CMF_defs.h' include "/usr/include/cm/timer-fort.h" integer nukns,n_ex,istat,blk,nprocs integer ier,iostat complex cz(nukns,nukns),cv(nukns,n_ex) complex fe_cz(500,500),fe_cv(500,100) complex cz1(nukns,nukns),cv1(nukns,n_ex) complex fe_cz1(500,500),fe_cv1(500,100) cmf$ layout cz(:news,:news) cmf$ layout cv(:news,:news) cmf$ layout fe_cz(:serial,:serial) cmf$ layout fe_cv(:serial,:serial) cmf$ layout cz1(:news,:news) cmf$ layout cv1(:news,:news) cmf$ layout fe_cz1(:serial,:serial) cmf$ layout fe_cv1(:serial,:serial) print*,'nukns,n_ex',nukns,n_ex open(unit=15,file='z.dat',status='unknown') open(unit=17,file='v.dat',status='unknown') iostat = 0 call CMF_FILE_OPEN(12,'dvvax:/xshen/a.dat',iostat) if(iostat .lt. 0) then print*,'open file failure' endif call CMF_FILE_REWIND(12,iostat) call CMF_CM_ARRAY_FROM_FILE_SO(12,cz) print*,'I finish read cz' call CMF_FE_ARRAY_FROM_CM(fe_cz,cz) call CMF_FILE_CLOSE(12) open(unit=12,file='a.dat',status='old') read(12,*)((fe_cz1(i,j),i=1,nukns),j=1,nukns) close(12) iostat = 0 call CMF_FILE_OPEN(13,'dvvax:/xshen/b.dat',iostat) if(iostat .lt. 0) then print*,'open file failure' endif call CMF_FILE_REWIND(13,iostat) call CMF_CM_ARRAY_FROM_FILE_SO(13,cv) call CMF_FILE_CLOSE(13) open(unit=13,file='b.dat',status='old') read(13,*)((fe_cv1(i,j),i=1,nukns),j=1,n_ex) close(13) print*,'I finish read cv' call CMF_FE_ARRAY_FROM_CM(fe_cv,cv) do i=1,nukns do j=1,nukns write(15,*)i,j,fe_cz(j,i) enddo enddo do i=1,n_ex do j=1,nukns write(17,*)i,j,fe_cv(j,i) enddo enddo close(15) close(17) open(unit=12,file='cz1.dat',status='unknown') do i=1,nukns do j=1,nukns write(12,*)i,j,fe_cz1(j,i) enddo enddo close(12) open(unit=13,file='cv1.dat',status='unknown') do i=1,n_ex do j=1,nukns write(13,*)i,j,fe_cv1(j,i) enddo enddo close(13) return end