This requires fcntl(2) to be implemented. As of 8/25/2011 it is not. Generic MPICH Message: File locking failed in ADIOI_Set_lock(fd 6,cmd F_SETLKW/7,type F_WRLCK/1,whence 0) with return value FFFFFFFF and errno 26.
- If the file system is NFS, you need to use NFS version 3, ensure that the lockd daemon is running on all the machines, and mount the directory with the 'noac' option (no attribute caching).
- If the file system is LUSTRE, ensure that the directory is mounted with the 'flock' option.
ADIOI_Set_lock:: Function not implemented
ADIOI_Set_lock:offset 0, length 4
#include <stdlib.h>
#include <mpi.h>
int main(int argc, char **argv) {
int buf, err;
MPI_File fh;
MPI_Status status;
MPI_Init(&argc, &argv);
if (argc != 2) {
printf("Usage: %s filename\n", argv[0]);
MPI_Finalize();
return 1;
}
err = MPI_File_open(MPI_COMM_WORLD, argv[1], MPI_MODE_CREATE |
MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
if (err != MPI_SUCCESS) printf("Error: MPI_File_open()\n");
err = MPI_File_write_all(fh, &buf, 1, MPI_INT, &status);
if (err != MPI_SUCCESS) printf("Error: MPI_File_write_all()\n");
MPI_File_close(&fh);
MPI_Finalize();
return 0;
}