Re: [OMPI users] Java MPI and OWL API: segmentation fault

2015-02-12 Thread Oscar Vega-Gisbert

Hi Ricardo,

Thanks for your information.
Unfortunately, your solution does not work here:
https://github.com/open-mpi/ompi/issues/369

Regards,
Oscar

El 12/02/15 a las 09:53, Riccardo Zese escribió:

I have just solved my problem by specifying
export LD_PRELOAD=libjvm.so-directory/libjsig.so;
before the call to mpirun.
In my case it missed signal chaining 
(http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals.html).


2015-02-11 20:30 GMT+01:00 Jeff Squyres (jsquyres) >:


This may well be related to:

https://github.com/open-mpi/ompi/issues/369


> On Feb 10, 2015, at 9:24 AM, Riccardo Zese
> wrote:
>
> Hi,
> I'm trying to modify an old algorithm of mine in order to
exploit parallelization and I would like to use MPI. My algorithm
is written in Java and make use of OWL API library. I've noticed
that if I try to load an ontology after the initialization of MPI
the process ends returning signal 11 (segmentation fault).
>
> The code I've tried to test is below
>
> public static void main(String[] args) {
>
> try {
> MPI.Init(args);
>
> OWLOntologyManager manager;
> OWLOntology ontology = null;
>
> manager = new OWLManager().buildOWLOntologyManager();
> String ontologyPath = "file:/path/to/file"; //This
variable contains the correct path
> System.out.println("Before load");
> ontology =
manager.loadOntologyFromOntologyDocument(IRI.create(ontologyPath));
> System.out.println("After load");
>
> MPI.Finalize();
>
>
>
> } catch (MPIException | OWLOntologyCreationException ex) {
> System.out.println(ex);
> }
>
> }
>
>
> Does anyone have an idea of why or where is the error?
>
> --
> Riccardo Zese
> PhD Student
> ENDIF - Dipartimento di Ingegneria
> Università di Ferrara
> Via Saragat 1, I-44122,  Ferrara,  Italy
> Tel. +39 0532974827 
> ___
> users mailing list
> us...@open-mpi.org 
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
http://www.open-mpi.org/community/lists/users/2015/02/26312.php


--
Jeff Squyres
jsquy...@cisco.com 
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/

___
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2015/02/26314.php




--
Riccardo Zese
PhD Student
ENDIF - Dipartimento di Ingegneria
Università di Ferrara
Via Saragat 1, I-44122,  Ferrara,  Italy
Tel. +39 0532974827


___
users mailing list
us...@open-mpi.org
Subscription:http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this 
post:http://www.open-mpi.org/community/lists/users/2015/02/26318.php




Re: [OMPI users] Segfault in mpi-java

2015-02-01 Thread Oscar Vega-Gisbert

Hi,

I created an issue with a simplified example:

https://github.com/open-mpi/ompi/issues/369

Regards,
Oscar


El 25/01/15 a las 19:36, Oscar Vega-Gisbert escribió:

Hi,

I also reproduce this behaviour. But I think this crash is not related 
with garbage collector. Java is much better than you think.


May be MPI corrupts the Java runtime heap.

Regards,
Oscar

El 22/01/15 a las 08:07, Gilles Gouaillardet escribió:

Alexander,

i was able to reproduce this behaviour.

basically, bad things happen when the garbage collector is invoked ...
i was even able to reproduce some crashes (but that happen at random
stages) very early in the code
by manually inserting calls to the garbage collector (e.g. System.gc();)

Cheers,

Gilles

On 2015/01/19 9:03, Alexander Daryin wrote:

Hi

I am using Java MPI bindings and periodically get fatal erros. This 
is illustrated by the following model Java program.


import mpi.MPI;
import mpi.MPIException;
import mpi.Prequest;
import mpi.Request;
import mpi.Status;

import java.nio.ByteBuffer;
import java.util.Random;

public class TestJavaMPI {

private static final int NREQ = 16;
private static final int BUFFSIZE = 0x2000;
private static final int NSTEP = 10;

public static void main(String... args) throws MPIException {
MPI.Init(args);
Random random = new Random();
Prequest[] receiveRequests = new Prequest[NREQ];
Request[] sendRequests = new Request[NREQ];
ByteBuffer[] receiveBuffers = new ByteBuffer[NREQ];
ByteBuffer[] sendBuffers = new ByteBuffer[NREQ];
for(int i = 0; i < NREQ; i++) {
receiveBuffers[i] = MPI.newByteBuffer(BUFFSIZE);
sendBuffers[i] = MPI.newByteBuffer(BUFFSIZE);
receiveRequests[i] = 
MPI.COMM_WORLD.recvInit(receiveBuffers[i], BUFFSIZE, MPI.BYTE, 
MPI.ANY_SOURCE, MPI.ANY_TAG);

receiveRequests[i].start();
sendRequests[i] = MPI.COMM_WORLD.iSend(sendBuffers[i], 
0, MPI.BYTE, MPI.PROC_NULL, 0);

}
for(int step = 0; step < NSTEP; step++) {
if( step % 128 == 0 ) System.out.println(step);
int index;
do {
Status status = Request.testAnyStatus(receiveRequests);
if( status != null )
receiveRequests[status.getIndex()].start();
index = Request.testAny(sendRequests);
} while( index == MPI.UNDEFINED );
sendRequests[index].free();
sendRequests[index] = 
MPI.COMM_WORLD.iSend(sendBuffers[index], BUFFSIZE, MPI.BYTE,

random.nextInt(MPI.COMM_WORLD.getSize()), 0);
}
MPI.Finalize();
}
}

On Linux, this produces a segfault after about a million steps. On 
OS X, instead of segfault it prints the following error message


java(64053,0x127e4d000) malloc: *** error for object 0x7f80eb828808: 
incorrect checksum for freed object - object was probably modified 
after being freed.

