Skip to content

Commit

Permalink
remove CRAY_SHMEM
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypanyala committed Jul 30, 2024
1 parent a5cdfd9 commit 3fe2046
Show file tree
Hide file tree
Showing 23 changed files with 17 additions and 193 deletions.
3 changes: 0 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ libga_la_SOURCES += global/src/ga_diag_seq.F
if ENABLE_EISPACK
libga_la_SOURCES += global/src/rsg.F
endif
if CRAY_XT_NETWORKS
libga_la_SOURCES += global/src/ga_dgemmf.F
endif # CRAY_XT_NETWORKS
if ENABLE_PEIGS
libga_la_SOURCES += global/src/ga_diag.F
endif # ENABLE_PEIGS
Expand Down
1 change: 0 additions & 1 deletion armci/README
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ likely need to specify the optional ARG pointing to the necessary directories
and/or libraries. sockets is the default ARMCI network if nothing else is
specified.

--with-cray-shmem=ARG select armci network as Cray XT shmem
--with-mpi-spawn=ARG select armci network as MPI-2 dynamic process mgmt
--with-openib=ARG select armci network as InfiniBand OpenIB
--with-sockets=ARG select armci network as Ethernet TCP/IP (default)
Expand Down
11 changes: 0 additions & 11 deletions armci/src/devices/mpi-spawn/mpi2_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,6 @@ static void armci_mpi2_spawn()
size_arr = (int*) malloc(armci_nserver * sizeof(int));
info_arr = (MPI_Info*) malloc(armci_nserver * sizeof(MPI_Info));
hostname_arr = (char**) malloc(armci_nserver * sizeof(char*));
#ifdef SPAWN_CRAY_XT
nid_arr = (char**) malloc(armci_nserver * sizeof(char*));;
#endif
for(i=0; i<armci_nserver; i++)
{
hostname_arr[i] = (char*)malloc(MPI_MAX_PROCESSOR_NAME*sizeof(char));
Expand Down Expand Up @@ -461,12 +458,7 @@ static void armci_mpi2_spawn()
command_arr[i] = (*_armci_argv)[0]; /*CHECK: path needs fix */
size_arr[i] = 1; /* 1 data server in each node */
MPI_Info_create(&info_arr[i]);
#ifdef SPAWN_CRAY_XT
asprintf(&nid_arr[i], "%d", atoi((hostname_arr[i] + 3)));
MPI_Info_set(info_arr[i], "host", nid_arr[i]); /*portability? */
#else
MPI_Info_set(info_arr[i], "host", hostname_arr[i]); /*portability? */
#endif
}
}

Expand All @@ -489,9 +481,6 @@ static void armci_mpi2_spawn()
free(size_arr);
free(info_arr);
free(hostname_arr);
#ifdef SPAWN_CRAY_XT
free(nid_arr);
#endif
}
}

Expand Down
6 changes: 6 additions & 0 deletions armci/src/devices/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
#include "armcip.h"
#include "sockets.h"

# ifdef NEC
typedef int soclen_t;
# else
typedef socklen_t soclen_t;
# endif

/* portability of socklen_t definition is iffy - we need to avoid it !!
#if defined(LINUX) && ( defined(_SOCKETBITS_H) || defined(__BITS_SOCKET_H))
#elif defined(AIX)
Expand Down
2 changes: 1 addition & 1 deletion armci/src/include/armcip.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ extern void armci_finalize_fence();
#endif


#if defined(CLUSTER) && !defined(CRAY_SHMEM)
#if defined(CLUSTER)
# define ORDER(op_,proc_)\
if(!SAMECLUSNODE(proc_) && op_ != GET )FENCE_ARR(proc_)=1
# define UPDATE_FENCE_INFO(proc_) if(!SAMECLUSNODE(proc_))FENCE_ARR(proc_)=1
Expand Down
9 changes: 3 additions & 6 deletions armci/src/include/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# include <string.h>
#endif

#if 1 || defined(CRAY_XT)
# define MEMCPY
#endif

#ifndef EXTERN
# define EXTERN extern
Expand All @@ -27,10 +25,6 @@
# define PTR_ALIGN
#endif

#if defined(SHMEM_HANDLE_SUPPORTED) && !defined(CRAY_SHMEM)
#error SHMEM_HANDLE_SUPPORTED should not be defined on a non CRAY_SHMEM network
#endif

#if defined(MEMCPY) && !defined(armci_copy)
# define armci_copy(src,dst,n) memcpy((dst), (src), (n))
#endif
Expand Down Expand Up @@ -131,6 +125,9 @@
}
#endif

#define FENCE_NODE(p)
#define UPDATE_FENCE_STATE(p, op, nissued)

#ifdef NEC
# define THRESH 1
# define THRESH1D 1
Expand Down
4 changes: 2 additions & 2 deletions armci/src/include/locks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define MAX_LOCKS 1024
#define NUM_LOCKS MAX_LOCKS

#if !(defined(PMUTEX) || defined(PSPIN) || defined(CYGNUS) || defined(CRAY_XT))
#if !(defined(PMUTEX) || defined(PSPIN) || defined(CYGNUS) )
# include "spinlock.h"
#endif

Expand Down Expand Up @@ -57,7 +57,7 @@ extern void unsetlock(int);
# define NAT_LOCK(x,p) setlock(x)
# define NAT_UNLOCK(x,p) unsetlock(x)

#if defined(CYGNUS)
#elif defined(CYGNUS)
typedef int lockset_t;
# define NAT_LOCK(x,p) armci_die("does not run in parallel",0)
# define NAT_UNLOCK(x,p) armci_die("does not run in parallel",0)
Expand Down
16 changes: 0 additions & 16 deletions armci/src/locks/memlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ void **memlock_table_array;

static memlock_t table[MAX_SLOTS];

#if (defined(CRAY_SHMEM) && defined(CRAY_XT))
#define MAX_SEGS 512
armci_memoffset_t armci_memoffset_table[MAX_SEGS];
static short int seg_count=0;
static short int new_seg=0;
#endif

/*\ simple locking scheme that ignores addresses
\*/
void armci_lockmem_(void *pstart, void *pend, int proc)
Expand Down Expand Up @@ -151,15 +144,6 @@ void armci_lockmem(void *start, void *end, int proc)
pend =end;
#endif

#ifdef CRAY_SHMEM
{ /* adjust according the remote process raw address */
long bytes = (long) ((char*)pend-(char*)pstart);
extern void* armci_shmalloc_remote_addr(void *ptr, int proc);
pstart = armci_shmalloc_remote_addr(pstart, proc);
pend = (char*)pstart + bytes;
}
#endif

