Skip to content

Commit

Permalink
Merge pull request #2 from jdinan/pr/1.4.1
Browse files Browse the repository at this point in the history
Sync tests with SOS v1.4.1
  • Loading branch information
jdinan committed Apr 20, 2018
2 parents 2705f1a + 43d8a13 commit 41e36a8
Show file tree
Hide file tree
Showing 40 changed files with 1,870 additions and 116 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

dnl Init Autoconf/Automake/Libtool

AC_INIT([Sandia OpenSHMEM Test Suite], [1.4.0], [https://github.com/Sandia-OpenSHMEM/SOS])
AC_INIT([Sandia OpenSHMEM Test Suite], [1.4.1], [https://github.com/Sandia-OpenSHMEM/SOS])
AC_PREREQ([2.60])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
Expand Down Expand Up @@ -198,6 +198,7 @@ AC_CONFIG_FILES([Makefile
test/Makefile
test/unit/Makefile
test/shmemx/Makefile
test/include/Makefile
test/performance/Makefile
test/performance/shmem_perf_suite/Makefile
test/performance/tests/Makefile
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# information, see the LICENSE file in the top level directory of the
# distribution.

SUBDIRS = unit shmemx performance apps
SUBDIRS = unit shmemx performance apps include
9 changes: 5 additions & 4 deletions test/apps/gups.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ int
SHMEMRandomAccess(void)
{
int64_t i;
uint64_t i_u;
static int64_t NumErrors, GlbNumErrors;

int NumProcs, MyProc;
Expand Down Expand Up @@ -435,8 +436,8 @@ SHMEMRandomAccess(void)
}

/* Initialize main table */
for (i=0; i<LocalTableSize; i++)
HPCC_Table[i] = i + GlobalStartMyProc;
for (i_u=0; i_u<LocalTableSize; i_u++)
HPCC_Table[i_u] = i_u + GlobalStartMyProc;

shmem_barrier_all();

Expand Down Expand Up @@ -487,8 +488,8 @@ SHMEMRandomAccess(void)
1);

NumErrors = 0;
for (i=0; i<LocalTableSize; i++){
if (HPCC_Table[i] != i + GlobalStartMyProc)
for (i_u=0; i_u<LocalTableSize; i_u++){
if (HPCC_Table[i_u] != i_u + GlobalStartMyProc)
NumErrors++;
}

Expand Down
15 changes: 15 additions & 0 deletions test/include/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- Makefile -*-
#
# Copyright 2011 Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
# retains certain rights in this software.
#
# Copyright (c) 2017 Intel Corporation. All rights reserved.
# This software is available to you under the BSD license.
#
# This file is part of the Sandia OpenSHMEM software package. For license
# information, see the LICENSE file in the top level directory of the
# distribution.

noinst_HEADERS = \
uthash.h
1,074 changes: 1,074 additions & 0 deletions test/include/uthash.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions test/performance/shmem_perf_suite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ noinst_HEADERS = \
int_element_latency.h \
bw_common.h \
uni_dir.h \
uni_dir_ctx.h \
bi_dir.h \
bi_dir_ctx.h \
target_put.h

if ENABLE_LENGTHY_TESTS
Expand Down
49 changes: 43 additions & 6 deletions test/performance/shmem_perf_suite/bi_dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@ void static inline bi_bw_put(int len, perf_metrics_t *metric_info)
{
double start = 0.0, end = 0.0;
int dest = partner_node(*metric_info);
int i = 0, j = 0;
unsigned long int i = 0, j = 0;
static int check_once = 0;
static int fin = -1;

if (!check_once) {
/* check to see whether sender and receiver are the same process */
if (dest == metric_info->my_node) {
fprintf(stderr, "Warning: Sender and receiver are the same process (%d)\n",
dest);
}
/* hostname validation for all sender and receiver processes */
int status = check_hostname_validation(*metric_info);
if (status != 0) return;
check_once++;
}

shmem_barrier_all();

Expand Down Expand Up @@ -60,18 +74,37 @@ void static inline bi_bw_put(int len, perf_metrics_t *metric_info)
shmem_quiet();
}

shmem_barrier_all();
if (streaming_node(*metric_info)) {
shmem_int_p(&fin, 1, dest);
shmem_int_wait_until(&fin, SHMEM_CMP_EQ, 0);
end = perf_shmemx_wtime();
calc_and_print_results((end - start), len, *metric_info);
calc_and_print_results(end, start, len, *metric_info);
} else {
shmem_int_wait_until(&fin, SHMEM_CMP_EQ, 1);
shmem_int_p(&fin, 0, dest);
}

}

void static inline bi_bw_get(int len, perf_metrics_t *metric_info)
{
double start = 0.0, end = 0.0;
int dest = partner_node(*metric_info);
int i = 0, j = 0;
unsigned long int i = 0, j = 0;
static int check_once = 0;
static int fin = -1;

if (!check_once) {
/* check to see whether sender and receiver are the same process */
if (dest == metric_info->my_node) {
fprintf(stderr, "Warning: Sender and receiver are the same process (%d)\n",
dest);
}
/* hostname validation for all sender and receiver processes */
int status = check_hostname_validation(*metric_info);
if (status != 0) return;
check_once++;
}

shmem_barrier_all();

Expand Down Expand Up @@ -112,10 +145,14 @@ void static inline bi_bw_get(int len, perf_metrics_t *metric_info)
#endif
}

shmem_barrier_all();
if (streaming_node(*metric_info)) {
shmem_int_p(&fin, 1, dest);
shmem_int_wait_until(&fin, SHMEM_CMP_EQ, 0);
end = perf_shmemx_wtime();
calc_and_print_results((end - start), len, *metric_info);
calc_and_print_results(end, start, len, *metric_info);
} else {
shmem_int_wait_until(&fin, SHMEM_CMP_EQ, 1);
shmem_int_p(&fin, 0, dest);
}
}

15 changes: 14 additions & 1 deletion test/performance/shmem_perf_suite/bi_dir_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ void static inline bi_bw_ctx (int len, perf_metrics_t *metric_info)
char *src = aligned_buffer_alloc(metric_info->nthreads * len);
char *dst = aligned_buffer_alloc(metric_info->nthreads * len);
assert(src && dst);
static int check_once = 0;

if (!check_once) {
/* check to see whether sender and receiver are the same process */
if (dest == metric_info->my_node) {
fprintf(stderr, "Warning: Sender and receiver are the same process (%d)\n",
dest);
}
/* hostname validation for all sender and receiver processes */
int status = check_hostname_validation(*metric_info);
if (status != 0) return;
check_once++;
}

shmem_barrier_all();

Expand Down Expand Up @@ -111,7 +124,7 @@ void static inline bi_bw_ctx (int len, perf_metrics_t *metric_info)
shmem_barrier_all();
if (streaming_node(*metric_info)) {
end = perf_shmemx_wtime();
calc_and_print_results((end - start), len, *metric_info);
calc_and_print_results(end, start, len, *metric_info);
}

shmem_barrier_all();
Expand Down
Loading

0 comments on commit 41e36a8

Please sign in to comment.