-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory support (Issue #42) #153
base: master
Are you sure you want to change the base?
Changes from all commits
da6feb9
87771cf
821ca37
ffc8ce5
1779a4f
dfa1391
8446e5e
3b193ff
110beed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,18 +146,22 @@ def main(): | |
log_folder=path_job_logs, worker_call_suffix=worker_call_suffix) | ||
commands = [COMMAND_STRING.format(ID=i) for i in range(args.pool)] | ||
|
||
# TODO: use args.memPerNode instead of args.memPerNode | ||
queue = Queue(args.queueName, CLUSTER_NAME, args.walltime, args.coresPerNode, args.gpusPerNode, float('inf'), args.modules) | ||
queue = Queue(args.queueName, CLUSTER_NAME, args.walltime, args.coresPerNode, args.gpusPerNode, args.memPerNode, args.modules) | ||
|
||
# Check that requested core number does not exceed node total | ||
# Check that requested per command resources do not exceed node total | ||
if args.coresPerCommand > queue.nb_cores_per_node: | ||
sys.stderr.write("smart-dispatch: error: coresPerCommand exceeds nodes total: asked {req_cores} cores, nodes have {node_cores}\n" | ||
.format(req_cores=args.coresPerCommand, node_cores=queue.nb_cores_per_node)) | ||
sys.exit(2) | ||
|
||
if args.memPerCommand > queue.mem_per_node: | ||
sys.stderr.write("smart-dispatch: error: memPerCommand exceeds nodes total: asked {req_mem} Gb, nodes have {node_mem} Gb\n" | ||
.format(req_mem=args.memPerCommand, node_mem=queue.mem_per_node)) | ||
sys.exit(2) | ||
|
||
command_params = {'nb_cores_per_command': args.coresPerCommand, | ||
'nb_gpus_per_command': args.gpusPerCommand, | ||
'mem_per_command': None # args.memPerCommand | ||
'mem_per_command': args.memPerCommand | ||
} | ||
|
||
prolog = [] | ||
|
@@ -172,7 +176,7 @@ def main(): | |
for pbs_id, pbs in enumerate(job_generator.pbs_list): | ||
proper_size_name = utils.jobname_generator(jobname, pbs_id) | ||
pbs.add_options(N=proper_size_name) | ||
|
||
if args.pbsFlags is not None: | ||
job_generator.add_pbs_flags(args.pbsFlags.split(' ')) | ||
pbs_filenames = job_generator.write_pbs_files(path_job_commands) | ||
|
@@ -193,11 +197,11 @@ def parse_arguments(): | |
parser.add_argument('-L', '--launcher', choices=['qsub', 'msub'], required=False, help='Which launcher to use. Default: qsub') | ||
parser.add_argument('-C', '--coresPerNode', type=int, required=False, help='How many cores there are per node.') | ||
parser.add_argument('-G', '--gpusPerNode', type=int, required=False, help='How many gpus there are per node.') | ||
# parser.add_argument('-M', '--memPerNode', type=int, required=False, help='How much memory there are per node (in Gb).') | ||
parser.add_argument('-M', '--memPerNode', type=float, required=False, help='How much memory there are per node (in Gb).') | ||
|
||
parser.add_argument('-c', '--coresPerCommand', type=int, required=False, help='How many cores a command needs.', default=1) | ||
parser.add_argument('-g', '--gpusPerCommand', type=int, required=False, help='How many gpus a command needs.', default=1) | ||
# parser.add_argument('-m', '--memPerCommand', type=float, required=False, help='How much memory a command needs (in Gb).') | ||
parser.add_argument('-m', '--memPerCommand', type=float, required=False, help='How much memory a command needs (in Gb).') | ||
parser.add_argument('-f', '--commandsFile', type=file, required=False, help='File containing commands to launch. Each command must be on a seperate line. (Replaces commandAndOptions)') | ||
|
||
parser.add_argument('-l', '--modules', type=str, required=False, help='List of additional modules to load.', nargs='+') | ||
|
@@ -224,7 +228,9 @@ def parse_arguments(): | |
if args.queueName not in AVAILABLE_QUEUES and ((args.coresPerNode is None and args.gpusPerNode is None) or args.walltime is None): | ||
parser.error("Unknown queue, --coresPerNode/--gpusPerNode and --walltime must be set.") | ||
if args.coresPerCommand < 1: | ||
parser.error("coresPerNode must be at least 1") | ||
parser.error("coresPerCommand must be at least 1") | ||
if args.memPerCommand is not None and args.memPerCommand <= 0: | ||
parser.error("memPerCommand must be positive") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe: 'strictly' positive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops it is |
||
|
||
return args | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, good catch.