DCMP(1)
π dcmp β distributed compare β¨
okay so bestie, welcome to dcmp(1) from mpiFileUtils β yes that's the manual name, i'm folding it in, you're welcome π
π SYNOPSIS
dcmp [OPTION] SRC DEST
π¦ DESCRIPTION
It's a parallel MPI application, bestie. Like, actually parallel. It compares two files, or it recursively compares files that have the same relative paths inside two different directories. fr fr.
dcmp gives you functionality similar to a recursive cmp(1) β it reports how many files in two different directories are the same and how many are different. Lowkey iconic.
And the fun part? dcmp can be configured to compare a whole bunch of different file properties. Not just contents. We're talking properties. Obsessed.
β¨ OPTIONS β¨
-o,--output EXPR:FILEβ writes the list of files matching expressionEXPRto the specifiedFILE. The expression is a set of fields and states (more on those below, keep scrolling π). You can pass more than one-ooption in a single invocation β just make sure each one has a different output file name, okay? No fighting over filenames.-t,--textβ changes--outputso it writes files in text format instead of binary. Human-readable, slay.-b,--baseβ enables base checks and normal stdout results even when--outputis being used. So you get both, bestie.--bufsize SIZEβ sets the I/O buffer toSIZEbytes. Units like"MB"and"GB"may go immediately after the number with no space (e.g.8MB). The default bufsize is4MB.--chunksize SIZEβ multiple processes copy a large file in parallel by dividing it into chunks, and this sets the chunk to be at minimumSIZEbytes. Units like"MB"and"GB"can immediately follow the number without spaces (e.g.64MB). The default chunksize is4MB.--daos-api APIβ specifies the DAOS API to be used. By default the API is automatically determined based on the container type, where POSIX containers use the DFS API and all other containers use the DAOS object API. Values must be in{DFS, DAOS}. No freestyling π«Ά-s,--directβ usesO_DIRECTto avoid caching file data. Skips the middleman, honestly.--open-noatimeβ opens files with theO_NOATIMEflag.--progress Nβ prints a progress message to stdout approximately everyNseconds. The number of seconds must be a non-negative integer. A value of0disables progress messages. (so--progress 0= peace and quiet π)-v,--verboseβ runs in verbose mode, printing a list of statistics/timing data for the command: files walked, started, completed, seconds, files, bytes read, byte rate, and file rate. Numbers girlies rise π-q,--quietβ runs the tool silently. No output is printed. Not a single peep.-l,--liteβ lite mode does a comparison of file modification time and size. If modification time and size are the same, then the contents are assumed to be the same. Similarly, if the modification time or size is different, then the contents are assumed to be different. The lite mode does no comparison of data/content in the file. So like, it's trusting. Maybe too trusting. iykyk.-h,--helpβ prints the command usage and the list of options available. The classic.
π§ EXPRESSIONS
An expression is made up of one or more conditions, where each condition specifies a field and a state. A single condition is: a field name, an = sign, and a state name. That's the whole vibe check.
π Valid fields
Here's the field list, plus the property of the entry each one checks:
EXISTβ whether the entry existsTYPEβ type of entry, e.g., regular file, directory, symlinkSIZEβ size of entry in bytes, if a regular fileUIDβ user id of entryGIDβ group id of entryATIMEβ time of last accessMTIMEβ time of last modificationCTIMEβ time of last status changePERMβ permission bits of entryACLβ ACLs associated with entry, if anyCONTENTβ file contents of entry, byte-for-byte comparision, if a regular file
π Valid conditions for the EXIST field
EXIST=ONLY_SRCβ entry exists only in source pathEXIST=ONLY_DESTβ entry exists only in destination pathEXIST=DIFFERβ entry exists in either source or destination, but not bothEXIST=COMMONβ entry exists in both source and destination
All other fields may only specify the DIFFER and COMMON states. That's the rule, periodt.
πΈ Combining conditions
Conditions can be joined together with AND (@) and OR (,) operators, with no spaces, to build complex expressions. For example, this expression reports entries that exist in both source and destination paths, but are of different types:
EXIST=COMMON@TYPE=DIFFER
The AND operator binds with higher precedence than the OR operator. For example, the following expression matches on entries which either (exist in both source and destination and whose types differ) or (only exist in the source):
EXIST=COMMON@TYPE=DIFFER,EXIST=ONLY_SRC
β Conditions that imply other conditions
Some conditions imply others. For example, for CONTENT to be considered the same, the entry must exist in both source and destination, the types must match, the sizes must match, and finally the contents must match:
SIZE=COMMON => EXISTS=COMMON@TYPE=COMMON@SIZE=COMMON
CONTENT=COMMON => EXISTS=COMMON@TYPE=COMMON@SIZE=COMMON@CONTENT=COMMON
A successful check on any other field also implies that EXIST=COMMON.
π Expressions with -o
When used with the -o option, you also have to specify a file name at the end of the expression, separated with a :. The list of any entries that match the expression gets written to the named file. For example, to list any entries matching the above expression to a file named outfile1, you'd use this option:
-o EXIST=COMMON@TYPE=DIFFER:outfile1
π The default checks
If the --base option is given, or when no output option is specified, the following expressions are checked and numeric results are reported to stdout:
EXIST=COMMON
EXIST=DIFFER
EXIST=COMMON@TYPE=COMMON
EXIST=COMMON@TYPE=DIFFER
EXIST=COMMON@CONTENT=COMMON
EXIST=COMMON@CONTENT=DIFFER
π₯ EXAMPLES
- Compare two files in different directories:
mpirun -np 128 dcmp /src1/file1 /src2/file2
- Compare two directories with verbose output. The verbose output prints timing and number of bytes read:
mpirun -np 128 dcmp -v /src1 /src2
- Write a list of entries to
outfile1that are only insrc1, or whose names exist in bothsrc1andsrc2but whose types differ:
mpirun -np 128 dcmp -o EXIST=COMMON@TYPE=DIFFER,EXIST=ONLY_SRC:outfile1
/src1 /src2
- Same as above, but also write a list of entries to
outfile2that exist in eithersrc1orsrc2but not both:
mpirun -np 128 dcmp -o EXIST=COMMON@TYPE=DIFFER,EXIST=ONLY_SRC:outfile1
-o EXIST=DIFFER:outfile2 /src1 /src2
π«Ά SEE ALSO
The mpiFileUtils source code and all documentation may be downloaded from <https://github.com/hpc/mpifileutils>
π AUTHOR
HPC
π COPYRIGHT
2022, LLNL/LANL/UT-Battelle/DDN
okay that's the whole page bestie, go compare some files πβ¨ this was version 0.12, dated Jan 29, 2025 β and that's the DCMP(1) manual page, mwah ππ¦
π¦ where this page comes from
- nixpkgs unstable: mpifileutils 0.12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms