def get_host_batchid_map(workspec_list):
    """
    Get a dictionary of submissionHost: list of batchIDs from workspec_list
    return {submissionHost_1: {batchID_1_1, ...}, submissionHost_2: {...}, ...}
    """
    host_batchid_map = {}
    for workspec in workspec_list:
        host = workspec.submissionHost
        batchid = workspec.batchID
        if batchid is None:
            continue
        batchid_str = str(batchid)
        # backward compatibility if workspec.batchID does not contain ProcId
        if '.' not in batchid_str:
            batchid_str += '.0'
        try:
            host_batchid_map[host].append(batchid_str)
        except KeyError:
            host_batchid_map[host] = [batchid_str]
    return host_batchid_map