*** set a breakpoint in malloc_error_break to debug
[mbp:64053] *** Process received signal ***
[mbp:64053] Signal: Abort trap: 6 (6)
[mbp:64053] Signal code:  (0)
[mbp:64053] [ 0] 0   libsystem_platform.dylib 0x7fff86b5ff1a 
_sigtramp + 26

[mbp:64053] [ 1] 0   ??? 0x 0x0 + 0
[mbp:64053] [ 2] 0   libsystem_c.dylib 0x7fff80c7bb73 abort + 129
[mbp:64053] [ 3] 0   libsystem_malloc.dylib 0x7fff8c26ce06 
szone_error + 625
[mbp:64053] [ 4] 0   libsystem_malloc.dylib 0x7fff8c2645c8 
small_free_list_remove_ptr + 154
[mbp:64053] [ 5] 0   libsystem_malloc.dylib 0x7fff8c2632bf 
szone_free_definite_size + 1856
[mbp:64053] [ 6] 0   libjvm.dylib 0x00010e257d89 _ZN2os4freeEPvt 
+ 63
[mbp:64053] [ 7] 0   libjvm.dylib 0x00010dea2b0a 
_ZN9ChunkPool12free_all_butEm + 136
[mbp:64053] [ 8] 0   libjvm.dylib 0x00010e30ab33 
_ZN12PeriodicTask14real_time_tickEi + 77
[mbp:64053] [ 9] 0   libjvm.dylib 0x00010e3372a3 
_ZN13WatcherThread3runEv + 267
[mbp:64053] [10] 0   libjvm.dylib 0x00010e25d87e 
_ZL10java_startP6Thread + 246
[mbp:64053] [11] 0   libsystem_pthread.dylib 0x7fff8f1402fc 
_pthread_body + 131
[mbp:64053] [12] 0   libsystem_pthread.dylib 0x7fff8f140279 
_pthread_body + 0
[mbp:64053] [13] 0   libsystem_pthread.dylib 0x7fff8f13e4b1 
thread_start + 13

[mbp:64053] *** End of error message ***

OpenMPI version is 1.8.4. Java version is 1.8.0_25-b17.

Best regards,
Alexander Daryin
___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/01/26215.php

___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/01/26230.php






Re: [OMPI users] Segfault in mpi-java

2015-01-25 Thread Oscar Vega-Gisbert

Hi,

I also reproduce this behaviour. But I think this crash is not related 
with garbage collector. Java is much better than you think.


May be MPI corrupts the Java runtime heap.

Regards,
Oscar

El 22/01/15 a las 08:07, Gilles Gouaillardet escribió:

Alexander,

i was able to reproduce this behaviour.

basically, bad things happen when the garbage collector is invoked ...
i was even able to reproduce some crashes (but that happen at random
stages) very early in the code
by manually inserting calls to the garbage collector (e.g. System.gc();)

Cheers,

Gilles

On 2015/01/19 9:03, Alexander Daryin wrote:

Hi

I am using Java MPI bindings and periodically get fatal erros. This is 
illustrated by the following model Java program.

import mpi.MPI;
import mpi.MPIException;
import mpi.Prequest;
import mpi.Request;
import mpi.Status;

import java.nio.ByteBuffer;
import java.util.Random;

public class TestJavaMPI {

private static final int NREQ = 16;
private static final int BUFFSIZE = 0x2000;
private static final int NSTEP = 10;

public static void main(String... args) throws MPIException {
MPI.Init(args);
Random random = new Random();
Prequest[] receiveRequests = new Prequest[NREQ];
Request[] sendRequests = new Request[NREQ];
ByteBuffer[] receiveBuffers = new ByteBuffer[NREQ];
ByteBuffer[] sendBuffers = new ByteBuffer[NREQ];
for(int i = 0; i < NREQ; i++) {
receiveBuffers[i] = MPI.newByteBuffer(BUFFSIZE);
sendBuffers[i] = MPI.newByteBuffer(BUFFSIZE);
receiveRequests[i] = MPI.COMM_WORLD.recvInit(receiveBuffers[i], 
BUFFSIZE, MPI.BYTE, MPI.ANY_SOURCE, MPI.ANY_TAG);
receiveRequests[i].start();
sendRequests[i] = MPI.COMM_WORLD.iSend(sendBuffers[i], 0, MPI.BYTE, 
MPI.PROC_NULL, 0);
}
for(int step = 0; step < NSTEP; step++) {
if( step % 128 == 0 ) System.out.println(step);
int index;
do {
Status status = Request.testAnyStatus(receiveRequests);
if( status != null )
receiveRequests[status.getIndex()].start();
index = Request.testAny(sendRequests);
} while( index == MPI.UNDEFINED );
sendRequests[index].free();
sendRequests[index] = MPI.COMM_WORLD.iSend(sendBuffers[index], 
BUFFSIZE, MPI.BYTE,
random.nextInt(MPI.COMM_WORLD.getSize()), 0);
}
MPI.Finalize();
}
}

On Linux, this produces a segfault after about a million steps. On OS X, 
instead of segfault it prints the following error message

java(64053,0x127e4d000) malloc: *** error for object 0x7f80eb828808: incorrect 
checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
[mbp:64053] *** Process received signal ***
[mbp:64053] Signal: Abort trap: 6 (6)
[mbp:64053] Signal code:  (0)
[mbp:64053] [ 0] 0   libsystem_platform.dylib0x7fff86b5ff1a 
_sigtramp + 26
[mbp:64053] [ 1] 0   ??? 0x 0x0 
+ 0
[mbp:64053] [ 2] 0   libsystem_c.dylib   0x7fff80c7bb73 
abort + 129
[mbp:64053] [ 3] 0   libsystem_malloc.dylib  0x7fff8c26ce06 
szone_error + 625
[mbp:64053] [ 4] 0   libsystem_malloc.dylib  0x7fff8c2645c8 
small_free_list_remove_ptr + 154
[mbp:64053] [ 5] 0   libsystem_malloc.dylib  0x7fff8c2632bf 
szone_free_definite_size + 1856
[mbp:64053] [ 6] 0   libjvm.dylib0x00010e257d89 
_ZN2os4freeEPvt + 63
[mbp:64053] [ 7] 0   libjvm.dylib0x00010dea2b0a 
_ZN9ChunkPool12free_all_butEm + 136
[mbp:64053] [ 8] 0   libjvm.dylib0x00010e30ab33 
_ZN12PeriodicTask14real_time_tickEi + 77
[mbp:64053] [ 9] 0   libjvm.dylib0x00010e3372a3 
_ZN13WatcherThread3runEv + 267
[mbp:64053] [10] 0   libjvm.dylib0x00010e25d87e 
_ZL10java_startP6Thread + 246
[mbp:64053] [11] 0   libsystem_pthread.dylib 0x7fff8f1402fc 
_pthread_body + 131
[mbp:64053] [12] 0   libsystem_pthread.dylib 0x7fff8f140279 
_pthread_body + 0
[mbp:64053] [13] 0   libsystem_pthread.dylib 0x7fff8f13e4b1 
thread_start + 13
[mbp:64053] *** End of error message ***

OpenMPI version is 1.8.4. Java version is 1.8.0_25-b17.

Best regards,
Alexander Daryin
___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/01/26215.php

___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/01/26230.php




Re: [OMPI users] java.lang.ArrayIndexOutOfBoundsException in openmpi-dev-178-ga16c1e4

2014-10-29 Thread Oscar Vega-Gisbert

Hi,

There is an error in the program.
First you declare a 256 char buffer (BUF_SIZE = 256).

When it is executed the line 96:
buffer = (MPI.getProcessorName()).toCharArray();

The buffer length becomes less than 256.
So, when the next iteration is executed, at line 92 you could get an 
exception, because you want to receive 256 chars, but the buffer length 
is less than 256.


status = MPI.COMM_WORLD.recv (buffer, BUF_SIZE, MPI.CHAR, 0, 
MPI.ANY_TAG);


I think this program worked because of causality.
The lines 96-98 should be replaced by:

char name[] = MPI.getProcessorName().toCharArray();
System.out.printf("message length: %d  message: %s\n",
  name.length, new String(name));
MPI.COMM_WORLD.send(name, name.length, MPI.CHAR, 0, MSGTAG);

Now you won't lose the 256 char buffer.

Also, the call to
String.valueOf(buffer)
should be replaced by
String.valueOf(buffer, 0, num)
because the buffer content could be trash from the position 'num'.

Regards,
Oscar

El 29/10/14 16:16, Siegmar Gross escribió:

Hi,

today a tested some small Java programs with openmpi-dev-178-ga16c1e4.
One program throws an exception ArrayIndexOutOfBoundsException. The
program worked fine in older MPI versions, e.g., openmpi-1.8.2a1r31804.


tyr java 138 mpiexec -np 2 java MsgSendRecvMain

Now 1 process sends its greetings.

Greetings from process 1:
   message tag:3
   message length: 26
   message:
tyr.informatik.hs-fulda.de???
??

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
 at mpi.Comm.recv(Native Method)
 at mpi.Comm.recv(Comm.java:391)
 at MsgSendRecvMain.main(MsgSendRecvMain.java:92)
...



The exception happens also on my Linux box.

linpc1 java 102 mpijavac MsgSendRecvMain.java
linpc1 java 103 mpiexec -np 2 java MsgSendRecvMain

Now 1 process sends its greetings.

Greetings from process 1:
   message tag:3
   message length: 6
   message:linpc1?%???%?%?f?%?%???$??

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
 at mpi.Comm.recv(Native Method)
 at mpi.Comm.recv(Comm.java:391)
 at MsgSendRecvMain.main(MsgSendRecvMain.java:92)
...



tyr java 139 /usr/local/gdb-7.6.1_64_gcc/bin/gdb mpiexec
...
(gdb) run -np 2 java MsgSendRecvMain
Starting program: /usr/local/openmpi-1.9.0_64_gcc/bin/mpiexec -np 2 java 
MsgSendRecvMain
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
[New LWP2]

Now 1 process sends its greetings.

Greetings from process 1:
   message tag:3
   message length: 26
   message:tyr.informatik.hs-fulda.de

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
 at mpi.Comm.recv(Native Method)
 at mpi.Comm.recv(Comm.java:391)
 at MsgSendRecvMain.main(MsgSendRecvMain.java:92)
---
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
---
--
mpiexec detected that one or more processes exited with non-zero status, thus 
causing
the job to be terminated. The first process to do so was:

   Process name: [[61564,1],1]
   Exit code:1
--
[LWP2 exited]
[New Thread 2]
[Switching to Thread 1 (LWP 1)]
sol_thread_fetch_registers: td_ta_map_id2thr: no thread can be found to satisfy 
query
(gdb) bt
#0  0x7f6173d0 in rtld_db_dlactivity () from /usr/lib/sparcv9/ld.so.1
#1  0x7f6175a8 in rd_event () from /usr/lib/sparcv9/ld.so.1
#2  0x7f618950 in lm_delete () from /usr/lib/sparcv9/ld.so.1
#3  0x7f6226bc in remove_so () from /usr/lib/sparcv9/ld.so.1
#4  0x7f624574 in remove_hdl () from /usr/lib/sparcv9/ld.so.1
#5  0x7f61d97c in dlclose_core () from /usr/lib/sparcv9/ld.so.1
#6  0x7f61d9d4 in dlclose_intn () from /usr/lib/sparcv9/ld.so.1
#7  0x7f61db0c in dlclose () from /usr/lib/sparcv9/ld.so.1
#8  0x7ec87ca0 in vm_close ()
from /usr/local/openmpi-1.9.0_64_gcc/lib64/libopen-pal.so.0
#9  0x7ec85274 in lt_dlclose ()
from /usr/local/openmpi-1.9.0_64_gcc/lib64/libopen-pal.so.0
#10 0x7ecaa5dc in ri_destructor (obj=0x100187b70)
 at 