while(1){
NATIVE_LOCK(lock,proc);

Expand Down
33 changes: 1 addition & 32 deletions armci/src/memory/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
#define USE_SHMEM_
#define SHM_UNIT 1024

#if defined(CRAY_SHMEM)
extern void armci_shmalloc_exchange_address(void **ptr_arr);
extern void armci_shmalloc_exchange_offsets(context_t *);
# if defined(CRAY_XT)
# include <mpp/shmem.h>
# endif
#endif

static context_t ctx_localmem;
#if defined(ALLOW_PIN)
static context_t ctx_mlocalmem;
Expand Down Expand Up @@ -603,24 +595,9 @@ void armci_krmalloc_init_localmem() {
kr_malloc_init(0, 0, 0, reg_malloc, 0, &ctx_localmem);
kr_malloc_init(0, 0, 0, malloc, 0, &ctx_mlocalmem);
ctx_mlocalmem.ctx_type = KR_CTX_LOCALMEM;
#elif defined(CRAY_SHMEM) && defined(CRAY_XT)
extern size_t get_xt_heapsize();
int units_avail = (get_xt_heapsize() - 1024 * 1024) / SHM_UNIT;

if(DEBUG_)
{
fprintf(stderr,"%d:krmalloc_init_localmem: symheap=%llu,units(%d)=%d\n",
armci_me, SHM_UNIT*units_avail, SHM_UNIT, units_avail);
}
kr_malloc_init(SHM_UNIT, units_avail, units_avail, shmalloc, 0,
&ctx_localmem);
armci_shmalloc_exchange_offsets(&ctx_localmem);
#else

kr_malloc_init(0, 0, 0, malloc, 0, &ctx_localmem);

#endif

ctx_localmem.ctx_type = KR_CTX_LOCALMEM;
}

Expand Down Expand Up @@ -750,14 +727,10 @@ int PARMCI_Malloc(void *ptr_arr[], armci_size_t bytes)

bzero((char*)ptr_arr,armci_nproc*sizeof(void*));
ptr_arr[armci_me] = ptr;

# if defined(CRAY_SHMEM)
armci_shmalloc_exchange_address(ptr_arr);
# else

/* now combine individual addresses into a single array */
armci_exchange_address(ptr_arr, armci_nproc);
# endif

# ifdef ALLOW_PIN
armci_global_region_exchange(ptr, (long) bytes);
# endif
Expand Down Expand Up @@ -907,11 +880,7 @@ int ARMCI_Malloc_group(void *ptr_arr[], armci_size_t bytes,
ptr_arr[grp_me] = ptr;

/* now combine individual addresses into a single array */
#if defined(CRAY_SHMEM)
armci_shmalloc_exchange_address_grp(ptr_arr, group);
#else
armci_exchange_address_grp(ptr_arr, grp_nproc, group);
#endif

# ifdef ALLOW_PIN
# if 0
Expand Down
49 changes: 0 additions & 49 deletions armci/src/memory/shmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,52 +92,3 @@ void* armci_shmalloc_remote_addr(void *ptr, int proc)
return (void*)((char*)ptr - offset_arr[proc]);
}

#if defined(CRAY_XT)

#define XT_SYMMETRIC_HEAP_SIZE ((size_t)1024)*1024*1024; /* 1 GB is default */
size_t get_xt_heapsize()
{

char *uval = getenv("XT_SYMMETRIC_HEAP_SIZE");
char *token = NULL;
char *unit_str = NULL;
size_t scale=1, size;

if(uval != NULL)
{
if((unit_str=strchr(uval, 'K')) != NULL)
{
scale = 1024;
token = strtok(uval, "K");
}
else if((unit_str=strchr(uval, 'M')) != NULL)
{
scale = ((size_t)1024)*1024;
token = strtok(uval, "M");
}
else if((unit_str=strchr(uval, 'G')) != NULL)
{
scale = ((size_t)1024)*1024*1024;
token = strtok(uval, "G");
}
else
{
scale = 1;
token = uval;
}

size = (size_t)atol(token);
size *= scale; /* in bytes */

if(size < 1024*1024)
armci_die("get_xt_heapsize(): Symmetric heapsize should be > 1MB",0);
}
else
{
size = XT_SYMMETRIC_HEAP_SIZE;
}

return size;
}
#endif /* defined CRAY_XT */

8 changes: 1 addition & 7 deletions armci/src/xfer/rmw.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ void armci_generic_rmw(int op, void *ploc, void *prem, int extra, int proc)

int PARMCI_Rmw(int op, void *ploc, void *prem, int extra, int proc)
{
#if defined(_CRAYMPP) || defined(CRAY_SHMEM)
int ival;
long lval;
#endif

#if defined(CLUSTER) && !defined(CYGWIN)\
&& !defined(CRAY_SHMEM)
#if defined(CLUSTER) && !defined(CYGWIN)
if(!SAMECLUSNODE(proc)){
armci_rem_rmw(op, ploc, prem, extra, proc);
return 0;
Expand Down
5 changes: 0 additions & 5 deletions armci/testing/testnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@
#define MAXPROC 128
#define TIMES 100

#ifdef CRAY
# define ELEMS 800
#else
# define ELEMS 200
#endif



/***************************** macros ************************/
Expand Down
2 changes: 1 addition & 1 deletion armci/testing/timer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ARMCI_TESTING_TIMER_H_
#define ARMCI_TESTING_TIMER_H_

#if (defined(__i386__) || defined(__x86_64__) || defined(__powerpc__)) && !defined(_CRAYC)
#if (defined(__i386__) || defined(__x86_64__) || defined(__powerpc__))
# define HAVE_RDTSC 1
# if defined(__i386__)
static __inline__ unsigned long long rdtsc(void)
Expand Down
1 change: 0 additions & 1 deletion m4/armci_c_opt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ AS_IF([test "x$armci_cv_c_opt" = x && test "x$enable_opt" = xyes], [
AS_CASE([$ga_cv_target:$ga_cv_c_compiler_vendor:$host_cpu:$ga_armci_network],
[BGQ:ibm:*:*], [armci_cv_c_opt="-O3 -qstrict -qarch=qp -qtune=qp"],
[BGQ:gnu:*:*], [armci_cv_c_opt="-O2"],
[CRAY_XT:*:*:*], [armci_cv_c_opt=],
[CYGWIN:*:*:*], [armci_cv_c_opt="-malign-double"],
[FUJITSU_VPP64:*:*:*], [armci_cv_c_opt="-x100"],
[FUJITSU_VPP:*:*:*], [armci_cv_c_opt="-x100 -KA32"],
Expand Down
1 change: 0 additions & 1 deletion m4/armci_f77_opt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ AS_IF([test "x$armci_cv_f77_opt" = x && test "x$enable_opt" = xyes], [
AS_CASE([$ga_cv_target:$ga_cv_f77_compiler_vendor:$host_cpu:$ga_armci_network],
[BGQ:ibm:*:*], [armci_cv_f77_opt="-O3 -qstrict -qarch=qp -qtune=qp"],
[BGQ:gnu:*:*], [armci_cv_f77_opt="-O2"],
[CRAY_XT:*:*:*], [armci_cv_f77_opt=],
[CYGWIN:*:*:*], [armci_cv_f77_opt=],
[FUJITSU_VPP64:*:*:*], [armci_cv_f77_opt="-Sw"],
[FUJITSU_VPP:*:*:*], [armci_cv_f77_opt="-Sw -KA32"],
Expand Down
7 changes: 0 additions & 7 deletions m4/armci_setup.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
AC_DEFUN([ARMCI_SETUP],
[AC_REQUIRE([GA_ARMCI_NETWORK])
AS_CASE([$ga_armci_network],
[CRAY_SHMEM], [
AC_DEFINE([CLUSTER], [1], [TODO])
AC_DEFINE([CRAY_XT], [1], [TODO])
AC_DEFINE([CRAY_SHMEM], [1], [TODO])
],
[MPI_TS], [
AC_DEFINE([PTHREADS], [1], [TODO])
AC_DEFINE([DATA_SERVER], [1], [TODO])
Expand Down Expand Up @@ -45,8 +40,6 @@ AS_CASE([$ga_armci_network],
[MPI_SPAWN], [
AC_DEFINE([DATA_SERVER], [1], [TODO])
AC_DEFINE([MPI_SPAWN], [1], [TODO])
AS_IF([test x$ARMCI_SPAWN_CRAY_XT != x],
[AC_DEFINE([SPAWN_CRAY_XT], [1], [TODO])])
],
[OPENIB], [
AC_DEFINE([PTHREADS], [1], [TODO])
Expand Down
Loading

0 comments on commit 3fe2046

Please sign in to comment.