Skip to content

Commit

Permalink
remove IA64
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypanyala committed Jul 28, 2024
1 parent 3dffe9f commit ea7023d
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 414 deletions.
1 change: 0 additions & 1 deletion armci/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ libarmci_la_SOURCES += src/ft/armci_storage.h
libarmci_la_SOURCES += src/include/acc.h
libarmci_la_SOURCES += src/include/armcip.h
libarmci_la_SOURCES += src/include/asm-ppc.h
libarmci_la_SOURCES += src/include/atomic_ops_ia64.h
libarmci_la_SOURCES += src/include/atomics-i386.h
libarmci_la_SOURCES += src/include/copy.h
libarmci_la_SOURCES += src/include/fujitsu-vpp.h
Expand Down
4 changes: 2 additions & 2 deletions armci/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
GA_CHECK_HEADERS([assert.h c_asm.h errno.h fcntl.h float.h ia64/sys/inline.h malloc.h math.h memory.h mpp/shmem.h netdb.h netinet/in.h netinet/tcp.h process.h setjmp.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h strings.h sys/types.h sys/atomic_op.h sys/errno.h sys/file.h sys/ipc.h sys/mman.h sys/param.h sys/sem.h sys/shm.h sys/socket.h sys/stat.h sys/syscall.h sys/systemcfg.h sys/time.h sys/uio.h sys/wait.h time.h unistd.h windows.h winsock.h rpc/rpc.h rpc/types.h rpc/xdr.h],
GA_CHECK_HEADERS([assert.h c_asm.h errno.h fcntl.h float.h malloc.h math.h memory.h mpp/shmem.h netdb.h netinet/in.h netinet/tcp.h process.h setjmp.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h strings.h sys/types.h sys/atomic_op.h sys/errno.h sys/file.h sys/ipc.h sys/mman.h sys/param.h sys/sem.h sys/shm.h sys/socket.h sys/stat.h sys/syscall.h sys/systemcfg.h sys/time.h sys/uio.h sys/wait.h time.h unistd.h windows.h winsock.h rpc/rpc.h rpc/types.h rpc/xdr.h],
[], [],
[@%:@ifdef HAVE_RPC_TYPES_H
@%:@include <rpc/types.h>
Expand Down Expand Up @@ -287,7 +287,7 @@ AM_CONDITIONAL([ENABLE_SHARED], [test x$enable_shared = xyes])

AS_IF([test "x$ga_cv_target" = xLINUX64],
[AS_CASE([$host_cpu],
[x86_64|ppc64|ia64],
[x86_64|ppc64],
[AC_DEFINE([NEED_MEM_SYNC], [1], [Creates memfenc macro])])])
AS_IF([test "x$host_cpu" = xPWR4],
[AC_DEFINE([NEED_MEM_SYNC], [1], [Creates memfenc macro])])
Expand Down
12 changes: 0 additions & 12 deletions armci/examples/features/gpc/hashtable/GPCHashmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ using std::endl;
#define ARMCI_ENABLE_GPC_CALLS
#include "gpc.h"

/***************************** macros ************************/
extern "C" {
# if defined(__ia64)
# if defined(__GNUC__) && !defined (__INTEL_COMPILER)
# define MEM_FENCE __asm__ __volatile__ ("mf" ::: "memory");
# else /* Intel Compiler */
extern void _armci_ia64_mb();
# define MEM_FENCE _armci_ia64_mb();
# endif
# endif
}

#include "Hash_common.h"
#include "GPCHashmap.h"
#include "Util.h"
Expand Down
9 changes: 0 additions & 9 deletions armci/src/collectives/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ static bufstruct *_gop_buffer;
# define SET_SHM_FLAG(_flg,_val) _clear_lock((int *)(_flg),_val);
# elif defined(NEC)
# define SET_SHM_FLAG(_flg,_val) MEM_FENCE; *(_flg)=(_val)
# elif defined(__ia64)
# if defined(__GNUC__) && !defined (__INTEL_COMPILER)
# define SET_SHM_FLAG(_flg,_val)\
__asm__ __volatile__ ("mf" ::: "memory"); *(_flg)=(_val)
# else /* Intel Compiler */
extern void _armci_ia64_mb();
# define SET_SHM_FLAG(_flg,_val)\
_armci_ia64_mb(); *(_flg)=(_val);
# endif
# elif defined(MACX)
# if defined(__GNUC__)
# define SET_SHM_FLAG(_flg,_val)\
Expand Down
4 changes: 0 additions & 4 deletions armci/src/devices/openib/cbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
#include <malloc.h>
#include <string.h>

#ifdef _IA64_
#define CBUF_FLAG_TYPE uint64_t
#else
#define CBUF_FLAG_TYPE uint32_t
#endif

#if (defined(RDMA_FAST_PATH) || defined(ADAPTIVE_RDMA_FAST_PATH))

Expand Down
251 changes: 6 additions & 245 deletions armci/src/ft/armci_chkpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,7 @@ static void armci_protect_pages(unsigned long startpagenum,unsigned long numpage
* called inside main(int argc, char **argv), I guess ... */
void armci_init_checkpoint2()
{
printf("%d:in armci init checkpoint2\n",armci_me);fflush(stdout);
#ifdef __ia64
/* get backing store bottom */
asm("mov %0=ar.bsp": "=r"(armci_ckpt_bspBottom));
printf("%d: armci_ckpt_bspBottom=%p\n", armci_me, armci_ckpt_bspBottom);
#endif
printf("%d:in armci init checkpoint2\n",armci_me);fflush(stdout);
}

/*\ ----------CORE FUNCTIONS -----------
Expand All @@ -227,11 +222,6 @@ int armci_init_checkpoint(int spare)

#ifdef CHECKPOINT2
printf("%d:in armci init checkpoint\n",armci_me);fflush(stdout);
#ifdef __ia64
/* get backing store bottom */
asm("mov %0=ar.bsp": "=r"(armci_ckpt_bspBottom));
printf("%d: armci_ckpt_bspBottom=%p\n", armci_me, armci_ckpt_bspBottom);
#endif
#endif
mypagesize = getpagesize();
if(checkpointing_initialized)return(0);
Expand Down Expand Up @@ -487,44 +477,6 @@ void what_is_going_on() {
printf("what_is_going_on(): a=%p\n", &a);
}

/*
In IA64, there is a seperate stack called register stack engine (RSE,
contains 96 registers) to manage across functions calls (e.g. these
registers stores the function return address, etc.. In order to save this
info, flush the stack registers to backing store and save backing store.
NOTE: backing store is a cache to register stack.
*/
#if defined(__ia64)
static void armci_ckpt_write_backstore(int rid)
{
char *bspTop; /* in IA64 only, back store pointer (bsp) */
off_t ofs;

/* flush the register stack */
asm("flushrs");

/* getting back store pointer (bsp). BSP is similar to stack pointer,
* which points to the top of backing store */
asm("mov %0=ar.bsp": "=r"(bspTop));
printf("BSP Pointer (ar.bsp) = %p\n", bspTop);

armci_storage_record[rid].bsp_mon.ptr = armci_ckpt_bspBottom;
armci_storage_record[rid].bsp_mon.bytes=((unsigned long)(bspTop) - (unsigned long)(armci_ckpt_bspBottom));

ofs=CURR_FILE_POS(rid);
UPDATE_FILE_POS(rid, armci_storage_record[rid].bsp_mon.bytes);
armci_storage_record[rid].bsp_mon.fileoffset = ofs;

printf("%d: Save Backing store: %p to %p (bytes=%ld: off=%ld)\n\n",armci_me, armci_ckpt_bspBottom, armci_ckpt_bspBottom+armci_storage_record[rid].bsp_mon.bytes, armci_storage_record[rid].bsp_mon.bytes, ofs);fflush(stdout);

armci_storage_write_ptr(armci_storage_record[rid].fileinfo.fd,
armci_storage_record[rid].bsp_mon.ptr,
armci_storage_record[rid].bsp_mon.bytes,
armci_storage_record[rid].bsp_mon.fileoffset);

}
#endif

static void armci_ckpt_write_stack(int rid)
{
int dummy_first=ARMCI_STACK_VERIFY;
Expand All @@ -546,12 +498,7 @@ static void armci_ckpt_write_stack(int rid)
printf("%d: Save stack: %p to %p (bytes=%ld : off=%ld)\n\n",armci_me, top, top+armci_storage_record[rid].stack_mon.bytes, armci_storage_record[rid].stack_mon.bytes, ofs);fflush(stdout);
armci_storage_write_ptr(armci_storage_record[rid].fileinfo.fd,top,
armci_storage_record[rid].stack_mon.bytes,
armci_storage_record[rid].stack_mon.fileoffset);

#if defined(__ia64)
/* In IA64, write Backing Store, as it is the cache for Stack Registers */
armci_ckpt_write_backstore(rid);
#endif
armci_storage_record[rid].stack_mon.fileoffset);
}

static void armci_ckpt_write_heap(int rid)
Expand Down Expand Up @@ -664,16 +611,6 @@ int armci_icheckpoint(int rid)
if(armci_storage_record[rid].ckpt_stack ||
armci_storage_record[rid].ckpt_heap) {

#if defined(__ia64)
{
char *tmp_bsp;
/* flush the register stack */
asm("flushrs");
/* get the top of backing store */
asm("mov %0=ar.bsp": "=r"(tmp_bsp));
printf("tmp: ar.bsp = %p\n", tmp_bsp);
}
#endif
if((armci_recovering=setjmp(armci_storage_record[rid].jmp))==0){

/* 1. file offsets */
Expand Down Expand Up @@ -724,117 +661,18 @@ int armci_icheckpoint(int rid)
return(rc);
}

/**
* Recover Backing Store.
*/
#if defined(__ia64)
static void armci_recover_backstore(int rid)
{
off_t offset = armci_storage_record[rid].bsp_mon.fileoffset;
size_t size = armci_storage_record[rid].bsp_mon.bytes;
char *bspTop = (char*)((unsigned long)(armci_storage_record[rid].bsp_mon.ptr) + size);
char *bsp;

asm("flushrs");
asm("mov %0=ar.bsp": "=r"(bsp));

/* CHECK: expand the backing store so that the current backing store is
replaced with saved backing store (CHECK: register stack can be as
large as 96 registers, so 96*8 bytes) */
if( (unsigned long)bsp < (unsigned long)(bspTop + 96*8 + EST_OFFSET) ) {
armci_recover_backstore(rid);
}
else{
printf("%d: armci_recover_backstore(): size=%ld offset=%ld backing store: %p to %p\n", armci_me, size, offset, bspTop, armci_storage_record[rid].bsp_mon.ptr);
armci_storage_read_ptr(armci_storage_record[rid].fileinfo.fd, bspTop, size, offset);

printf("%d: armci_recover_backstore(): rid=%d\n", armci_me, rid);

/* CHECK: Is there a way to verify backing store recovery
(similar to stack) */
}
/**
* CHECK: Do nothing here. Recursive function in action.
*/
}
#endif


/**
* Recover stack: restore a saved stack by overwriting the current stack
* of this process . The idea of restoring the stack is, we are going to
* replace the contents of current stack, so that longjmp is legitimate.
*/
#if 0
static void armci_recover_stack(int rid)
{
off_t offset = sizeof(jmp_buf)+4*sizeof(int);
size_t size = armci_storage_record[rid].stack_mon.bytes;
char *stacktop = (char*)((unsigned long)(armci_storage_record[rid].stack_mon.ptr) - size);
int dummy;
printf("check=%p %p; rid=%d\n", &dummy, &offset, rid);

/* CHECK: check whether current stack frame is above the old (saved)
stack. If so, the recover the stack, else call thus recursively
until the current stack is above the old stack */
if( (unsigned long)&dummy >= (unsigned long)(stacktop-EST_OFFSET) ) {
armci_recover_stack(rid);
}
else {
printf("%d: armci_recover_stack(): size=%ld offset=%ld stack: %p to %p\n", armci_me, size, offset, stacktop, armci_storage_record[rid].stack_mon.ptr);
armci_storage_read_ptr(armci_storage_record[rid].fileinfo.fd, stacktop, size, offset);

{ /* verify stack recovery */
int dummy = *((int*)(stacktop+EST_OFFSET));
if(dummy != ARMCI_STACK_VERIFY) {
printf("WARNING: armci_recover_stack FAILED: %d", dummy);
armci_die("armci_recover_stack FAILED", dummy);
}
else if(DEBUG_)
printf("%d: armci_recover_stack SUCCESS (%d)\n", armci_me, dummy);
}

#ifdef __ia64
/* recover the backing store (BSP) */
armci_recover_backstore(rid);
#endif

}
/**
* CHECK: Do nothing here...recursive function in action here..
*/
}
#endif

static void armci_recover_memory(int rid)
{
int dummy;
off_t ofs;
size_t stacksize = armci_storage_record[rid].stack_mon.bytes;
char *stacktop = (char*)((unsigned long)(armci_storage_record[rid].stack_mon.ptr) - stacksize);

#ifdef __ia64
size_t bspsize = armci_storage_record[rid].bsp_mon.bytes;
char *bspTop = (char*)((unsigned long)(armci_storage_record[rid].bsp_mon.ptr) + bspsize);
char *bsp;
#endif

printf("armci_recover_stack(): check=%p ; rid=%d\n", &dummy, rid);
/* call recursively until current stack is above saved stack */
if( (unsigned long)&dummy >= (unsigned long)(stacktop-EST_OFFSET) )
armci_recover_memory(rid);

#ifdef __ia64
asm("flushrs");
asm("mov %0=ar.bsp": "=r"(bsp));

printf("armci_recover_bsp(): check=%p ; rid=%d\n", &dummy, rid);
/* similarly, call recursively until current backing store expands
(register stack can be as large as 96 registers) */
if( (unsigned long)bsp < (unsigned long)(bspTop + 97*8) )
armci_recover_memory(rid);
#endif

/* ------------------ recover stack segment ------------------- */
printf("%d: armci_recover_stack(): fp=%p size=%ld off=%ld stack: %p to %p\n", armci_me, armci_storage_record[rid].fileinfo.fd, stacksize, armci_storage_record[rid].stack_mon.fileoffset, stacktop, armci_storage_record[rid].stack_mon.ptr);
armci_storage_read_ptr(armci_storage_record[rid].fileinfo.fd, stacktop, stacksize, armci_storage_record[rid].stack_mon.fileoffset);
Expand All @@ -847,23 +685,6 @@ static void armci_recover_memory(int rid)
else if(DEBUG_)
printf("%d: armci_recover_stack SUCCESS (%d)\n", armci_me, dummy);
}

/* -------- recover register stack (RSE) segment (IA64 only) -------- */
#ifdef __ia64
{
size_t bspsize = armci_storage_record[rid].bsp_mon.bytes;
char *bspTop = (char*)((unsigned long)(armci_storage_record[rid].bsp_mon.ptr) + bspsize);

bsp = (char*)armci_storage_record[rid].bsp_mon.ptr; /* CHECK: */

printf("%d: armci_recover_backstore(): size=%ld off=%ld backing store: %p to %p\n", armci_me, bspsize, armci_storage_record[rid].bsp_mon.fileoffset, armci_storage_record[rid].bsp_mon.ptr, bspTop);
armci_storage_read_ptr(armci_storage_record[rid].fileinfo.fd, bsp, bspsize, armci_storage_record[rid].bsp_mon.fileoffset);
printf("%d: armci_recover_backstore(): rid=%d\n", armci_me, rid);

/* CHECK: Is there a way to verify backing store recovery
(similar to stack) */
}
#endif

ofs=0; /* jmp_buf is the first one to be stored in ckpt file, so ofs=0 */
printf("%d: armci_recover jmp_buf(): size=%ld off=%ld (%p to %p)\n", armci_me, sizeof(jmp_buf), ofs, &armci_storage_record[rid].jmp, (char*)(&armci_storage_record[rid].jmp)+sizeof(jmp_buf));
Expand Down Expand Up @@ -935,64 +756,6 @@ int armci_irecover(int rid,int iamreplacement)
return 1;
}

#if 0
static int tmpStack[TMP_STACK_SIZE];
int armci_irecover_OLD(int rid,int iamreplacement)
{
int rc;
jmp_buf jmp;

/* Save "rid" and "iamreplacement" in a global variable as we are going
to replace the contents of the current stack. */
RID = rid; /* CHECK: save rid in a file or somewhere instead of
* global variable*/
tmp_iamreplacement = iamreplacement;

#if 0
/* create a temporary stack */
rc = _setjmp(jmp);

if (rc == 0) {
/* Goto a temporary stack as we still running on the original stack. To
do this, update Stack Pointer (SP) to be in a temp stack area. */
jmp->__jmpbuf[JB_SP] = ((long)((char *)(tmpStack + TMP_STACK_SIZE) - EXTRA_STACK_SPACE) & ~0xf);
printf("%d: temporary stack starts @ %p\n", armci_me, jmp->__jmpbuf[JB_SP]);

/* CHECK: make this TMP_STACK_SIZE dynamic, by measuring the size of
the stack from file */

/*
* Jump back ...
* But with new 'jmp'
*/
_longjmp(jmp, 1);
}
else
#endif
{

/**
* Now we are on temporary stack. So it is safe to recover stack.
*/
armci_recover_stack(RID);

/**
* go to the restored stack by calling longjmp(). Read jmpbuf from file
*/
if(tmp_iamreplacement){ /* CHECK: what is iamreplacement */
rc=armci_storage_read_ptr(armci_storage_record[RID].fileinfo.fd,&armci_storage_record[RID].jmp,sizeof(jmp_buf),4*sizeof(int));
}
armci_msg_group_barrier(&armci_storage_record[RID].group);
printf("%d: restoring original stack starts @ %p\n", armci_me, armci_storage_record[RID].jmp->__jmpbuf[JB_SP]);
longjmp(armci_storage_record[RID].jmp,1);/*goto the restored stack*/
}

/*we should never come here things are hosed */
armci_die2("recovery hosed",RID,iamreplacement);
return(1);
}
#endif

void armci_icheckpoint_finalize(int rid)
{
int i;
Expand All @@ -1008,10 +771,8 @@ void armci_icheckpoint_finalize(int rid)
}

/*
TODO:
1. organize all the $ifdef __ia64's properly..They are scattered all
over and it is difficult to track down and potentially buggy
2. checkpoint shared memory and mmap regions
3. I/O file open/close, signals and other system specific stuff ???
4. memory leaks due to malloc()....free'em
TODO
1. checkpoint shared memory and mmap regions
2. I/O file open/close, signals and other system specific stuff ?
3. memory leaks due to malloc() - free them
*/
Loading

0 comments on commit ea7023d

Please sign in to comment.