Changeset 955
- Timestamp:
- 10/22/06 15:06:39 (7 years ago)
- Location:
- sandbox/trunk/pdp/src
- Files:
-
- 2 modified
-
N-body.cpp (modified) (3 diffs)
-
Replication.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/trunk/pdp/src/N-body.cpp
r954 r955 196 196 OPT_DISTRIBUTE, 197 197 OPT_STEP, 198 OPT_NUM_PARTICLE 198 OPT_NUM_PARTICLE, 199 OPT_LOGLEVEL 199 200 }; 200 201 OptionParser opt; … … 204 205 opt.add(OptionWithArgument(OPT_STEP, "s", "step", "STEP", "num calculation steps (default = 100)")); 205 206 opt.add(OptionWithArgument(OPT_NUM_PARTICLE, "p", "particle", "NUM", "num particles (default = 10)")); 207 opt.add(OptionWithArgument(OPT_LOGLEVEL, "w", "loglevel", "LOGLEVEL", "0:all, 1:trace, 2:debug, 3:info, 4:warn, 5:error, 6:fatal, 7:off)")); 206 208 207 209 try … … 217 219 { 218 220 Logger::getRootLogger()->setLevel("trace"); 221 } 222 if(opt.isSet(OPT_LOGLEVEL)) 223 { 224 int logLevel = Integer::parseInt(opt.getValue(OPT_LOGLEVEL)); 225 Logger::getRootLogger()->setLevel(logLevel); 219 226 } 220 227 -
sandbox/trunk/pdp/src/Replication.cpp
r954 r955 61 61 OPT_VERBOSE, 62 62 OPT_REPLICATION_MODE, 63 OPT_BUFFERSIZE 63 OPT_BUFFERSIZE, 64 OPT_LOGLEVEL 64 65 }; 65 66 … … 71 72 opt.add(OptionWithArgument(OPT_REPLICATION_MODE, "m", "replication", "MODE", " 0 (default) : one to N replication, 1 : chain replication")); 72 73 opt.add(OptionWithArgument(OPT_BUFFERSIZE, "b", "buffer", "MBYTES", "buffer size (default: 16M)")); 74 opt.add(OptionWithArgument(OPT_LOGLEVEL, "w", "loglevel", "LOGLEVEL", "0:all, 1:trace, 2:debug, 3:info, 4:warn, 5:error, 6:fatal, 7:off)")); 73 75 74 76 opt.getContext(argc, argv); … … 81 83 if(opt.getArgumentLength() < 1) 82 84 XERIAL_THROW(InvalidParameterException, "input file name must be given"); 85 if(opt.isSet(OPT_LOGLEVEL)) 86 { 87 int logLevel = Integer::parseInt(opt.getValue(OPT_LOGLEVEL)); 88 Logger::getRootLogger()->setLevel(logLevel); 89 } 83 90 84 91 … … 234 241 MPI::INT.Unpack(&(packedDataBuffer[0]), 1, &incomingDataSize, 1, packedBufferPosition, comm); 235 242 XERIAL_DEBUG(_logger, "incoming bytes = " << incomingDataSize); 236 //MPI::BYTE.Unpack(&(packedDataBuffer[0]), incomingDataSize, &(fileBuffer[0]), _bufferSize, packedBufferPosition, comm); 237 size_t writesize = fwrite(&(packedDataBuffer[packedBufferPosition]), 1, incomingDataSize, file.getHandle()); 243 MPI::BYTE.Unpack(&(packedDataBuffer[0]), incomingDataSize, &(fileBuffer[0]), _bufferSize, packedBufferPosition, comm); 244 245 size_t writesize = fwrite(&(fileBuffer[0]), 1, incomingDataSize, file.getHandle()); 238 246 if(writesize != incomingDataSize) 239 247 XERIAL_THROW(Exception, "write failed. write size = " << writesize);


