While "whole" and "all" carry the same meaning, they cannot be used interchangeably.
"All the" and "the whole" with nouns are differentiated this way, according to L. G. Alexander*:
"We usually prefer
the whole to
all the with singular concrete nouns.
The whole is not normally used with plurals and uncountables:
He ate the whole loaf(=all the loaf)
by himself.All and
the whole combine with a number of (often abstract) nouns. For example, we can use
all or
the whole in:
all my business/ my whole business, all my life/ my whole life, all the time/ the whole time,, etc., but normally only
all in: e.g.
all my hair, all the money; and normally only
the whole in:e.g.
the whole situation, the whole story, the whole truth.
Whole can follow
a, as in
a whole collection, a whole loaf, a whole week/ hour."
Here's more:
"Whole" can be an adjective, meaning consisting of all components, complete. Note the singular count nouns it modifies.
(a)
The whole world is horrified.
(b) They spent
the whole winter in the south of France.
(c) He choked swallowing
a whole piece of meat - he should have chewed it.
Sentences (a) and (b) could be expressed alternatively with "all the" - (a)
All the world is horrified and (b)
all summer or
all the summer. The meaning of (c) - complete, as opposed to parts - would not be expressed with "all."
"All," too, can be an adjective, meaning the entire amount or number. In these constructions with noncount nouns and plural count nouns, "whole" would not be used.
(d) You have to boil
all your water until they fix find the source of the contamination.
(e)
All free advice must be taken with a grain of salt.
(f)
All students must carry an ID.
(g)
All the students in Mr. Garcia's class passed the examination.
(h)
All of the students who need financial aid must fill out an application.
"All" is a determiner, more exactly called a "pre-determiner," meaning it can occur before other determiners such as "the," "my," "this," etc. "Whole" as an adjective must occur
after the determiner(s):
(i) I've known him
all my life.
(j) I've known him
my whole life.
(k)
All the same people were at the party.
(l)
The same whole bunch of people were at the party.
"Whole" can also be a singular count noun, meaning the complete number of something, of a group. It can be modified by an adjective, and preceded by an article:
(m) An atom itself is
a complete whole , with its electrons, protons, and neutrons and other elements.
(n) While parts of the novel are incomprehensible,
the whole represents the prevailing thought of the era.
(o) Taken as a percentage of
the whole, the mouth has to be a fairly minor body part.
"All" can be a pronoun, but not a noun, and cannot be preceded by an adjective, an article or another determiner:
(p)
All's quiet on the western front.
(q) As you know,
all is not well here.
(r) After
all is said and done, there is really only one.
(s)
All are accounted for, sir.