I had to replace mpich2 with OpenMPI due to dependency of OpenFOAM on OpenMPI.
Earlier (when using mpich2) in my code I was using gethostname() function to get the name of the machine for debugging purpose. However this function does not seem to be a standard MPI function, and is not working anymore with OpenMPI libraries. Is there any other function for getting the host name in OpenMPI, or MPI standard? I am using mpicc for compiling and mpirun for running the code.
Thanks,
Sourabh
gethostname
is not a standard MPI function. Are you confusing it withMPI_Get_processor_name
which is ? – Rosiarosicruciangethostname()
is inunistd.h
. How exactly is it not working with Open MPI? – Proximityunistd.h
butgethostname()
was working when I was including onlympi.h
andstdio.h
The only explanation I have is thatgethostname()
might be defined inside some library inmpich2
'smpi.h
. – Squinteyed