You're closing the file as soon as you open it. I haven't read the documentation for boost's memory mapped files, but you probably need to leave the file open.
if (file.is_open()) {
data = (cl_float3*) file.data();
file.close(); // remove this line
}