Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6d0b2269 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'julia/fix_double_free' into 'master'

Fix issue with Julia user driver

See merge request !40
parents b329bdb5 17275060
No related branches found
No related tags found
1 merge request!40Fix issue with Julia user driver
---
image: hpclib/hiepacs-openmpi
image: hpclib/hiepacs
stages:
- build
......
# Add OpenMPI to the environment
export PATH=$OPENMPI_DIR/bin:$PATH
export LD_RUN_PATH=$OPENMPI_DIR/lib:$LD_RUN_PATH
export LD_LIBRARY_PATH=$OPENMPI_DIR/lib:$LD_LIBRARY_PATH
export INCLUDE_PATH=$OPENMPI_DIR/include:$INCLUDE_PATH
export PKG_CONFIG_PATH=$OPENMPI_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
# export PATH=$OPENMPI_DIR/bin:$PATH
# export LD_RUN_PATH=$OPENMPI_DIR/lib:$LD_RUN_PATH
# export LD_LIBRARY_PATH=$OPENMPI_DIR/lib:$LD_LIBRARY_PATH
# export INCLUDE_PATH=$OPENMPI_DIR/include:$INCLUDE_PATH
# export PKG_CONFIG_PATH=$OPENMPI_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
......@@ -89,7 +89,7 @@ foreach( version ${RUNTYPE} )
set( tests_short_list ${SPM_TESTS} )
endif()
if( version STREQUAL "mpi" )
set( exe mpiexec -np 4 -host localhost:4 )
set( exe ${MPIEXEC_EXECUTABLE} -np 4 -host localhost:4 )
set( tests_full_list ${SPM_MPI_TESTS} )
set( tests_short_list ${SPM_MPI_TESTS} )
endif()
......
......@@ -96,7 +96,7 @@ foreach (_file ${EXAMPLES})
set( exe "")
endif()
if( version STREQUAL "mpi" )
set( exe mpiexec -np 4 --host localhost:4 )
set( exe ${MPIEXEC_EXECUTABLE} -np 4 --host localhost:4 )
endif()
add_test(${version}_fortran_${_name_we} ${exe} ./${_name_we})
......
......@@ -130,7 +130,7 @@ if ( Julia_ENABLE_TESTS )
if (SPM_WITH_MPI)
set( _test_name_ mpi_${_test_suffix_} )
add_test( ${_test_name_} mpiexec -np 4 --host localhost:4 ${Julia_EXECUTABLE} ${_test_file_} )
add_test( ${_test_name_} ${MPIEXEC_EXECUTABLE} -np 4 --host localhost:4 ${Julia_EXECUTABLE} ${_test_file_} )
set_tests_properties( ${_test_name_}
PROPERTIES ENVIRONMENT "${Julia_ENVIRONEMENT}" )
endif()
......
......@@ -45,7 +45,6 @@ n = dim1 * dim2 * dim3
nnz = (2*(dim1)-1) * dim2 * dim3 + (dim2-1)*dim1*dim3 + dim2*dim1*(dim3-1)
#Create the spm out of the internal data
spm.spmInit( Aptr )
A.mtxtype = spm.SpmSymmetric
A.flttype = spm.SpmDouble
......@@ -55,11 +54,14 @@ A.nnz = nnz
A.dof = 1
spm.spmUpdateComputedFields( Aptr )
# Allocate the arrays of the spm through C functions
spm.spmAlloc( Aptr )
row = zeros( spm.spm_int_t, nnz )
col = zeros( spm.spm_int_t, nnz )
val = zeros( Cdouble, nnz )
# Get the pointer to the allocated arrays
row = unsafe_wrap(Array, A.rowptr, A.nnzexp, own = false)
col = unsafe_wrap(Array, A.colptr, A.nnzexp, own = false)
val = unsafe_wrap(Array{Cdouble,1}, convert( Ptr{Cdouble}, A.values ), A.nnzexp, own = false)
m = 1
for i in 1:dim1
......@@ -115,10 +117,6 @@ if m != nnz+1
println( "m ", m, "nnz ", nnz )
end
A.colptr = pointer( col )
A.rowptr = pointer( row )
A.values = pointer( val )
A2 = spm.spmatrix_t( zero )
A2ptr = Ptr{spm.spmatrix_t}( pointer_from_objref(A2) )
rc = spm.spmCheckAndCorrect( Aptr, A2ptr )
......
......@@ -71,7 +71,7 @@ if (Python3_Interpreter_FOUND)
if (SPM_WITH_MPI)
set( _test_name_ mpi_${_test_suffix_} )
add_test( ${_test_name_} mpiexec -np 4 --host localhost:4 ${Python3_EXECUTABLE} ${_test_file_} )
add_test( ${_test_name_} ${MPIEXEC_EXECUTABLE} -np 4 --host localhost:4 ${Python3_EXECUTABLE} ${_test_file_} )
set_tests_properties( ${_test_name_}
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment