<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear Neks,
<div class=""><br class="">
</div>
<div class="">I am facing a problem with the MPI IO out of my usr supplied routine.</div>
<div class="">In this routine I interpolate the mesh on a uniform Cartesian grid. As an </div>
<div class="">output of this routine I have an array </div>
<div class=""><br class="">
</div>
<div class="">fieldout(1:npts) </div>
<div class=""><br class="">
</div>
<div class="">for each MPI task. Here is my MPI IO routine which calculates the offset and then packs</div>
<div class="">the byte of the lp MPI processes together in one file ux.*** where *** is ipic.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> subroutine f_output(fieldout,ipic)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> include 'SIZE'</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> include 'TOTAL'</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> integer npts</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> parameter (npts=1024)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> real fieldout(1:npts)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> integer*8 offset, disp</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">! integer iostatus(MPI_STATUS_SIZE) </div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> integer ipic, f_off, out_fh, itask</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> integer*8 f_offset(0:np-1)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> character(80) outname</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Calculation of the offset-----------------------------------------</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> do itask=0,np-1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> f_offset(itask)=itask*npts*8</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> enddo</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> f_off=f_offset(nid)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Conversion of integer*4 to integer*8</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> offset=int(f_off,8)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> disp=0</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> WRITE(outname,'("ux.",I3.3)')ipic</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Open files using the MPI handles </div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> call MPI_FILE_OPEN(nek_comm,TRIM(outname),</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> & MPI_MODE_CREATE+MPI_MODE_WRONLY,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> & MPI_INFO_NULL,out_fh,ierr)</div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Setting the correct view on the MPI handles (displacement=0)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> call MPI_FILE_SET_VIEW(out_fh,disp,MPI_BYTE,MPI_BYTE,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> & 'native',MPI_INFO_NULL,ierr)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Write data using MPI handles</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> call MPI_FILE_WRITE_AT(out_fh,offset,fieldout,npts,MPI_BYTE,</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> & MPI_STATUS_IGNORE,ierr)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">!-----Close files</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> call MPI_FILE_CLOSE(out_fh,ierr)</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> return</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> end</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">
<div style="font-family: Helvetica; font-size: 12px;" class="">+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div>
<div class=""><br class="">
</div>
<div class="">I got the following error message:</div>
<div class=""><br class="">
</div>
<div class="">
<p style="margin: 0px;" class="">Abort(1) on node 15669 (rank 15669 in comm 1140850688): Fatal error in MPI_Info_dup: Invalid MPI_Info, error stack:</p>
<p style="margin: 0px;" class="">MPI_Info_dup(125): MPI_Info_dup(info=0x0, newinfo=0x1e7cfdb440) failed</p>
<p style="margin: 0px;" class="">MPI_Info_dup(66).: Invalid MPI_Info</p>
<p style="margin: 0px;" class="">Abort(1) on node 14577 (rank 14577 in comm 1140850688): Fatal error in MPI_Info_dup: Invalid MPI_Info, error stack:</p>
<p style="margin: 0px;" class="">MPI_Info_dup(125): MPI_Info_dup(info=0x0, newinfo=0x1e7cfdb440) failed</p>
<p style="margin: 0px;" class="">MPI_Info_dup(66).: Invalid MPI_Info</p>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">…. and so on.</div>
<div class=""><br class="">
</div>
<div class="">I suspect that the communicator is not correctly set up.</div>
<div class="">I used nek_comm and also tried MPI_COMM_WORLD. The error message is the </div>
<div class="">same in both cases (see above). </div>
<div class=""><br class="">
</div>
<div class="">Does anyone have an idea how to solve this?</div>
<div class=""><br class="">
</div>
<div class="">Thanks in advance and best regards, Jörg.</div>
<div class=""><br class="">
</div>
</div>
</div>
</body>
</html>