Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOURCEFORGE-17] cgp_mpi_comm passes wrong type #394

Open
brtnfld opened this issue Jan 20, 2015 · 0 comments
Open

[SOURCEFORGE-17] cgp_mpi_comm passes wrong type #394

brtnfld opened this issue Jan 20, 2015 · 0 comments
Assignees

Comments

@brtnfld
Copy link
Member

brtnfld commented Jan 20, 2015

using openmpi 1.8.4 and gfortran,gcc on the Mac cgp_mpi_comm segfaults.

ier = cgp_mpi_comm(int mpicomm);
should be
ier = cgp_mpi_comm(MPI_Comm mpicomm);

In the calls made by cgp_mpi_comm, we should not be converting MPI_comm variables to size_t and then back again to MPI_Comm.

We also need to check the warnings passing MPI_Comm from fortran (which is an integer) to C.

/Users/brtnfld/packages/cgns/trunk/src/cg_ftoc.c:3643:17: warning: cast to 'MPI_Comm' (aka 'struct ompi_communicator_t *') from smaller integer type
'int' [-Wint-to-pointer-cast]
mpi_comm_c = MPI_Comm_f2c((int)*mpi_comm_f);
^
/Users/brtnfld/packages/cgns/trunk/src/cg_ftoc.c:35:28: note: expanded from macro 'MPI_Comm_f2c'
#define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
^
/Users/brtnfld/packages/cgns/trunk/src/cg_ftoc.c:3655:20: warning: cast to 'MPI_Info' (aka 'struct ompi_info_t *') from smaller integer type 'int'
[-Wint-to-pointer-cast]
pcg_mpi_info_c = MPI_Info_f2c((int)*pcg_mpi_info_f);
^
/Users/brtnfld/packages/cgns/trunk/src/cg_ftoc.c:36:28: note: expanded from macro 'MPI_Info_f2c'
#define MPI_Info_f2c(info) (MPI_Info)(info)

Reported by: brtnfld

@brtnfld brtnfld self-assigned this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant