I am trying to write into a file using process 0 only but the file is not even created in the directory, if I run it without mpich it runs fine (and the file is created in the the project directory as it should be), but not when I run with mpich.
I don't need parallel file io but I do need to parallel some other code and I do need to use files , so I am using the process 0 for this.
this is a test code for this:
void main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int numOfProcs, myid, j;
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
MPI_Comm_size(MPI_COMM_WORLD, &numOfProcs);
MPI_Status status;
if (myid==0)
{
FILE* f = fopen("wee.txt","w");
printf("address = %p",f);
fprintf(f, "ee");
fclose(f);
printf("file creation done\n");
}
MPI_Finalize();
}//END of main
The file does open and returns an address, I searched maybe it creates it in a different directory but couldn't find it.
exmple for an adress returned by the code: 00007FFB40537500
And I do get the msg: "file creation done"
The file does not exist int he folder though
edit: I am running on admin account and the project is located in system disk (not in program files , just c and project folders)