../../../../openmpi-dev-178-ga16c1e4/opal/mca/base/mca_base_component_repository.c:382
#11 0x7eca8fd8 in opal_obj_run_destructors (object=0x100187b70)
 at ../../../../openmpi-dev-178-ga16c1e4/opal/class/opal_object.h:446
#12 0x7eca9eac in mca_base_component_repository_release (
 component=0x7b1236f0 )
 at 

Re: [OMPI users] which info is needed for SIGSEGV in Java foropenmpi-dev-124-g91e9686on Solaris

2014-10-27 Thread Oscar Vega-Gisbert

Hi Takahiro, Gilles, Siegmar,

Thank you very much for all your fix.
I don't notice about calling 'mca_base_var_register' before MPI_Init.
I'm sorry for the inconvenience.

Regards,
Oscar

El 27/10/14 07:16, Gilles Gouaillardet escribió:

Kawashima-san,

thanks a lot for the detailled explanation.
FWIW, i was previously testing on Solaris 11 that behaves like Linux : 
printf("%s", NULL) outputs '(null)'

vs a SIGSEGV on Solaris 10

i commited a16c1e44189366fbc8e967769e050f517a40f3f8 in order to fix 
this issue

(i moved the call to mca_base_var_register *after* MPI_Init)

regarding the BUS error reported by Siegmar, i also commited 
62bde1fcb554079143030bb305512c236672386f
in order to fix it (this is based on code review only, i have no 
sparc64 hardware to test it is enough)


Siegmar, --enable-heterogeneous is known to be broken on the trunk, 
and there are discussions on how to fix it.
in the mean time, you can either apply the attached minimal 
heterogeneous.diff patch or avoid the --enable-heterogeneous option
/* the attached patch "fixes" --enable-heterogeneous on homogeneous 
clusters *only* */


about attaching a process with gdb, i usually run
gdb none 
on Linux and everything is fine
on Solaris, i had to do
gdb /usr/bin/java 
in order to get the symbols loaded by gdb
and then
thread 11
f 3
set _dbg=0
/* but this is likely environment specific */

Cheers,

Gilles

On 2014/10/27 10:58, Ralph Castain wrote:

Oh yeah - that would indeed be very bad :-(



On Oct 26, 2014, at 6:06 PM, Kawashima, Takahiro  
wrote:

Siegmar, Oscar,

I suspect that the problem is calling mca_base_var_register
without initializing OPAL in JNI_OnLoad.

ompi/mpi/java/c/mpi_MPI.c:

jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
libmpi = dlopen("libmpi." OPAL_DYN_LIB_SUFFIX, RTLD_NOW | RTLD_GLOBAL);

if(libmpi == NULL)
{
fprintf(stderr, "Java bindings failed to load liboshmem.\n");
exit(1);
}

mca_base_var_register("ompi", "mpi", "java", "eager",
  "Java buffers eager size",
  MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  OPAL_INFO_LVL_5,
  MCA_BASE_VAR_SCOPE_READONLY,
  _mpi_java_eager);

return JNI_VERSION_1_6;
}


I suppose JNI_OnLoad is the first function in the libmpi_java.so
which is called by JVM. So OPAL is not initialized yet.
As shown in Siegmar's JRE log, SEGV occurred in asprintf called
by mca_base_var_cache_files.

Siegmar's hs_err_pid13080.log:

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), 
si_addr=0x

Stack: [0x7b40,0x7b50],  sp=0x7b4fc730,  free 
space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.1+0x3c7f0]  strlen+0x50
C  [libc.so.1+0xaf640]  vsnprintf+0x84
C  [libc.so.1+0xaadb4]  vasprintf+0x20
C  [libc.so.1+0xaaf04]  asprintf+0x28
C  [libopen-pal.so.0.0.0+0xaf3cc]  mca_base_var_cache_files+0x160
C  [libopen-pal.so.0.0.0+0xaed90]  mca_base_var_init+0x4e8
C  [libopen-pal.so.0.0.0+0xb260c]  register_variable+0x214
C  [libopen-pal.so.0.0.0+0xb36a0]  mca_base_var_register+0x104
C  [libmpi_java.so.0.0.0+0x221e8]  JNI_OnLoad+0x128
C  [libjava.so+0x10860]  Java_java_lang_ClassLoader_00024NativeLibrary_load+0xb8
j  java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+-665819
j  java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+0
j  java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+328
j  java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+290
j  java.lang.Runtime.loadLibrary0(Ljava/lang/Class;Ljava/lang/String;)V+54
j  java.lang.System.loadLibrary(Ljava/lang/String;)V+7
j  mpi.MPI.()V+28


mca_base_var_cache_files passes opal_install_dirs.sysconfdir to
asprintf.

opal/mca/base/mca_base_var.c:

asprintf(_base_var_files, "%s"OPAL_PATH_SEP".openmpi" OPAL_PATH_SEP
 "mca-params.conf%c%s" OPAL_PATH_SEP "openmpi-mca-params.conf",
 home, OPAL_ENV_SEP, opal_install_dirs.sysconfdir);


In this situation, opal_install_dirs.sysconfdir is still NULL.

I run a MPI Java program that only calls MPI.Init() and
MPI.Finalize() with MCA variable mpi_show_mca_params=1 on
Linux to confirm this. mca_base_param_files contains "(null)".

mpi_show_mca_params=1:

[ppc:12232] 
mca_base_param_files=/home/rivis/.openmpi/mca-params.conf:(null)/openmpi-mca-params.conf
 (default)
[ppc:12232] 

Re: [OMPI users] which info is needed for SIGSEGV in Java foropenmpi-dev-124-g91e9686 on Solaris

2014-10-23 Thread Oscar Vega-Gisbert

Hello Siegmar,

If your Java program only calls to MPI.Init and MPI.Finalize you don't 
need debug Java. The JNI layer is very thin, so I think the problem is 
not in Java. Also, if the process crash is in the JNI side, debugging 
won't provides you useful information.


But if you want debug 2 processes, you can do the following.

