From 73c9f528cdb72810581a262d1d464dcbbcab4a88 Mon Sep 17 00:00:00 2001 From: Andrew Shao Date: Mon, 21 Oct 2024 18:54:43 +0000 Subject: [PATCH] Unify kinds --- examples/parallel/fortran/smartredis_put_get_3D.F90 | 9 +++++---- utils/launch_redis.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/parallel/fortran/smartredis_put_get_3D.F90 b/examples/parallel/fortran/smartredis_put_get_3D.F90 index 4d71d89c..eec1d52c 100644 --- a/examples/parallel/fortran/smartredis_put_get_3D.F90 +++ b/examples/parallel/fortran/smartredis_put_get_3D.F90 @@ -34,11 +34,11 @@ program main #include "enum_fortran.inc" - integer, parameter :: dim1 = 10 - integer, parameter :: dim2 = 20 - integer, parameter :: dim3 = 30 + integer, parameter :: dim1 = 2 + integer, parameter :: dim2 = 3 + integer, parameter :: dim3 = 4 - real(kind=8), dimension(dim1, dim2, dim3) :: recv_array_real_64 + real(kind=c_double), dimension(dim1, dim2, dim3) :: recv_array_real_64 real(kind=c_double), dimension(dim1, dim2, dim3) :: true_array_real_64 @@ -65,6 +65,7 @@ program main if (result .ne. SRNoError) error stop 'client%put_tensor failed' result = client%unpack_tensor(key_prefix//"true_array_real_64", recv_array_real_64, shape(recv_array_real_64)) if (result .ne. SRNoError) error stop 'client%unpack_tensor failed' + print *, true_array_real_64, recv_array_real_64 if (.not. all(true_array_real_64 == recv_array_real_64)) error stop 'true_array_real_64: FAILED' ! Shut down MPI diff --git a/utils/launch_redis.py b/utils/launch_redis.py index 9844404f..d338c48c 100644 --- a/utils/launch_redis.py +++ b/utils/launch_redis.py @@ -197,7 +197,6 @@ def create_db(n_nodes, port, device, rai_ver, udsport): # Make sure that all servers are up # Let exceptions propagate to the caller - check_availability(n_nodes, port, udsport) for proc in procs: out, err = proc.communicate(timeout=15) if proc.returncode != 0: @@ -206,9 +205,11 @@ def create_db(n_nodes, port, device, rai_ver, udsport): print("STDOUT:") print(out) raise RuntimeError("Failed to launch Redis server!") + check_availability(n_nodes, port, udsport) # Create cluster for clustered Redis request if n_nodes > 1: + sleep(5) cluster_str = " ".join(f"127.0.0.1:{port + i}" for i in range(n_nodes)) cmd = f"{rediscli} --cluster create {cluster_str} --cluster-replicas 0 --cluster-yes" print(cmd)