@@ -345,12 +345,12 @@ def get_parser() -> argparse.ArgumentParser:
345345 help = "percentage related to the number of CPU threads." )
346346 parser .add_argument ("--path-lock" , default = None , help = "Path to lock file." )
347347 parser .add_argument ("--path-cores" , default = None , help = "Path to cores file." )
348- parser .add_argument ("--cpu-work" , default = None , help = "Amount of CPU work." )
349- parser .add_argument ("--num-chunks" , default = 10 , help = "Number of chunks used for pipelining I/O and "
348+ parser .add_argument ("--cpu-work" , default = None , type = int , help = "Amount of CPU work." )
349+ parser .add_argument ("--num-chunks" , default = 10 , type = int , help = "Number of chunks used for pipelining I/O and "
350350 "computation throughout the execution (fewer chunks may be used "
351351 "if amounts of work and or input/output file sizes are too small)." )
352- parser .add_argument ("--gpu-work" , default = None , help = "Amount of GPU work." )
353- parser .add_argument ("--time-limit" , default = None , help = "Time limit (in seconds) to complete "
352+ parser .add_argument ("--gpu-work" , default = None , type = int , help = "Amount of GPU work." )
353+ parser .add_argument ("--time-limit" , default = None , type = int , help = "Time limit (in seconds) to complete "
354354 "the computational portion of the benchmark (overrides CPU and GPU works). "
355355 "Is only approximate since I/O time may make the overall time longer." )
356356 parser .add_argument ("--mem" , type = float , default = None , help = "Maximum memory consumption (in MB)." )
@@ -385,20 +385,20 @@ def end_flowcept(flowcept, flowcept_task):
385385
386386def compute_num_chunks (time_limit , cpu_work , gpu_work , num_chunks ):
387387 # Compute the (feasible number of chunks)
388- min_chunk_size_time = 1.0 # At least 1 second per chunk, if we're doing time-based
388+ min_chunk_size_time = 1 # At least 1 second per chunk, if we're doing time-based
389389 # TODO: Pick reasonable factors below so that a chunk takes about min_chunk_size_time sec on a reasonable machine
390390 min_chunk_size_cpu_work = 3000000 * min_chunk_size_time # 1s on my MacBook Pro
391391 min_chunk_size_gpu_work = 30000000 * min_chunk_size_time # unknown.....
392392
393393 if time_limit :
394- num_chunks = min (int ( num_chunks ), int ( float ( time_limit ) / min_chunk_size_time ) )
394+ num_chunks = min (num_chunks , time_limit // min_chunk_size_time )
395395 else :
396396 if cpu_work :
397397 num_chunks_cpu = min (num_chunks , cpu_work // min_chunk_size_cpu_work )
398398 else :
399399 num_chunks_cpu = 1
400400 if gpu_work :
401- num_chunks_gpu = min (int ( num_chunks ), int ( float ( gpu_work ) / min_chunk_size_gpu_work ) )
401+ num_chunks_gpu = min (num_chunks , gpu_work // min_chunk_size_gpu_work )
402402 else :
403403 num_chunks_gpu = 1
404404 num_chunks = min (num_chunks_cpu , num_chunks_gpu )
0 commit comments