You must launch 2 instances of the Java debugger (jdb) or NetBeans, 
Eclipse,... listening on port 8000.


The 2 processes must be launched with the necessary parameters to attach 
to the listening debuggers:


mpirun -np 2 java -agentlib:jdwp=transport=dt_socket,\
server=n,address=localhost:8000 Hello

I checked it on NetBeans and it works.
Here you have more details about debugging:

http://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html

Regards,
Oscar

El 23/10/14 17:03, Siegmar Gross escribió:

Hello Oscar,

do you have time to look into my problem? Probably Takahiro has a
point and gdb behaves differently on Solaris and Linux, so that
the differing outputs have no meaning. I tried to debug my Java
program, but without success so far, because I wasn't able to get
into the Java program to set a breakpoint or to see the code. Have
you succeeded to debug a mpiJava program? If so, how must I call
gdb (I normally use "gdb mipexec" and then "run -np 1 java ...")?
What can I do to get helpful information to track the error down?
I have attached the error log file. Perhaps you can see if something
is going wrong with the Java interface. Thank you very much for your
help and any hints for the usage of gdb with mpiJava in advance.
Please let me know if I can provide anything else.


Kind regards

Siegmar



I think that it must have to do with MPI, because everything
works fine on Linux and my Java program works fine with an older
MPI version (openmpi-1.8.2a1r31804) as well.

Yes. I also think it must have to do with MPI.
But java process side, not mpiexec process side.

When you run Java MPI program via mpiexec, a mpiexec process
process launch a java process. When the java process (your
Java program) calls a MPI method, native part (written in C/C++)
of the MPI library is called. It runs in java process, not in
mpiexec process. I suspect that part.


On Solaris things are different.

Are you saying the following difference?
After this line,

881 ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_INIT);

Linux shows

orte_job_state_to_str (state=1)
 at ../../openmpi-dev-124-g91e9686/orte/util/error_strings.c:217
