Commit 4fda7c2b by xiaotong

larger buffer of a line

parent a3ae84b5
...@@ -62,7 +62,7 @@ initialization ...@@ -62,7 +62,7 @@ initialization
*/ */
void T2TBatchLoader::Init(int argc, char ** argv) void T2TBatchLoader::Init(int argc, char ** argv)
{ {
LoadParamInt(argc, argv, "bufsize", &bufSize, 50000); LoadParamInt(argc, argv, "bufsize", &bufSize, 65000);
LoadParamBool(argc, argv, "doubledend", &isDoubledEnd, false); LoadParamBool(argc, argv, "doubledend", &isDoubledEnd, false);
LoadParamBool(argc, argv, "smallbatch", &isSmallBatch, true); LoadParamBool(argc, argv, "smallbatch", &isSmallBatch, true);
LoadParamBool(argc, argv, "bigbatch", &isBigBatch, false); LoadParamBool(argc, argv, "bigbatch", &isBigBatch, false);
...@@ -167,7 +167,8 @@ int T2TBatchLoader::LoadBuf(FILE * file, bool isSorted, int step) ...@@ -167,7 +167,8 @@ int T2TBatchLoader::LoadBuf(FILE * file, bool isSorted, int step)
if(wordCount >= bufSize - MAX_SEQUENCE_LENGTH) if(wordCount >= bufSize - MAX_SEQUENCE_LENGTH)
break; break;
CheckNTErrors(seqCount % step == 0, "Wrong number of sequences!"); CheckNTErrors(seqCount % step == 0,
"Wrong number of sequences! This line might be too long!");
} }
nseqBuf = seqCount; nseqBuf = seqCount;
...@@ -175,7 +176,8 @@ int T2TBatchLoader::LoadBuf(FILE * file, bool isSorted, int step) ...@@ -175,7 +176,8 @@ int T2TBatchLoader::LoadBuf(FILE * file, bool isSorted, int step)
/* sort the sequences by length */ /* sort the sequences by length */
if (isSorted) { if (isSorted) {
CheckNTErrors(seqCount % step == 0, "Wrong number of sequences!"); CheckNTErrors(seqCount % step == 0,
"Wrong number of sequences! This line might be too long!");
SampleNode * nodes = new SampleNode[seqCount]; SampleNode * nodes = new SampleNode[seqCount];
int count = 0; int count = 0;
int offset = 0; int offset = 0;
......
...@@ -30,7 +30,7 @@ using namespace nts; ...@@ -30,7 +30,7 @@ using namespace nts;
namespace transformer namespace transformer
{ {
#define MAX_SEQUENCE_LENGTH 1024 * 4 #define MAX_SEQUENCE_LENGTH 1024 * 16
/* node to keep batch information */ /* node to keep batch information */
struct BatchNode struct BatchNode
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论