Skip to content

Commit

Permalink
make C and Java consistent with eachother, set reasonable values for …
Browse files Browse the repository at this point in the history
…defaults and maxes
  • Loading branch information
carltimmer committed Aug 29, 2024
1 parent 9320f79 commit 550ea0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions java/org/jlab/coda/jevio/EventWriterUnsyncV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ public enum IOStatus {

/**
* The lower limit of maximum size for a single block used for writing,
* in ints (words). This gives block sizes of about 32k bytes.
* in ints (words). This gives block sizes of 32768k (2^15) bytes.
*/
static final int MIN_BLOCK_SIZE = 16;
static final int MIN_BLOCK_SIZE = 8192;

/** The lower limit of maximum event count for a single block used for writing. */
static final int MIN_BLOCK_COUNT = 1;

/** Size of block header in bytes. */
static final int headerBytes = 32;

/** Size of block header in bytes. */
/** Size of block header in words. */
static final int headerWords = 8;

/** Turn on or off the debug printout. */
Expand Down
6 changes: 3 additions & 3 deletions java/org/jlab/coda/jevio/EventWriterV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ public class EventWriterV4 {

/**
* The lower limit of maximum size for a single block used for writing,
* in ints (words). This gives block sizes of about 32k bytes.
* in ints (words). This gives block sizes of 32768k (2^15) bytes.
*/
static final int MIN_BLOCK_SIZE = 16;
static final int MIN_BLOCK_SIZE = 8192;

/** The lower limit of maximum event count for a single block used for writing. */
static final int MIN_BLOCK_COUNT = 1;

/** Size of block header in bytes. */
static final int headerBytes = 32;

/** Size of block header in bytes. */
/** Size of block header in words. */
static final int headerWords = 8;

/** Turn on or off the debug printout. */
Expand Down
14 changes: 8 additions & 6 deletions src/libsrc++/EventWriterV4.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ namespace evio {

/**
* The default maximum size, in bytes, for a single block used for writing.
* It's set to 16MB since that's an efficient number for writing to modern disks.
* It's set to 16MB (2^24) since that's an efficient number for writing to modern disks.
* And it is consistent with the java version of this class.
* It is a soft limit since a single event larger than this limit may need to be written.
*/
static const int DEFAULT_BLOCK_SIZE = 16000000;
static const int DEFAULT_BLOCK_SIZE = 16777216;

/** The default maximum event count for a single block used for writing. */
static const int DEFAULT_BLOCK_COUNT = 10000;
Expand Down Expand Up @@ -189,21 +190,22 @@ namespace evio {
/** Mask to get version number from 6th int in block. */
static const int VERSION_MASK = 0xff;

/**
/**
* The upper limit of maximum size for a single block used for writing
* is randomly chosen to be 10*16MB = 160MB.
* is randomly chosen to be ~134MB (actually 2^27).
* Make this consistent with java implementation.
* It is a soft limit since a single event larger than this limit
* may need to be written.
*/
static const int MAX_BLOCK_SIZE = 160000000;
static const int MAX_BLOCK_SIZE = 134217728;

/** The upper limit of maximum event count for a single block used for writing. */
static const int MAX_BLOCK_COUNT = 1000000;

/**
* The lower limit of maximum size for a single block used for writing, in bytes.
*/
static const int MIN_BLOCK_SIZE = 16000;
static const int MIN_BLOCK_SIZE = 32768;

/** The lower limit of maximum event count for a single block used for writing. */
static const int MIN_BLOCK_COUNT = 1;
Expand Down

0 comments on commit 550ea0e

Please sign in to comment.