217 switch(state) {

but Solaris shows

orte_util_print_name_args (name=0x100118380 )
 at ../../openmpi-dev-124-g91e9686/orte/util/name_fns.c:122
122 if (NULL == name) {

Each macro is defined as:

#define ORTE_ACTIVATE_JOB_STATE(j, s)   \
 do {\
 orte_job_t *shadow=(j); \
 opal_output_verbose(1, orte_state_base_framework.framework_output, \
 "%s ACTIVATE JOB %s STATE %s AT %s:%d",  \
 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
 (NULL == shadow) ? "NULL" : \
 ORTE_JOBID_PRINT(shadow->jobid),\
 orte_job_state_to_str((s)), \
 __FILE__, __LINE__);   \
 orte_state.activate_job_state(shadow, (s)); \
 } while(0);

#define ORTE_NAME_PRINT(n) \
 orte_util_print_name_args(n)

#define ORTE_JOBID_PRINT(n) \
 orte_util_print_jobids(n)

I'm not sure, but I think the gdb on Solaris steps into
orte_util_print_name_args, but gdb on Linux doesn't step into
orte_util_print_name_args and orte_util_print_jobids for some
reason, or orte_job_state_to_str is evaluated before them.

So I think it's not an important difference.

You showed the following lines.

orterun (argc=5, argv=0x7fffe0d8)
 at

../../../../openmpi-dev-124-g91e9686/orte/tools/orterun/orterun.c:1084

1084while (orte_event_base_active) {
(gdb)
1085opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
(gdb)

I'm not familiar with this code but I think this part (in mpiexec
process) is only waiting the java process to terminate (normally
or abnormally). So I think the problem is not in a mpiexec process
but in a java process.

Regards,
Takahiro


Hi Takahiro,


mpiexec and java run as distinct processes. Your JRE message
says java process raises SEGV. So you should trace the java
process, not the mpiexec process. And more, your JRE message
says the crash happened outside the Java Virtual Machine in
native code. So usual Java program debugger is useless.
You should trace native code part of the java process.
Unfortunately I don't know how to debug such one.

I think that it must have to do with MPI, 

Re: [OMPI users] Derived data in Java

2014-10-09 Thread Oscar Vega-Gisbert

Hello Atsugua,

You can only send contiguous data, i.e. arrays of basic datatypes (byte, 
char, short, boolean, int, long, float and double) or direct buffers. If 
you need to send complex data, then you must serialize into an array or 
a direct buffer. This is made using using the mpi.Struct class, which 
represents the MPI_STRUCT datatype.


A user-defined struct must be a subclass of Struct and it must have 
three parts:
1. A number of data fields defined using the add[Type]() methods, that 
return the corresponding offsets according to the size of the type. The 
offsets must be stored because they will be necessary to access data.
2. A subclass of Struct.Data with get/put methods to access data. These 
methods will need the previously stored offsets.
3. The implementation of the method newData() in order to tell the 
library how to create Data objects.


Another question is the String class. It is not supported because it is 
a variable sized object. When it is necessary sending strings you must 
use char arrays.


I attached a similar example to what you want.
Instead of defining two strings you have an int and a string.

Regards,
Oscar

El 09/10/14 16:27, Atsugua Ada escribió:
Hello, I am using Open-MPI 1.8.3 for Java. I would like to know how to 
create a derived datatype that enables the sending of an array of 
complex data (objects, strings, etc.) to each processor. In fact, I 
want to create an array of string or objects and sending a part of 
this array to each proccess.


E.g., I created the next class:

|/class  Data{
String  data1;
String  data2;

public  Data(String  d1,  String  d2)
{
 this.data1=  d1;
 this.data2=  d2;
}
}/|
|and then a array of Data objects is created|
|
|/  Data[]  myData=  new  Data[4];  
  myData[0]  =  new  Data("d1",  "this is a test");

  
  myData[3]  =  new  Data("the third data",  "this is another test");/||
|How can I create the datatype to send, e.g., myData[0] and [1] to proc#1 and 
the remaining to the proc#2?|
|Thanks.|


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/10/25480.php


import mpi.*;
import java.nio.*;
import static mpi.MPI.slice;

public class DerivedData
{
private static class MyStruct extends Struct
{
private static final int MAX_LENGTH = 30;

// This section defines the offsets of the fields.
private int key= addInt(),
length = addInt(), // value length
value  = addChar(MAX_LENGTH);

// This method tells the super class how to create a data object.
@Override protected Data newData()
{
return new Data();
}

// A Data object is a reference to a buffer section.
// It permits read (puts) and write (gets) on the buffer
private class Data extends Struct.Data
{
public int getKey()
{
return getInt(key);
}

public void putKey(int k)
{
putInt(key, k);
}

public String getValue()
{
int len = getInt(length); // Gets the value length.
StringBuilder sb = new StringBuilder(len);

// Deserialization
for(int i = 0; i < len; i++)
sb.append(getChar(value, i));

return sb.toString();
}

public void putValue(String d)
{
int len = d.length();

if(len > MAX_LENGTH)
throw new AssertionError("Max length exceeded!");

putInt(length, len); // Puts the value length on the buffer.

// Serialization
for(int i = 0; i < len; i++)
putChar(value, i, d.charAt(i));
}
} // Data
} // MyStruct

public static void main(String args[]) throws MPIException
{
MPI.Init(args);
MPI.COMM_WORLD.setErrhandler(MPI.ERRORS_RETURN);
int rank = MPI.COMM_WORLD.getRank();
int size = MPI.COMM_WORLD.getSize();

if(size != 3)
throw new MPIException("I need 3 processes.");

MyStruct myStruct = new MyStruct();

if(rank == 0)
{
int length = 4;
ByteBuffer buf = MPI.newByteBuffer(myStruct.getExtent() * length);
System.out.println("Process 0:");

for(int i = 0; i < length; i++)
{
MyStruct.Data d = myStruct.getData(buf, i);
d.putKey(i);
d.putValue("Value "+ i);
System.out.println(d.getKey() +" : "+ d.getValue());
}

MPI.COMM_WORLD.send(buf, 2, myStruct.getType(), 1, 0);
int off = 2 * myStruct.getExtent();
MPI.COMM_WORLD.send(slice(buf, off), 2, myStruct.getType(), 2, 0);
}
else
{
int length = 2;
ByteBuffer buf = MPI.newByteBuffer(myStruct.getExtent() * length);
MPI.COMM_WORLD.recv(buf, length, myStruct.getType(), 

Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-23 Thread Oscar Vega-Gisbert


El 22/08/14 21:31, Saliya Ekanayake escribió:
My apologies, I think I wasn't clear on my question. My question was, 
given that copying of data is necessary in both approaches (either by 
the system with arrays or by programmer with buffers), is there a 
foreseeable performance difference in terms of performance considering 
the time it takes for copying?


Both approaches need copying matrix row by row. In Java side there 
should not be differences, but in the C side (JNI) if the buffer is an 
array it will be necessary one more copy. The performance differences 
will be bigger as the matrix size is increased.




Thank you,
Saliya


On Fri, Aug 22, 2014 at 3:24 PM, Oscar Vega-Gisbert <ov...@dsic.upv.es 
<mailto:ov...@dsic.upv.es>> wrote:


El 22/08/14 20:44, Saliya Ekanayake escribió:

Thank you Oscar for the detailed information, but I'm still
wondering how would the copying in 2 would be different than
what's done here with copying to a buffer.


If you have a buffer array like this:

double buffer[] = new double[m * n];

Copy the 2D matrix to the buffer:


for(int i = 0; i < m; i++)
System.arraycopy(matrix[i], 0, buffer, i * n, n);

Copy from the buffer to the 2D matrix:


for(int i = 0; i < m; i++)
System.arraycopy(buffer, i * n, matrix[i], 0, n);


On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert
<ov...@dsic.upv.es <mailto:ov...@dsic.upv.es>
<mailto:ov...@dsic.upv.es <mailto:ov...@dsic.upv.es>>> wrote:

El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that
needs to be sent to another rank. I see two options to get
this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer
and use
it, so suggesting 1. is the best option. Is this the
case or
is there a better way to do this?


The best option is 1 because 2 requires one extra copy to
C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk
put/get methods:

for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer
position in n.
So if you want reuse the buffer you must set the buffer
position
to 0 before copy the matrix:

buffer.position(0);

Regards,
Oscar


Thank you,
Saliya
-- Saliya Ekanayake esal...@gmail.com
<mailto:esal...@gmail.com> <mailto:esal...@gmail.com
<mailto:esal...@gmail.com>>
<mailto:esal...@gmail.com <mailto:esal...@gmail.com>
<mailto:esal...@gmail.com <mailto:esal...@gmail.com>>>

http://saliya.org


___
users mailing list
us...@open-mpi.org <mailto:us...@open-mpi.org>
<mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>

Subscription:
http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25130.php


___
users mailing list
us...@open-mpi.org <mailto:us...@open-mpi.org>
<mailto:us...@open-mpi.org <mailto:us...@open-mpi.org>>

Subscription:
http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25131.php




-- 
Saliya Ekanayake esal...@gmail.com <mailto:esal...@gmail.com>

<mailto:esal...@gmail.com <mailto:esal...@gmail.com>>

Cell 812-391-4914  Home 812-961-6383

http://saliya.org


___
users mailing l

Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Oscar Vega-Gisbert

El 22/08/14 20:44, Saliya Ekanayake escribió:
Thank you Oscar for the detailed information, but I'm still wondering 
how would the copying in 2 would be different than what's done here 
with copying to a buffer.


If you have a buffer array like this:

double buffer[] = new double[m * n];

Copy the 2D matrix to the buffer:

for(int i = 0; i < m; i++)
System.arraycopy(matrix[i], 0, buffer, i * n, n);

Copy from the buffer to the 2D matrix:

for(int i = 0; i < m; i++)
System.arraycopy(buffer, i * n, matrix[i], 0, n);



On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert <ov...@dsic.upv.es 
<mailto:ov...@dsic.upv.es>> wrote:


El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that
needs to be sent to another rank. I see two options to get
this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer and use
it, so suggesting 1. is the best option. Is this the case or
is there a better way to do this?


The best option is 1 because 2 requires one extra copy to C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk
put/get methods:

for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer position in n.
So if you want reuse the buffer you must set the buffer position
to 0 before copy the matrix:

buffer.position(0);

Regards,
Oscar


Thank you,
Saliya
-- 
Saliya Ekanayake esal...@gmail.com <mailto:esal...@gmail.com>

<mailto:esal...@gmail.com <mailto:esal...@gmail.com>>
http://saliya.org


___
users mailing list
us...@open-mpi.org <mailto:us...@open-mpi.org>
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25130.php


___
users mailing list
us...@open-mpi.org <mailto:us...@open-mpi.org>
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25131.php




--
Saliya Ekanayake esal...@gmail.com <mailto:esal...@gmail.com>
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25132.php




Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Oscar Vega-Gisbert

El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that needs to be 
sent to another rank. I see two options to get this done,


1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer and use it, so 
suggesting 1. is the best option. Is this the case or is there a 
better way to do this?




The best option is 1 because 2 requires one extra copy to C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk put/get 
methods:


for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer position in n. So if 
you want reuse the buffer you must set the buffer position to 0 before 
copy the matrix:


buffer.position(0);

Regards,
Oscar



Thank you,
Saliya
--
Saliya Ekanayake esal...@gmail.com 
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25130.php




Re: [OMPI users] SIGSEGV for Java program in openmpi-1.8.2rc2 on Solaris 10

2014-07-25 Thread Oscar Vega-Gisbert

I'm sorry but I can not reproduce the problem.
I recompiled all from scratch using Java 8, and it works ok on Debian 7.5.

Regards,
Oscar


El 25/07/14 18:28, Saliya Ekanayake escribió:
I too have encountered this as mentioned in one of my previous emails 
(http://comments.gmane.org/gmane.comp.clustering.open-mpi.user/21000). 
I've done many tests for our algorithms with 1.8.1 version and it 
didn't have this, but not sure about 1.8.2.


Thank you,
saliya


On Fri, Jul 25, 2014 at 11:56 AM, Jeff Squyres (jsquyres) 
> wrote:


That's quite odd that it only happens for Java programs -- it
should happen for *all* programs, based on the stack trace you've
shown.

Can you print the value of the lds struct where the error occurs?


On Jul 25, 2014, at 2:29 AM, Siegmar Gross
> wrote:

> Hi,
>
> I have installed openmpi-1.8.2rc2 with Sun c 5.12 on Solaris
> 10 Sparc and x86_64 and I receive a segmentation fault, if I
> run a small Java program.
>
> rs0 java 105 mpiexec -np 1 java InitFinalizeMain
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x7ea3c830, pid=18363, tid=2
> #
> # JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build
1.8.0-b132)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b70 mixed
mode solaris-sparc
> compressed oops)
> # Problematic frame:
> # C  [libc.so.1+0x3c830]  strlen+0x50
> ...
>
>
> I get the following output if I run the program in "dbx".
>
> ...
> RTC: Running program...
> Write to unallocated (wua) on thread 1:
> Attempting to write 1 byte at address 0x79f04000
> t@1 (l@1) stopped in _readdir at 0x56574da0
> 0x56574da0: _readdir+0x0064:call
> _PROCEDURE_LINKAGE_TABLE_+0x2380 [PLT] ! 0x56742a80
> Current function is find_dyn_components
>  397   if (0 != lt_dlforeachfile(dir,
save_filename, NULL))
> {
> (dbx)
>
>
> I get the following output if I run the program on Solaris 10
> x86_64.
>
> ...
> RTC: Running program...
> Reading disasm.so
> Read from uninitialized (rui) on thread 1:
> Attempting to read 1 byte at address 0x437387
>which is 15 bytes into a heap block of size 16 bytes at 0x437378
> This block was allocated from:
>[1] vasprintf() at 0xfd7fdc9b335a
>[2] asprintf() at 0xfd7fdc9b3452
>[3] opal_output_init() at line 184 in "output.c"
>[4] do_open() at line 548 in "output.c"
>[5] opal_output_open() at line 219 in "output.c"
>[6] opal_malloc_init() at line 68 in "malloc.c"
>[7] opal_init_util() at line 258 in "opal_init.c"
>[8] opal_init() at line 363 in "opal_init.c"
>
> t@1 (l@1) stopped in do_open at line 638 in file "output.c"
>  638   info[i].ldi_prefix = strdup(lds->lds_prefix);
> (dbx)
>
>
> Hopefully the above output helps to fix the errors. Can I provide
> anything else? Thank you very much for any help in advance.
>
>
> Kind regards
>
> Siegmar
>
> ___
> users mailing list
> us...@open-mpi.org 
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
http://www.open-mpi.org/community/lists/users/2014/07/24870.php


--
Jeff Squyres
jsquy...@cisco.com 
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/

___
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/07/24874.php




--
Saliya Ekanayake esal...@gmail.com 
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/07/24875.php




Re: [OMPI users] OpenMpi-java Examples

2014-03-17 Thread Oscar Vega-Gisbert

Hi Madhurima,

Currently we only have tests which start MPI and check the provided  
level of thread support:


int provided = MPI.InitThread(args, MPI.THREAD_FUNNELED);

if(provided < MPI.THREAD_FUNNELED)
{
throw new MPIException("MPI_Init_thread returned less "+
   "than MPI_THREAD_FUNNELED.\n");
}

Regards,
Oscar

Quoting madhurima madhunapanthula :


hi,

Iam new to OpenMPI. I have installed the java bindings of OpenMPI and
running some samples in the cluster.
iam interested in some samples using THREAD_SERIALIZED and THREAD_FUNNLED
fields in OpenMPI. please provide me some samples.

--
Lokah samasta sukhinobhavanthu

Thanks,
Madhurima






This message was sent using IMP, the Internet Messaging Program.




Re: [OMPI users] warnings and anachronisms in openmpi-1.7.4

2014-02-09 Thread Oscar Vega-Gisbert

Quoting Siegmar Gross :


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();
 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 :

> 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
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users






This message was sent using IMP, the Internet Messaging Program.



Re: [OMPI users] warnings and anachronisms in openmpi-1.7.4

2014-02-09 Thread Oscar Vega-Gisbert

Hi,

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();
ompi_java_exceptionCheck(env, rc);
return ompi_java_jHandle(win);
}

I don't know if it is worth it.

Regards,
Oscar

Quoting Siegmar Gross :


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.



Re: [OMPI users] How to use non-primitive types with Java binding

2014-01-17 Thread Oscar Vega-Gisbert
MPI.OBJECT is no longer supported because of it was based on  
serialization, and it made the java bindings more complicated. It  
brought more problems than benefits. For example, it was necessary a  
shadow communicator...


You can define complex struct data using direct buffers and avoiding  
serialization. MPI.OBJECT could be implemented in a higher level  
layer, but serialization is very bad for performance...


Regards,
Oscar

Quoting Saliya Ekanayake <esal...@gmail.com>:


Thank you Oscar. I was using an earlier nightly tarball and in it there was
MPI.OBJECT datatype, which I could use with any serializable complex
object. It seems this is no longer supported as per your answer or did I
get it wrong?

Thank you,
Saliya


On Thu, Jan 16, 2014 at 5:22 PM, Oscar Vega-Gisbert <ov...@dsic.upv.es>wrote:


Hi,

If you are talking about types as ArrayList, it is not possible,
because the Double (D uppercase) is an object which encapsulates a double.
And the elements of an ArrayList are references (pointers) to Java objects.

You can use complex types but you must create them with the Datatype
methods (createVector, createStruct,...). And the buffers that hold the
data must be arrays of a primitive type or direct buffers.

Regards,
Oscar


Quoting Saliya Ekanayake <esal...@gmail.com>:

 Hi,


Is it possible to use non-primitive types with MPI operations in OpenMPI's
Java binding? At the moment in the trunk I only see Datatypes for
primitive
kinds.

Thank you,
Saliya

--
Saliya Ekanayake esal...@gmail.com






This message was sent using IMP, the Internet Messaging Program.


___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users





--
Saliya Ekanayake esal...@gmail.com
Cell 812-391-4914 Home 812-961-6383
http://saliya.org






This message was sent using IMP, the Internet Messaging Program.



Re: [OMPI users] How to use non-primitive types with Java binding

2014-01-16 Thread Oscar Vega-Gisbert

Hi,

If you are talking about types as ArrayList, it is not  
possible, because the Double (D uppercase) is an object which  
encapsulates a double. And the elements of an ArrayList are references  
(pointers) to Java objects.


You can use complex types but you must create them with the Datatype  
methods (createVector, createStruct,...). And the buffers that hold  
the data must be arrays of a primitive type or direct buffers.


Regards,
Oscar

Quoting Saliya Ekanayake :


Hi,

Is it possible to use non-primitive types with MPI operations in OpenMPI's
Java binding? At the moment in the trunk I only see Datatypes for primitive
kinds.

Thank you,
Saliya

--
Saliya Ekanayake esal...@gmail.com






This message was sent using IMP, the Internet Messaging Program.




[OMPI users] some problems with openmpi-1.9a1r30100

2014-01-01 Thread Oscar Vega-Gisbert

Jeff added a jdoc target in '~/ompi-java/ompi/mpi/java/java/Makefile.am'.
Javadoc is created in '~/ompi-java/ompi/mpi/java/java/doc'

I think javadoc could be created if you select '--enable-mpi-java',  
and it could be copied in '~/ompi-install/share/javadoc'.




From: Ralph Castain 
Subject: Re: [OMPI users] some problems with openmpi-1.9a1r30100
Date: January 1, 2014 at 7:57:27 AM PST
To: Siegmar Gross , Open MPI  
Users 


I believe that the Javadoc doesn't install by default - Jeff?

On Jan 1, 2014, at 1:48 AM, Siegmar Gross  
 wrote:



"make install" didn't install the Javadoc documentation for the
new Java interface. Is it necessary to install it in a separate
step?

tyr small_prog 118 ls -l /usr/local/openmpi-1.9_64_cc/share/
total 6
drwxr-xr-x 5 root root  512 Dec 31 12:03 man
drwxr-xr-x 3 root root 3584 Dec 31 12:05 openmpi
drwxr-xr-x 3 root root  512 Dec 31 12:04 vampirtrace
tyr small_prog 119




This message was sent using IMP, the Internet Messaging Program.



Re: [OMPI users] Several questions about new Java bindings

2013-12-03 Thread Oscar Vega-Gisbert

Hello Ivan,


From: Ivan Borisov <68van...@mail.ru>
Subject: [OMPI users] Several questions about new Java bindings
Date: December 3, 2013 5:22:29 AM EST
To: Open MPI users list 
Reply-To: Open MPI Users 

Hello everyone.

I've installed nightly 1.7.4 recently and it's Java API is completely
different from mpiJava.
Is there guide or something to new Open MPI Java bindings? Or will it
come out later (in some resonable time)?


Currently, the only documentation is the javadoc that can be generated  
by accessing the 'ompi/mpi/java/java' folder:


make jdoc

You will get the javadoc in 'ompi/mpi/java/java/doc'.
The guide and examples will come out later. But we do not know when...


Specifically, I'm interested in how to port existing sources from old
mpiJava to new Open MPI Java bindings
and comments explaining reasons of changing each part of API.
Is there determined time when new Java bindings will become stable or
it's done when it's done?


The new Java bindings are stable.


Also, what is the best version of Java API implementation for now?


The latest version.

Regards,
Oscar



Sorry if I'm asking too much :)

Thanks,
Ivan Borisov.
___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users




This message was sent using IMP, the Internet Messaging Program.