Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] warnings and anachronisms in openmpi-1.7.4
From: Siegmar Gross (Siegmar.Gross_at_[hidden])
Date: 2014-02-10 01:29:55


Hi Oscar,

I always favor no warnings, but it's not me to make this decision.

Kind regards and thank you very much for your replies

Siegmar

> Quoting Siegmar Gross <Siegmar.Gross_at_[hidden]>:
>
> > Hi Oscar,
> >
> >> The warnings of type "cast to pointer from integer of different size"
> >> are provoked when a jlong (64 bit handle in Java) is copied to a C
> >> pointer (32 bit) or vice versa.
> >>
> >> These warnings could be avoided with methods like these:
> >>
> >> void* ompi_java_cHandle(jlong handle)
> >> {
> >> union { jlong j; void* c; } u;
> >> u.j = handle;
> >> return u.c;
> >> }
> >>
> >> jlong ompi_java_jHandle(void *handle)
> >> {
> >> union { jlong j; void* c; } u;
> >> u.c = handle;
> >> return u.j;
> >> }
> >>
> >> We should change all the code in this manner:
> >>
> >> JNIEXPORT jlong JNICALL Java_mpi_Win_free(
> >> JNIEnv *env, jobject jthis, jlong handle)
> >> {
> >> MPI_Win win = ompi_java_cHandle(handle);
> >> int rc = MPI_Win_free(&win);
> >> ompi_java_exceptionCheck(env, rc);
> >> return ompi_java_jHandle(win);
> >> }
> >>
> >> I don't know if it is worth it.
> >
> > I don't know either, but you will possibly get an error if you store
> > a 64-bit value into a 32-bit pointer. If the Java interface should be
> > available on 32-bit systems as well, it would be necessary (at least
> > in my opinion).
>
> There is no loss of information, because the 64-bit values (java long)
> come from 32-bit values (c pointers). It works ok.
>
> The question is if we want avoid these warnings.
>
> >
> >
> > Kind regards
> >
> > Siegmar
> >
> >
> >
> >>
> >> Regards,
> >> Oscar
> >>
> >> Quoting Siegmar Gross <Siegmar.Gross_at_[hidden]>:
> >>
> >> > Hi,
> >> >
> >> > yesterday I compiled 32- and 64-bit versions of openmpi-1.7.4 for
> >> > my platforms (Solaris 10 sparc, Solaris 10 x86_64, and openSUSE
> >> > Linux 12.1 x86_64) with Sun C 5.12 and gcc-4.8.0. I could build
> >> > a 64-bit version for Linux with gcc without warnings. Everything
> >> > else showed warnings. I received many warnings for my 32-bit
> >> > versions (mainly for the Java interface with gcc). I have combined
> >> > all warnings for my platforms so that it is easier to fix them, if
> >> > somebody wants to fix them. The attached files contain the warnings
> >> > from each compiler. I can also provide specific files like
> >> > Solaris.x86_64.32_cc.uniq or even my log files (e.g.,
> >> > log.make.SunOS.x86_64.32_cc).
> >> >
> >> >
> >> > Kind regards
> >> >
> >> > Siegmar
> >> >
> >>
> >>
> >>
> >> ----------------------------------------------------------------
> >> This message was sent using IMP, the Internet Messaging Program.
> >>
> >>
> >
> > _______________________________________________
> > users mailing list
> > users_at_[hidden]
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> >
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>