Esempio n. 1
0
 def __init__(self, num_processes=1):
     self.num_processes = num_processes
     if mp.cpu_count() < num_processes:
         raise RuntimeError(
             "Specified number of processes ({0}) is higher than the system cpu count ({1})"
             .format(self.num_proceses, mp.count_cpu()))
     elif num_processes < 1:
         raise RuntimeError(
             "Specified number of processes ({0}) must be greater than 0, using default"
             .format(self.num_proceses, mp.count_cpu()))
Esempio n. 2
0
        logger.info("Submission type: {0}".format(submission_type))
        task_queue = []

        if opt.processes and not submission_type == 'VM':
            logger.warning(
                "--processes option will not be used becasue submission type is not VM"
            )

        if submission_type == 'VM':
            processes = 1
            if opt.processes:
                if mp.cpu_count() < opt.processes:
                    logger.warning(
                        "Specified number of processes ({0}) is higher than the system cpu count ({1}), using default"
                        .format(opt.proceses, mp.count_cpu()))

                elif opt.processes < 1:
                    logger.warning(
                        "Specified number of processes ({0}) must be greater than 0, using default"
                        .format(opt.proceses, mp.count_cpu()))

                else:
                    processes = opt.processes

            logger.info(
                "Number of child processes to spawn: {0}".format(processes))

        #### Get args ready to pass through
        #### Get -l args and make a var
        l = ("-l %s" % opt.l) if opt.l is not None else ""
	elif opt.submission_type == "HPC" and is_hpc is False:
	    parser.error("Submission type HPC is not available on this system")
	else:
	    submission_type = opt.submission_type
    
	logger.info("Submission type: {0}".format(submission_type))
	task_queue = []
    
	if opt.processes and not submission_type == 'VM':
	    logger.warning("--processes option will not be used becasue submission type is not VM")
    
	if submission_type == 'VM':
	    processes = 1
	    if opt.processes:
		if mp.cpu_count() < opt.processes:
		    logger.warning("Specified number of processes ({0}) is higher than the system cpu count ({1}), using default".format(opt.proceses,mp.count_cpu()))
    
		elif opt.processes < 1:
		    logger.warning("Specified number of processes ({0}) must be greater than 0, using default".format(opt.proceses,mp.count_cpu()))
    
		else:
		    processes = opt.processes
    
	    logger.info("Number of child processes to spawn: {0}".format(processes))
	

	#### Get args ready to pass through
	#### Get -l args and make a var
	l = ("-l %s" %opt.l) if opt.l is not None else ""

	args_dict = vars(opt)
Esempio n. 4
0
def get_logical_cpu_cores():
    return count_cpu()
Esempio n. 5
0
    logger.info("Submission type: {0}".format(submission_type))
    task_queue = []

    if args.processes and not submission_type == 'VM':
        logger.warning(
            "--processes option will not be used becasue submission type is not VM"
        )

    if submission_type == 'VM':
        processes = 1
        if args.processes:
            if mp.cpu_count() < args.processes:
                logger.warning(
                    "Specified number of processes ({0}) is higher than the system cpu count ({1}), using default"
                    .format(args.proceses, mp.count_cpu()))

            elif args.processes < 1:
                logger.warning(
                    "Specified number of processes ({0}) must be greater than 0, using default"
                    .format(args.proceses, mp.count_cpu()))

            else:
                processes = args.processes

        logger.info(
            "Number of child processes to spawn: {0}".format(processes))

    #### Get exclude list if specified
    if args.exclude is not None:
        if not os.path.isfile(args.exclude):
Esempio n. 6
0
 def __init__(self, num_processes=1):
     self.num_processes = num_processes
     if mp.cpu_count() < num_processes:
         raise RuntimeError("Specified number of processes ({0}) is higher than the system cpu count ({1})".format(num_proceses,mp.count_cpu()))
     elif num_processes < 1:
         raise RuntimeError("Specified number of processes ({0}) must be greater than 0, using default".format(num_proceses,mp.count_cpu()))