<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; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div><br>
</div>
<div>If you are reading into a subarray in memory, you can simply expose the base address of the buffer in the window and then the GET would use the same subarray datatype to fetch the actual data content.</div>
<div><br>
</div>
<div>Remember that the GET is using the datatype describing the layout in memory and not that on file.</div>
<div><br>
</div>
<div>  -- Pavan</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"Dorier, Matthieu"<br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>"<br>
<span style="font-weight:bold">Date: </span>Wednesday, August 12, 2015 at 11:27 AM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>"<br>
<span style="font-weight:bold">Subject: </span>[mpich-discuss] From file reading to memory sharing<br>
</div>
<div><br>
</div>
<div dir="ltr"><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
<div ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #333399;font-size: 10pt;">Hi,<br>
<br>
I'm trying to refactor an MPI code using MPI one-sided communications.<br>
<br>
The initial version of the code reads its data from a file containing a 3D array of floats. Each process has a series of subdomains (blocks) to load from the file, so they all open the file and then issue a series of MPI_File_set_view and MPI_File_read. The
 type passed to MPI_File_set_view is constructed using MPI_Type_create_subarray to match the block that needs to be loaded.<br>
<br>
This code performs very poorly even at small scale: the file is 7GB but the blocks are a few hundreds of bytes, and each process has many blocks to load.<br>
<br>
Instead, I would like to have process rank 0 load the entire file, then expose it over RMA. I'm not familiar at all with MPI one-sided operations, since I never used them before, but I guess there should be a simple way to reuse the subarray datatype of my
 MPI_File_set_view and use it in the context of an MPI_Get. I'm just not sure what the arguments of this MPI_Get would be. My guess is: origin_count would be the number of floats in a single block, origin_datatype would be MPI_FLOAT, target_rank = 0, target_disp
 = 0, target_count = 1, target_datatype = my subarray datatype. Would that be correct?<br>
<br>
Thanks,<br>
<br>
Matthieu<br>
</div>
</div>
</div>
</span>
</body>
</html>