Commit fe6b60d9 authored by Kim, Jungwon's avatar Kim, Jungwon

char dim -> pointer

parent 87baa331
......@@ -3,7 +3,7 @@ rm -rf build install
mkdir build
cd build
#cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/intel/compilers_and_libraries_2017.4.196/linux/mpi/intel64/bin/mpirun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Stampede2
#cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/slurm/default/bin/srun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Grand Tave
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/slurm/default/bin/srun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Grand Tave
#cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/ibm/spectrum_mpi/jsm_pmix/bin/jsrun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Summitdev
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/xalt/bin/aprun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Theta
#cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/xalt/bin/aprun" -DMPIEXEC_NUMPROC_FLAG="-n" -DPAPYRUS_USE_FORTRAN=ON #Theta
make -j install
......@@ -23,7 +23,7 @@ MODULE PAPYRUS
BIND(C, NAME='papyruskv_init')
USE, INTRINSIC :: ISO_C_BINDING
INTEGER(C_INT), VALUE, INTENT(IN) :: ARGC
CHARACTER(C_CHAR), DIMENSION(*), INTENT(IN) :: ARGV
TYPE(C_PTR), VALUE, INTENT(IN) :: ARGV
CHARACTER(C_CHAR), DIMENSION(*), INTENT(IN) :: REPOSITORY
END FUNCTION PAPYRUSKV_INIT_CBIND
......@@ -165,8 +165,7 @@ MODULE PAPYRUS
SUBROUTINE PAPYRUSKV_INIT(REPOSITORY, IERROR)
CHARACTER, DIMENSION(*), INTENT(IN) :: REPOSITORY
INTEGER, INTENT(OUT) :: IERROR
CHARACTER, POINTER :: ARGV(:)
IERROR = PAPYRUSKV_INIT_CBIND(0, ARGV, REPOSITORY)
IERROR = PAPYRUSKV_INIT_CBIND(0, C_NULL_PTR, REPOSITORY)
END SUBROUTINE PAPYRUSKV_INIT
SUBROUTINE PAPYRUSKV_FINALIZE(IERROR)
......@@ -179,9 +178,7 @@ MODULE PAPYRUS
INTEGER, INTENT(IN) :: FLAGS
INTEGER, INTENT(OUT) :: DB
INTEGER, INTENT(OUT) :: IERROR
TYPE(C_PTR) :: OPT
OPT = C_NULL_PTR
IERROR = PAPYRUSKV_OPEN_CBIND(NAME, FLAGS, OPT, DB)
IERROR = PAPYRUSKV_OPEN_CBIND(NAME, FLAGS, C_NULL_PTR, DB)
END SUBROUTINE PAPYRUSKV_OPEN
SUBROUTINE PAPYRUSKV_CLOSE(DB, IERROR)
......@@ -305,9 +302,7 @@ MODULE PAPYRUS
INTEGER, INTENT(OUT) :: DB
INTEGER, INTENT(OUT) :: EVENT
INTEGER, INTENT(OUT) :: IERROR
TYPE(C_PTR) :: OPT
OPT = C_NULL_PTR
IERROR = PAPYRUSKV_RESTART_CBIND(PATH, NAME, FLAGS, OPT, DB, EVENT)
IERROR = PAPYRUSKV_RESTART_CBIND(PATH, NAME, FLAGS, C_NULL_PTR, DB, EVENT)
END SUBROUTINE PAPYRUSKV_RESTART
SUBROUTINE PAPYRUSKV_WAIT(DB, EVENT, IERROR)
......
......@@ -4,14 +4,13 @@ PROGRAM TEST14_FORTRAN
IMPLICIT NONE
INTEGER :: RANK, NRANKS, IERROR, PROVIDED, PEER, DB
CHARACTER, DIMENSION(4) :: KEY * 32
CHARACTER, DIMENSION(4) :: VAL * 256
CHARACTER, DIMENSION(0:3) :: KEY * 32
CHARACTER, DIMENSION(0:3) :: VAL * 256
CHARACTER, POINTER :: VAL1(:)
CHARACTER, POINTER :: VAL2(:)
INTEGER(KIND=8) :: KEYLEN, VALLEN
CALL MPI_INIT_THREAD(MPI_THREAD_MULTIPLE, PROVIDED, IERROR)
PRINT*, 'THIS IS A HACK CODE FOR PORTABILITY'
CALL PAPYRUSKV_INIT('./pkv_repo'//CHAR(0), IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
......@@ -20,15 +19,15 @@ PROGRAM TEST14_FORTRAN
CALL MPI_COMM_RANK(MPI_COMM_WORLD, RANK, IERROR)
CALL MPI_COMM_SIZE(MPI_COMM_WORLD, NRANKS, IERROR)
KEY(1) = 'GOOGLE'
KEY(2) = 'FACEBOOK'
KEY(3) = 'TWITTER'
KEY(4) = 'PAPYRUS'
KEY(0) = 'GOOGLE'
KEY(1) = 'FACEBOOK'
KEY(2) = 'TWITTER'
KEY(3) = 'PAPYRUS'
VAL(1) = 'https://google.com'
VAL(2) = 'https://facebook.com'
VAL(3) = 'https://twitter.com'
VAL(4) = 'https://code.ornl.gov/eck/papyrus'
VAL(0) = 'https://google.com'
VAL(1) = 'https://facebook.com'
VAL(2) = 'https://twitter.com'
VAL(3) = 'https://code.ornl.gov/eck/papyrus'
ALLOCATE(VAL1(256))
NULLIFY(VAL2)
......@@ -45,10 +44,10 @@ PROGRAM TEST14_FORTRAN
ENDIF
IF (RANK < SIZE(KEY)) THEN
PRINT*, 'PUT--> RANK', RANK, 'KEY:', TRIM(KEY(RANK + 1)), ' VAL:', TRIM(VAL(RANK + 1))
KEYLEN = LEN(TRIM(KEY(RANK + 1)), KIND = 8)
VALLEN = LEN(TRIM(VAL(RANK + 1)), KIND = 8)
CALL PAPYRUSKV_PUT(DB, TRIM(KEY(RANK + 1)), KEYLEN, TRIM(VAL(RANK + 1)), VALLEN, IERROR)
PRINT*, 'PUT--> RANK', RANK, 'KEY:', TRIM(KEY(RANK)), ' VAL:', TRIM(VAL(RANK))
KEYLEN = LEN(TRIM(KEY(RANK)), KIND = 8)
VALLEN = LEN(TRIM(VAL(RANK)), KIND = 8)
CALL PAPYRUSKV_PUT(DB, TRIM(KEY(RANK)), KEYLEN, TRIM(VAL(RANK)), VALLEN, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
......@@ -60,35 +59,35 @@ PROGRAM TEST14_FORTRAN
ENDIF
IF (RANK < SIZE(KEY)) THEN
CALL PAPYRUSKV_GET(DB, TRIM(KEY(RANK + 1)), KEYLEN, VAL1, VALLEN, IERROR)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(RANK)), KEYLEN, VAL1, VALLEN, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(RANK + 1)), ' VAL:', VAL1(1: VALLEN)
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(RANK)), ' VAL:', VAL1(1: VALLEN)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(RANK + 1)), KEYLEN, VAL2, VALLEN, IERROR)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(RANK)), KEYLEN, VAL2, VALLEN, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(RANK + 1)), ' VAL:', VAL2(1: VALLEN)
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(RANK)), ' VAL:', VAL2(1: VALLEN)
CALL PAPYRUSKV_FREE(VAL2, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
KEYLEN = LEN(TRIM(KEY(PEER + 1)), KIND = 8)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(PEER + 1)), KEYLEN, VAL1, VALLEN, IERROR)
KEYLEN = LEN(TRIM(KEY(PEER)), KIND = 8)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(PEER)), KEYLEN, VAL1, VALLEN, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(PEER + 1)), ' VAL:', VAL1(1: VALLEN)
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(PEER)), ' VAL:', VAL1(1: VALLEN)
KEYLEN = LEN(TRIM(KEY(PEER + 1)), KIND = 8)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(PEER + 1)), KEYLEN, VAL2, VALLEN, IERROR)
KEYLEN = LEN(TRIM(KEY(PEER)), KIND = 8)
CALL PAPYRUSKV_GET(DB, TRIM(KEY(PEER)), KEYLEN, VAL2, VALLEN, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
ENDIF
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(PEER + 1)), ' VAL:', VAL2(1: VALLEN)
PRINT*, 'GET--> RANK', RANK, 'KEY:', TRIM(KEY(PEER)), ' VAL:', VAL2(1: VALLEN)
CALL PAPYRUSKV_FREE(VAL2, IERROR)
IF (IERROR /= PAPYRUSKV_OK) THEN
PRINT*, 'FAILED'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment