15 #ifdef IPPL_PRINTDEBUG
37 #include <sys/types.h>
44 template<
class T,
unsigned Dim,
class M,
class C>
class Field;
51 template <
unsigned Dim,
class T>
60 template <
unsigned Dim>
76 DiscField(
const char* fname,
const char* config,
unsigned int numFields,
77 const char* typestr = 0);
82 DiscField(
const char* fname,
unsigned int numFields,
83 const char* typestr = 0);
88 DiscField(
const char* fname,
const char* config);
104 void query(
int& numRecords,
int& numFields, std::vector<int>& size)
const;
151 template <
class T,
class M,
class C>
153 unsigned int varID,
unsigned int record) {
156 bool canread =
false;
158 ERRORMSG(
"Cannot read in DiscField::read - config file error." <<
endl);
163 ERRORMSG(
"DiscField::read called for DiscField opened for write."<<
endl);
165 ERRORMSG(varID <<
" is a bad Field ID in DiscField::read." <<
endl);
168 ERRORMSG(record <<
" is a bad record number in DiscField::read."<<
endl);
171 ERRORMSG(
"DiscField::read - the total field domain ");
174 }
else if (!(
get_Domain().contains(readDomain))) {
175 ERRORMSG(
"DiscField::read - the DiscField domain ");
197 DFDBG(std::string dbgmsgname(
"DF:read:"));
201 DFDBG(dbgmsg <<
"At start of read: Read domain =" << readDomain <<
endl);
225 for (
unsigned int sf=0; sf <
numFiles(); ++sf) {
229 int outputDatafd = (-1);
232 std::vector<DFOffsetData<Dim,T> > offdata;
259 DFDBG(dbgmsg <<
"After reading and distributing offset data: ");
261 DFDBG(dbgmsg << vnodes <<
" vnodes, with maxsize = " << maxsize);
269 for (
int vn=0; vn < vnodes; ++vn) {
276 if (! vnodeblock.
touches(readDomain)) {
277 DFDBG(dbgmsg <<
"Skipping vnode " << vn <<
", no intersection ");
278 DFDBG(dbgmsg <<
"between " << vnodeblock <<
" and ");
290 offdata[vn].isCompressed);
292 DFDBG(dbgmsg <<
"Reading in chunks in blocks of size " << chunkblock);
293 DFDBG(dbgmsg <<
" and max buffer elems = " << maxsize);
294 DFDBG(dbgmsg <<
" in vnode " << vn <<
" with total domain ");
300 currblock[msdim] =
Index(vnodeblock[msdim].first() - 1,
301 vnodeblock[msdim].first() - 1);
302 for (
unsigned int md = (msdim+1); md <
Dim; ++md)
303 currblock[md] =
Index(vnodeblock[md].first(),vnodeblock[md].first());
311 int unread = vnodeblock.
size();
318 bool incrhigher=(currblock[msdim].last()==vnodeblock[msdim].last());
319 int a = (incrhigher ?
320 vnodeblock[msdim].first() :
321 currblock[msdim].last() + 1);
322 int b = a + chunkblock[msdim].length() - 1;
323 if (b > vnodeblock[msdim].last())
324 b = vnodeblock[msdim].last();
327 currblock[msdim] =
Index(a, b);
331 for (
unsigned int cd = (msdim+1); cd <
Dim; ++cd) {
332 if (currblock[cd].last() < vnodeblock[cd].last()) {
334 currblock[cd] =
Index(currblock[cd].first() + 1,
335 currblock[cd].last() + 1);
339 currblock[cd] =
Index(vnodeblock[cd].first(),
340 vnodeblock[cd].first());
348 int nelems = currblock.
size();
351 DFDBG(dbgmsg <<
"Starting processing of chunk with domain ");
352 DFDBG(dbgmsg << currblock <<
" in vnode " << vn);
353 DFDBG(dbgmsg <<
" at offset = " << offdata[vn].offset <<
endl);
354 DFDBG(dbgmsg <<
"After this, still have " << unread <<
" unread.");
358 if (!offdata[vn].isCompressed && seekpos < 0) {
359 seekpos = offdata[vn].offset *
sizeof(
T);
360 DFDBG(dbgmsg <<
"Set seek position = " << seekpos <<
endl);
365 if (! currblock.
touches(readDomain)) {
366 DFDBG(dbgmsg <<
"Skipping sub-vnode chunk " << currblock);
367 DFDBG(dbgmsg <<
", no intersection with readDomain ");
372 seekpos += readbytes;
373 DFDBG(dbgmsg <<
"Updating offset at end of skip operation to ");
382 DFDBG(dbgmsg <<
"Intersection of chunk " << currblock);
383 DFDBG(dbgmsg <<
" and read domain " << readDomain <<
" = ");
384 DFDBG(dbgmsg << readDomainSection <<
endl);
389 if (!offdata[vn].isCompressed) {
391 if (outputDatafd < 0) {
392 DFDBG(dbgmsg <<
"Opening input data file ...");
405 long nbytes = maxsize*
sizeof(
T);
407 if (openedDirectIO) {
408 nbytes += dioinfo.d_miniosz;
409 size_t ndiff = nbytes % dioinfo.d_miniosz;
411 nbytes += (dioinfo.d_miniosz - ndiff);
416 DFDBG(dbgmsg <<
" bytes ... current block will need ");
417 DFDBG(dbgmsg << nelems *
sizeof(
T) <<
" bytes." <<
endl);
421 T * readbuffer = buffer;
427 seekpos += readbytes;
432 if (openedDirectIO) {
439 Offset_t extra = readoffset % dioinfo.d_miniosz;
441 DFDBG(dbgmsg <<
"DIO: Moving read offset back by " << extra);
442 DFDBG(dbgmsg <<
" bytes, to readoffset = " << readoffset<<
endl);
449 size_t ndiff = readbytes % dioinfo.d_miniosz;
451 readbytes += (dioinfo.d_miniosz - ndiff);
453 DFDBG(dbgmsg <<
"DIO: Adjusted readbytes from ");
454 DFDBG(dbgmsg << (nelems *
sizeof(
T)) <<
" to " << readbytes);
461 buffer += (extra /
sizeof(
T));
462 DFDBG(dbgmsg <<
"DIO: Adjusted buffer pointer forward ");
463 DFDBG(dbgmsg << (extra /
sizeof(
T)) <<
" elements." <<
endl);
468 DFDBG(dbgmsg <<
"Calling read_data with readbytes=" << readbytes);
469 DFDBG(dbgmsg <<
", readoffset=" << readoffset <<
endl);
470 read_data(outputDatafd, readbuffer, readbytes, readoffset);
477 DFDBG(dbgmsg <<
"Finding destination nodes for block with ");
478 DFDBG(dbgmsg <<
"domain = " << currblock <<
", compressed = ");
479 DFDBG(dbgmsg << offdata[vn].isCompressed <<
" ..." <<
endl);
480 DFDBG(dbgmsg <<
"We will use the portion " << readDomainSection);
481 DFDBG(dbgmsg <<
" from this block." <<
endl);
487 int remaining = readDomainSection.
size();
495 for (rv_i = range.first; rv_i != range.second; ++rv_i) {
499 DFDBG(dbgmsg <<
"Block intersects with remote domain ");
500 DFDBG(dbgmsg << (*rv_i).first <<
" = " << ri <<
endl);
503 int rnode = (*rv_i).second->getNode();
509 LFI cbi(buffer, ri, currblock, offdata[vn].compressedVal);
511 cbi.putMessage(*msg,
false);
512 DFDBG(dbgmsg <<
"Sending subblock " << ri <<
" from block ");
513 DFDBG(dbgmsg << currblock <<
" to node " << rnode);
514 DFDBG(dbgmsg <<
" with tag " << tag <<
endl);
518 remaining -= ri.
size();
519 DFDBG(dbgmsg <<
"After send, remaining = " << remaining <<
endl);
525 for (; remaining > 0 && lf_i != f.
end_if(); ++lf_i) {
538 DFDBG(dbgmsg <<
"Doing local copy of domain " << ri);
539 DFDBG(dbgmsg <<
" into LField with domain " << lo <<
endl);
543 offdata[vn].isCompressed &&
545 DFDBG(dbgmsg <<
" Doing comp-comp assign." <<
endl);
550 LFI rhs_i(buffer, ri, currblock, offdata[vn].compressedVal);
556 DFDBG(dbgmsg <<
" Doing lfield-comp assign." <<
endl);
563 LFI lhs_i = lf.
begin(ri);
566 DFDBG(dbgmsg <<
" Doing uncomp-uncomp assign." <<
endl);
567 Expr_t(lhs_i,rhs_i).apply();
575 int bsize = ri.
size();
579 DFDBG(dbgmsg <<
"Finished copying in local data, now ");
580 DFDBG(dbgmsg <<
"expecting " << expected <<
" elems with ");
581 DFDBG(dbgmsg << remaining <<
" elems remaining." <<
endl);
587 Ippl::abort(
"remaining > 0 at end of box0 vnode read!!!");
593 if (outputDatafd >= 0)
599 while (expected > 0) {
602 DFDBG(dbgmsg <<
"Waiting for DF data, still expecting " << expected);
603 DFDBG(dbgmsg <<
" elements ..." <<
endl);
609 DFDBG(dbgmsg <<
"Received DF data from node " << node <<
" with tag ");
610 DFDBG(dbgmsg << tag <<
", with domain = " << ro <<
endl);
613 T rhs_compressed_data;
614 LFI rhs_i(rhs_compressed_data);
615 rhs_i.getMessage(*msg);
619 bool foundlf =
false;
620 for (; lf_i != f.
end_if(); ++lf_i) {
628 DFDBG(dbgmsg <<
"Found local lfield with domain " << lo);
629 DFDBG(dbgmsg <<
" that contains received domain " << ro <<
endl);
633 (*rhs_i == *lf.
begin())) ) {
641 DFDBG(dbgmsg <<
"Assigning value: lhs compressed = ");
643 DFDBG(dbgmsg << rhs_i.IsCompressed() <<
endl);
647 LFI lhs_i = lf.
begin(ro);
650 Expr_t(lhs_i,rhs_i).apply();
652 DFDBG(dbgmsg <<
"Local LField is compressed and has same value ");
653 DFDBG(dbgmsg <<
"as received data." <<
endl);
657 expected -= ro.
size();
669 ERRORMSG(
"Did not find destination local vnode for received domain ");
671 Ippl::abort(
"DID NOT FIND DESINATION LOCAL VNODE IN DISCFIELD::READ");
684 DFDBG(dbgmsg <<
"Finished with read. Updating field GC's." <<
endl);
710 template <
class T,
class M,
class C>
715 template <
class T,
class M,
class C>
717 unsigned int varID) {
718 return read(f, readDomain, varID, 0);
721 template <
class T,
class M,
class C>
726 template <
class T,
class M,
class C>
728 return read(f, readDomain, 0, 0);
731 template <
class T,
class M,
class C>
753 template<
class T,
class M,
class C>
758 ERRORMSG(
"Cannot write in DiscField::write - config file error."<<
endl);
763 ERRORMSG(
"DiscField::write called for DiscField opened for read."<<
endl);
768 ERRORMSG(varID <<
" is a bad variable ID in DiscField::write." <<
endl);
773 ERRORMSG(
"DiscField:write - attempt to overwrite Field " << varID);
779 DFDBG(std::string dbgmsgname(
"DF:write:"));
803 ERRORMSG(
"DiscField::write - all Field's must have the same ");
804 ERRORMSG(
"global domain in a single DiscField.\n");
820 for (
unsigned int i=0; i <
NumFields; ++i)
831 DFDBG(dbgmsg <<
"Writing meta file ..." <<
endl);
841 DFDBG(dbgmsg <<
"Writing layout file ..." <<
endl);
861 ".offset", std::string(
"a"));
862 int wVarID = (int)varID;
863 DFDBG(dbgmsg <<
"Writing Field ID = " << wVarID<<
" to offset file ...");
865 if (fwrite(&wVarID,
sizeof(
int), 1, outputOffset) != 1) {
866 ERRORMSG(
"DiscField::write - cannot write field number to .offset ");
869 fclose(outputOffset);
875 DFDBG(dbgmsg <<
"Trying to open output data file ..." <<
endl);
878 DFDBG(dbgmsg <<
"Opened out file, fd=" << outputDatafd <<
endl);
884 DFDBG(dbgmsg <<
" blocks from other nodes, minus the ");
887 int fromothers = unreceived - layout.
size_iv();
895 while (unreceived > 0) {
898 bool checkremote = (fromothers > 0);
899 while (checkremote) {
909 DFDBG(dbgmsg <<
"Received an LField msg from node ");
910 DFDBG(dbgmsg << any_node <<
" with tag " << tag <<
", domain = ");
914 T rhs_compressed_data;
915 LFI cbi(rhs_compressed_data);
916 cbi.getMessage(*msg);
934 if (local != f.
end_if()) {
949 if (outputDatafd >= 0)
953 if (outputOffset != 0)
954 fclose(outputOffset);
969 cbi.putMessage(*msg,
false);
973 DFDBG(dbgmsg <<
"Sending local block " << ro <<
" to node " << node);
974 DFDBG(dbgmsg <<
" with tag " << tag <<
endl);
991 template<
class T,
class M,
class C>
1076 #ifdef IPPL_DIRECTIO
1077 struct dioattr dioinfo;
1078 bool openedDirectIO;
1086 void initialize(
const char* base,
const char* config,
1087 const char* typestr,
unsigned int numFields);
1093 FILE *
open_df_file(
const std::string& fnm,
const std::string& mode);
1094 FILE *
open_df_file(
const std::string& fnm,
const std::string& suffix,
1095 const std::string& mode);
1102 int open_df_file_fd(
const std::string& fnm,
const std::string& suf,
int flags);
1208 DFDBG(std::string dbgmsgname(
"DF:write_offset_and_data"));
1225 DFDBG(dbgmsg <<
" Writing compressed vnode " << owned <<
" w/value = ");
1238 long elems = owned.
size();
1240 #ifdef IPPL_DIRECTIO
1241 if (openedDirectIO) {
1245 if (chunkbytes == 0 || chunkbytes > dioinfo.d_maxiosz)
1246 chunkbytes = dioinfo.d_maxiosz;
1247 else if (chunkbytes < dioinfo.d_miniosz)
1248 chunkbytes = dioinfo.d_miniosz;
1249 else if (chunkbytes % dioinfo.d_miniosz > 0)
1250 chunkbytes -= (chunkbytes % dioinfo.d_miniosz);
1253 long chunksize = chunkbytes /
sizeof(
T);
1254 if (chunksize < 1 || chunksize > elems)
1257 DFDBG(dbgmsg <<
"Total elems = " << elems <<
endl);
1258 DFDBG(dbgmsg <<
"Bytes in each chunk = " << chunkbytes);
1260 DFDBG(dbgmsg <<
"Elems in each chunk = " << chunksize <<
endl);
1273 DFDBG(dbgmsg <<
" Writing vnode " << owned <<
" in ");
1274 DFDBG(dbgmsg <<
"chunks of " << chunksize <<
" elements for ");
1275 DFDBG(dbgmsg << elems <<
" total elements ..." <<
endl);
1277 int needwrite = elems;
1278 while (needwrite > 0) {
1280 int amount = chunksize;
1281 if (amount > needwrite)
1288 size_t nbytes = amount*
sizeof(
T);
1289 #ifdef IPPL_DIRECTIO
1290 if (openedDirectIO) {
1291 size_t ndiff = nbytes % dioinfo.d_miniosz;
1293 nbytes += (dioinfo.d_miniosz - ndiff);
1296 DFDBG(dbgmsg <<
" Will write total nbytes = " << nbytes);
1297 DFDBG(dbgmsg <<
", this has extra " << (nbytes - amount*
sizeof(
T)));
1306 DFDBG(dbgmsg <<
" Getting copy buffer of total size ");
1307 DFDBG(dbgmsg << nbytes <<
" bytes ..." <<
endl);
1311 DFDBG(dbgmsg <<
" Copying data into buffer ..." <<
endl);
1313 T *bufend = buffer + amount;
1314 for ( ; bufptr != bufend; ++bufptr, ++cbi)
1315 new (bufptr)
T(*cbi);
1319 DFDBG(dbgmsg <<
" About to write " << nbytes <<
" to fd = ");
1328 #ifdef IPPL_DIRECTIO
1329 size_t nout = ::pwrite(outputDatafd, buffer, nbytes, seekoffset);
1332 if (::lseek(outputDatafd, seekoffset, SEEK_SET) == seekoffset) {
1333 char *wbuf = (
char *)buffer;
1334 nout =
::write(outputDatafd, wbuf, nbytes);
1345 ERRORMSG(
"Seek error in DiscField::write_offset_and_data" <<
endl);
1346 ERRORMSG(
"Could not seek to position " << seekoffset <<
endl);
1350 if (nout != nbytes) {
1351 ERRORMSG(
"Write error in DiscField::write_offset_and_data" <<
endl);
1352 ERRORMSG(
"Could not write " << nbytes <<
" bytes." <<
endl);
1356 DFDBG(dbgmsg <<
" Finished writing " << nout <<
" bytes in ");
1360 needwrite -= amount;
1369 DFDBG(dbgmsg <<
" Finishing writing chunk, still " << needwrite);
1370 DFDBG(dbgmsg <<
" elements to write out from this block." <<
endl);
1375 DFDBG(dbgmsg <<
"Writing offset data to file, iscompressed = ");
1379 ERRORMSG(
"Write error in DiscField::write_offset_and_data" <<
endl);
1391 unsigned int record,
1398 ".offset", std::string(
"r"));
1404 if (fseek(outputOffset, seekpos, SEEK_SET) != 0) {
1405 ERRORMSG(
"Error seeking to position " << static_cast<long>(seekpos));
1408 fclose(outputOffset);
1414 unsigned int checked = 0;
1418 if (fread(&rVarID,
sizeof(
int), 1, outputOffset) != 1) {
1419 ERRORMSG(
"Error reading field ID from .offset file" <<
endl);
1421 fclose(outputOffset);
1426 if ((
unsigned int) rVarID == varID) {
1429 offdata.resize(vnodes);
1431 offdata.size(), outputOffset);
1432 if (result != offdata.size()) {
1433 ERRORMSG(
"Read error in DiscField::find_file_in_offset" <<
endl);
1434 ERRORMSG(
"Results is " << result <<
", should be ");
1436 ERRORMSG(
"outputOffset is " << (
void *)outputOffset <<
endl);
1438 fclose(outputOffset);
1443 fclose(outputOffset);
1451 if (fseek(outputOffset, seekpos, SEEK_SET) != 0) {
1452 ERRORMSG(
"Error seeking to position " << static_cast<long>(seekpos));
1455 fclose(outputOffset);
1461 ERRORMSG(
"Could not find data for field " << varID <<
" of record ");
1464 fclose(outputOffset);
1478 int &vnodes,
int &maxsize,
1489 DFDBG(dbgmsg <<
"Per-SMP parallel IO is disabled, so only box0 nodes ");
1490 DFDBG(dbgmsg <<
"will read data." <<
endl);
1493 vnodes = offdata.size();
1504 DFDBG(dbgmsg <<
myBox0() <<
" on a different SMP. Return from ");
1505 DFDBG(dbgmsg <<
"distribute_offsets with zero vnodes." <<
endl);
1518 DFDBG(dbgmsg <<
"Assigning " << pernode <<
" vnodes to each node, ");
1519 DFDBG(dbgmsg <<
"with " << extra <<
" extra." <<
endl);
1523 int nextvnode = pernode;
1528 DFDBG(dbgmsg <<
"This box0 node will get the first " << nextvnode);
1540 int numvnodes = pernode;
1550 msg->
put(numvnodes);
1551 if (numvnodes > 0) {
1554 msg->
putmsg(static_cast<void *>(&(offdata[nextvnode])),
1560 DFDBG(dbgmsg <<
"Sending offset info for " << numvnodes);
1561 DFDBG(dbgmsg <<
" vnodes to node " << node <<
" with tag " << tag);
1562 DFDBG(dbgmsg <<
", starting from box0 " << nextvnode <<
endl);
1566 nextvnode += numvnodes;
1571 if ((
unsigned int) nextvnode != offdata.size())
1572 Ippl::abort(
"ERROR: Could not give away all my vnodes!");
1577 DFDBG(dbgmsg <<
"Waiting for offset data from node " << node <<
endl);
1582 DFDBG(dbgmsg <<
"Received offset info for " << vnodes <<
" vnodes ");
1583 DFDBG(dbgmsg <<
"from node " << node <<
endl);
1588 offdata.resize(vnodes);
1601 DFDBG(dbgmsg <<
"Scanning offset data for maxsize value ..." <<
endl);
1602 for (
int v=0; v < vnodes; ++v) {
1606 if (dom.
touches(readDomain)) {
1608 int msdim = (
Dim-1);
1611 offdata[v].isCompressed);
1613 DFDBG(dbgmsg <<
"Checking size of vnode " << v <<
" on node ");
1615 DFDBG(dbgmsg <<
", compressed = " << offdata[v].isCompressed);
1616 DFDBG(dbgmsg <<
", chunkblock = " << chunkblock <<
endl);
1619 int dsize = chunkblock.
size();
1620 if (dsize > maxsize) {
1622 DFDBG(dbgmsg <<
" New maxsize = " << maxsize <<
endl);
1625 DFDBG(dbgmsg <<
"Skipping vnode " << v <<
" since it does not ");
1626 DFDBG(dbgmsg <<
"intersect with readDomain = " << readDomain);
1627 DFDBG(dbgmsg <<
"; keeping maxsize = " << maxsize <<
endl);
1641 DFDBG(dbgmsg <<
"readsize=" << readsize <<
", seekpos=" << seekpos);
1642 DFDBG(dbgmsg <<
", sizeof(T)=" <<
sizeof(
T) <<
endl);
1650 #ifdef IPPL_DIRECTIO
1651 if (openedDirectIO) {
1658 off_t seekoffset = seekpos;
1659 size_t nbytes = readsize;
1666 #ifdef IPPL_DIRECTIO
1667 size_t nout = ::pread(outputDatafd, buffer, nbytes, seekoffset);
1670 if (::lseek(outputDatafd, seekoffset, SEEK_SET) == seekoffset) {
1671 char *rbuf = (
char *)buffer;
1672 nout =
::read(outputDatafd, rbuf, nbytes);
1683 ERRORMSG(
"Seek error in DiscField::read_data" <<
endl);
1684 ERRORMSG(
"Could not seek to position " << seekoffset <<
endl);
1688 if (nout != nbytes) {
1689 ERRORMSG(
"Read error in DiscField::read_data" <<
endl);
1690 ERRORMSG(
"Could not read " << nbytes <<
" bytes." <<
endl);
1694 DFDBG(
size_t nelem = readsize /
sizeof(
T));
1695 DFDBG(dbgmsg <<
"Read in block of " << nelem <<
" elements in ");
1697 DFDBG(
for (
unsigned int i=0; i < nelem && i < 10; ++i))
1698 DFDBG( dbgmsg <<
" buffer[" << i <<
"] = " << buffer[i] <<
endl);
1711 for (
unsigned int i=0; i <
Dim; ++i) {
1713 int stride = *(dptr + 1);
1714 int length = *(dptr + 2);
1715 domain[i] =
Index(first, first + (length - 1)*stride, stride);
1726 for (
unsigned int i=0; i <
Dim; ++i) {
1728 *dptr++ = domain[i].first();
1729 *dptr++ = domain[i].stride();
1730 *dptr++ = domain[i].length();
1747 #endif // DISC_FIELD_H
std::vector< bool > ValidField
void write_offset_and_data(FILE *outputOffset, int outputDatafd, CompressedBrickIterator< T, Dim > &cbi, const NDIndex< Dim > &owned)
void PETE_apply(const OpPeriodic< T > &e, T &a, const T &b)
bool read_offset(unsigned int varID, unsigned int record, unsigned int sf, std::vector< DFOffsetData< Dim, T > > &offdata, int vnodes)
const std::string & getConfigFile() const
unsigned int mySMP() const
static void abort(const char *=0, int exitcode=(-1))
Layout_t & getLayout() const
ac_id_larray::iterator iterator_if
const char * get_TypeString()
bool IsCompressed() const
bool write(Field< T, Dim, M, C > &f)
bool read_NDIndex(FILE *, NDIndex< Dim > &)
bool write(Field< T, Dim, M, C > &f, unsigned int varID)
ac_id_vnodes::size_type size_iv() const
std::vector< int > * NumVnodes
NDIndex< Dim > get_Domain() const
const NDIndex< Dim > & getOwned() const
touch_range_dv touch_range_rdv(const NDIndex< Dim > &domain, const GuardCellSizes< Dim > &gc=gc0()) const
bool make_globalID(FieldLayout< Dim > &)
Message & getMessage(Message &m)
void initialize(const char *base, const char *config, const char *typestr, unsigned int numFields)
unsigned int fileSMPs() const
static void * resize(long sz)
unsigned int getNumSMPNodes() const
void Uncompress(bool fill_domain=true)
bool read(Field< T, Dim, M, C > &f, unsigned int varID)
void getMessage_iter(Message &m, OutputIterator o)
unsigned int fileSMPs() const
DiscField & operator=(const DiscField< Dim > &)
unsigned int DataDimension
int next_tag(int t, int s=1000)
unsigned int myBox0() const
bool compressible() const
const iterator & begin() const
bool write_NDIndex(FILE *, const NDIndex< Dim > &)
bool parse_config(const char *, bool)
int open_df_file_fd(const std::string &fnm, const std::string &suf, int flags)
std::vector< int > * VnodeTally
bool read(Field< T, Dim, M, C > &f)
Expression Expr_t
type of an expression
unsigned int pNodesPerSMP(unsigned int node) const
unsigned int pNodesPerSMP(unsigned int node) const
void query(int &numRecords, int &numFields, std::vector< int > &size) const
void distribute_offsets(std::vector< DFOffsetData< Dim, T > > &offdata, int &vnodes, int &maxsize, const NDIndex< Dim > &readDomain)
bool touches(const NDIndex< Dim > &) const
static void startTimer(TimerRef t)
Message & putmsg(void *, int, int=0)
unsigned int get_NumRecords() const
const NDIndex< Dim > & getAllocated() const
unsigned int numSMPs() const
void fillGuardCellsIfNotDirty() const
unsigned int mySMP() const
bool read_data(int outputDatafd, T *buffer, Offset_t readsize, Offset_t seekpos)
bool IsCompressed() const
unsigned int getSMPNode(unsigned int n) const
int compute_expected(const FieldLayout< Dim > &, const NDIndex< Dim > &)
void offset_data_to_domain(DFOffsetData< Dim, T > &offdata, NDIndex< Dim > &domain)
Message & get(const T &cval)
Message & put(const T &val)
FILE * open_df_file(const std::string &fnm, const std::string &mode)
unsigned int numFiles(unsigned int s) const
void domain_to_offset_data(const NDIndex< Dim > &domain, DFOffsetData< Dim, T > &offdata)
bool read(Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain, unsigned int varID)
unsigned int get_Dimension() const
bool contains(const NDIndex< Dim > &a) const
const std::string & getFilename(unsigned int fn) const
int read_layout(int record, int sf)
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
bool read(Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain)
DiscField(const char *fname, const char *config, unsigned int numFields, const char *typestr=0)
const char * get_DiscType()
vmap< NDIndex< Dim >, int > GlobalIDList_t
Message & putMessage(Message &m) const
bool read(Field< T, Dim, M, C > &f, const NDIndex< Dim > &readDomain, unsigned int varID, unsigned int record)
unsigned int getSMPBox0() const
Timing::TimerRef TimerRef
static TimerRef getTimer(const char *nm)
bool read(Field< T, Dim, M, C > &f, unsigned int varID, unsigned int record)
NDIndex< Dim > chunk_domain(const NDIndex< Dim > &currblock, int chunkelems, int &msdim, bool iscompressed)
static void stopTimer(TimerRef t)
unsigned int numFiles() const
Message * receive_block(int &node, int &tag)
Message * receive(int &node, int &tag)
unsigned int get_NumFields() const
unsigned int getNodeSMPIndex(unsigned int n) const
Message & setDelete(const bool c)
static Communicate * Comm
Message & setCopy(const bool c)
bool send(Message *, int node, int tag, bool delmsg=true)
unsigned int getNumFiles() const
unsigned int numSMPs() const
std::pair< touch_iterator_dv, touch_iterator_dv > touch_range_dv
const NDIndex< Dim > & getDomain() const
Inform & endl(Inform &inf)
static bool perSMPParallelIO()