Class Blacklist
java.lang.Object
uk.ac.manchester.spinnaker.messages.model.Blacklist
- All Implemented Interfaces:
Serializable
public final class Blacklist extends Object implements Serializable
A blacklist read off a board. Note that all chip coordinates are
board-relative and all processor IDs are physical; the boot process applies
blacklists before inter-board links are brought up and before the
virtual-to-physical core mapping is established.
- Author:
- Donal Fellows
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Blacklist(File blacklistFile)
Create a blacklist from a text file.Blacklist(String blacklistText)
Create a blacklist from a string.Blacklist(ByteBuffer buffer)
Create a blacklist from raw data.Blacklist(Set<ChipLocation> deadChips, Map<ChipLocation,? extends Set<Integer>> deadCores, Map<ChipLocation,? extends Set<Direction>> deadLinks)
Create a blacklist from parsed data. -
Method Summary
Modifier and Type Method Description boolean
equals(Object object)
Set<ChipLocation>
getChips()
Map<ChipLocation,Set<Integer>>
getCores()
Map<ChipLocation,Set<Direction>>
getLinks()
ByteBuffer
getRawData()
int
hashCode()
boolean
isChipMentioned(ChipLocation chip)
Test if a chip is known about by the blacklist.String
render()
Convert the blacklist to a string in a human-readable format.String
toString()
-
Constructor Details
-
Blacklist
Create a blacklist from raw data.- Parameters:
buffer
- The raw data to parse.
-
Blacklist
public Blacklist(Set<ChipLocation> deadChips, Map<ChipLocation,? extends Set<Integer>> deadCores, Map<ChipLocation,? extends Set<Direction>> deadLinks)Create a blacklist from parsed data.- Parameters:
deadChips
- The set of chips that are dead.deadCores
- The set of physical core IDs that are dead on live chips. Should not contain any empty sets of physical core IDs; caller should ensure.deadLinks
- The set of link directions that are dead on live chips. Should not contain any empty sets of directions; caller should ensure.
-
Blacklist
Create a blacklist from a string.- Parameters:
blacklistText
- The string to parse.- Throws:
IllegalArgumentException
- If the string is badly formatted.
-
Blacklist
Create a blacklist from a text file.- Parameters:
blacklistFile
- The file to parse.- Throws:
IOException
- If the file can't be read from.IllegalArgumentException
- If the string is badly formatted.
-
-
Method Details
-
render
Convert the blacklist to a string in a human-readable format. This is the format understood byBlacklist(String)
.Note that the result may omit information in the original blacklist, but only if that would also be ignored by the string parser.
- Returns:
- The string form of the blacklist.
- Throws:
RuntimeException
- If something goes wrong. Not expected!
-
getChips
- Returns:
- The chips on the board that are blacklisted. A chip being blacklisted means that its links will also be blacklisted.
-
getCores
- Returns:
- The cores on the board that are blacklisted where the whole chip is not blacklisted. Note that these are physical processor IDs, not logical ones.
-
getLinks
- Returns:
- The links on the board that are blacklisted.
-
isChipMentioned
Test if a chip is known about by the blacklist.- Parameters:
chip
- The chip to look for. Coordinates must be board-local.- Returns:
- Whether the chip is mentioned in the blacklist. That could be if it is blacklisted, if it has a blacklisted core, of if one of its links is blacklisted.
-
getRawData
- Returns:
- The raw blacklist data in little-endian form. Read only.
-
hashCode
public int hashCode() -
equals
-
toString
-