This commit is contained in:
edoapra 2025-04-16 09:51:27 -07:00
parent c5bc54ad6d
commit d26e5ea0d6
No known key found for this signature in database
GPG key ID: 9E6A0B70826967BA
13 changed files with 0 additions and 1039 deletions

View file

@ -1,16 +0,0 @@
#!/usr/bin/env bash
rm -f autoconf.patch
cat > autoconf.patch <<EOF
--- $1/configure.org 2022-11-03 14:47:40.000000000 -0700
+++ $1/configure 2023-10-20 15:36:29.516676155 -0700
@@ -21699 +21698,0 @@
- s/\/.*\/lib.*\.a//p ;
@@ -21811 +21809,0 @@
- s/\/.*\/lib.*\.a//p ;
@@ -22145 +22142,0 @@
- s/\/.*\/lib.*\.a//p ;
@@ -22257 +22253,0 @@
- s/\/.*\/lib.*\.a//p ;
EOF
patch -p0 -s -N < ./autoconf.patch
echo autoconf.patch applied

View file

@ -1,35 +0,0 @@
#!/usr/bin/env bash
rm -f ga_diag_seg_i4.patch
cat > ga_diag_seg_i4.patch <<EOF
--- $1/global/src/ga_diag_seq.F.org 2023-10-30 11:07:22.963036506 -0700
+++ $1/global/src/ga_diag_seq.F 2023-10-28 20:21:34.000000000 -0700
@@ -28,11 +28,12 @@
integer l_wrk
MA_ACCESS_INDEX_TYPE k_wrk
integer n2
+ INTGR4 n2_4
#endif
integer l_a, l_s
MA_ACCESS_INDEX_TYPE k_a, k_s
integer dim1, dim2, type, me
- INTGR4 n4,ierr
+ INTGR4 n4,ierr,one4
logical status
c
c
@@ -94,8 +95,10 @@
call rsg(n, n, dbl_mb(k_a), dbl_mb(k_s), evals, 1,
$ dbl_mb(k_v), dbl_mb(k_fv1), dbl_mb(k_fv2), ierr)
#else
- call dsygv(1,'V','U',n4,dbl_mb(k_a),n,dbl_mb(k_s),n4,
- $ evals,dbl_mb(k_wrk),n2, ierr)
+ one4=1
+ n2_4=n2
+ call dsygv(one4,'V','U',n4,dbl_mb(k_a),n4,dbl_mb(k_s),n4,
+ $ evals,dbl_mb(k_wrk),n2_4, ierr)
if (ierr.ne.0)
$ call ga_error('ga_diag_seq: dsygv failed',ierr)
c We used to copy to preserve code symmetry with EISPACK
EOF
patch -p0 -s -N < ./ga_diag_seg_i4.patch
echo ga_diag_seg_i4.patch applied

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
rm -f ga_ma_align.patch
cat > ga_ma_align.patch <<EOF
--- $1/global/src/base.c.org 2023-10-19 15:49:17
+++ $1/global/src/base.c 2023-10-19 15:49:04
@@ -76,7 +76,7 @@
/*#define CHECK_MA yes */
/*uncomment line below to verify if MA base address is alligned wrt datatype*/
-#if !(defined(LINUX) || defined(CRAY) || defined(CYGWIN))
+#if !(defined(LINUX) || defined(CRAY) || defined(CYGWIN) || defined(MACX))
#define CHECK_MA_ALGN 1
#else
#endif
EOF
patch -p0 -s -N < ga_ma_align.patch
echo ga_ma_align.patch applied

View file

@ -1,41 +0,0 @@
#!/usr/bin/env bash
rm -f gamalloc.patch
cat > gamalloc.patch <<EOF
--- $1/global/src/ga_malloc.c
+++ $1/global/src/ga_malloc.c
@@ -8,7 +8,7 @@
#include "globalp.h"
#include "ga-papi.h"
#include "ga-wapi.h"
-#define GA_MAXMEM_AVAIL ( ( (long)1 << (8*sizeof(Integer)-2) ) -1)
+#define GA_MAXMEM_AVAIL ( ( (size_t)1 << (8*sizeof(Integer)-2) ) -1)
#define CHECK 0
#define ALIGNMENT sizeof(DoubleComplex)
@@ -28,7 +28,7 @@
void* ga_malloc(Integer nelem, int type, char *name)
{
void *ptr;
- unsigned long addr;
+ size_t addr;
Integer handle, adjust=0, bytes, item_size=GAsizeofM(pnga_type_f2c(type));
Integer extra;
@@ -45,11 +45,11 @@
if(ga_usesMA) { /* Uses Memory Allocator (MA) */
if(MA_push_stack(type,nelem,name,&handle)) MA_get_pointer(handle,&ptr);
else pnga_error("ga_malloc: MA_push_stack failed",0);
- addr = (unsigned long)ptr;
+ addr = (size_t)ptr;
}
else { /* else, using external memory allocator */
bytes = nelem*item_size;
- addr = (unsigned long)(*ga_ext_alloc)(
+ addr = (size_t)(*ga_ext_alloc)(
(size_t)bytes, (int)item_size, name);
}
EOF
patch -p0 -s -N < gamalloc.patch
echo gamalloc.patch applied

View file

@ -1,671 +0,0 @@
#!/usr/bin/env bash
rm -f win64_ma_nxtval.patch
cat > win64_ma_nxtval.patch <<EOF
--- $1/ma/ma.c.org 2020-02-28 11:39:16.000000000 -0800
+++ $1/ma/ma.c 2020-06-26 17:03:05.009072842 -0700
@@ -98,11 +98,11 @@
#if defined(BGQ)
#define ALIGNMENT 32
#else
-#define ALIGNMENT sizeof(long)
+#define ALIGNMENT sizeof(size_t)
#endif
/* min size of block split and placed on free list */
-#define MINBLOCKSIZE mai_round((long)(ALIGNMENT + BLOCK_OVERHEAD_FIXED), \
+#define MINBLOCKSIZE mai_round((size_t)(ALIGNMENT + BLOCK_OVERHEAD_FIXED), \
(ulongi)ALIGNMENT)
/* signatures for guard words */
@@ -114,7 +114,7 @@
**/
typedef unsigned int Guard; /* for detection of memory trashing */
-typedef unsigned long ulongi; /* for brevity */
+typedef size_t ulongi; /* for brevity */
/* allocation request for a block */
typedef struct _AR
@@ -180,7 +180,7 @@
private void ma_preinitialize(char *caller);
private Boolean mh2ad(Integer memhandle, AD **adout, BlockLocation location, char *caller);
private void mh_free(AD *ad);
-private long mai_round(long value, ulongi unit);
+private size_t mai_round(size_t value, ulongi unit);
private void str_ncopy(char *to, char *from, int maxchars);
/* foreign routines */
@@ -364,7 +364,7 @@
/* compute 0-based index for client_space from AD */
#define client_space_index(ad) \
- ((MA_AccessIndex)((long)((ad)->client_space - ma_base[(ad)->datatype]) / \
+ ((MA_AccessIndex)((size_t)((ad)->client_space - ma_base[(ad)->datatype]) / \
ma_sizeof[(ad)->datatype]))
/* compute address of guard from AD */
@@ -601,9 +601,9 @@
(void)printf("unknown");
else
(void)printf("%ld",
- (long)memhandle);
+ (size_t)memhandle);
(void)printf(", address 0x%lx",
- (long)ad);
+ (size_t)ad);
}
/* ------------------------------------------------------------------------- */
@@ -646,11 +646,11 @@
L_client_space = ar->nelem * ma_sizeof[datatype];
- L_gap1 = ((long)B_base
- - (long)B_address
- - (long)sizeof(AD)
- - (long)sizeof(Guard))
- % (long)ma_sizeof[datatype];
+ L_gap1 = ((size_t)B_base
+ - (size_t)B_address
+ - (size_t)sizeof(AD)
+ - (size_t)sizeof(Guard))
+ % (size_t)ma_sizeof[datatype];
if (L_gap1 < 0)
L_gap1 += ma_sizeof[datatype];
@@ -668,8 +668,8 @@
*/
if (ma_numalign > 0) {
- unsigned long mask = (1<<ma_numalign)-1;
- int diff = ((unsigned long) B_client_space) & mask;
+ size_t mask = (1<<ma_numalign)-1;
+ int diff = ((size_t) B_client_space) & mask;
/* Check that the difference is a multiple of the type size.
* If so, then we can shift the client space which is already
@@ -701,11 +701,11 @@
* - address
*/
- L_gap2 = ((long)B_address
- - (long)B_client_space
- - (long)L_client_space
- - (long)sizeof(Guard))
- % (long)ALIGNMENT;
+ L_gap2 = ((size_t)B_address
+ - (size_t)B_client_space
+ - (size_t)L_client_space
+ - (size_t)sizeof(Guard))
+ % (size_t)ALIGNMENT;
if (L_gap2 < 0)
L_gap2 += ALIGNMENT;
@@ -784,8 +784,8 @@
*/
if (ma_numalign > 0) {
- unsigned long mask = (1<<ma_numalign)-1;
- int diff = ((unsigned long) B_client_space) & mask;
+ size_t mask = (1<<ma_numalign)-1;
+ int diff = ((size_t) B_client_space) & mask;
/* Check that the difference is a multiple of the type size.
* If so, then we can shift the client space which is already
@@ -970,9 +970,9 @@
#define NUMADFIELDS 7
char *fn[NUMADFIELDS]; /* field names */
- long fa[NUMADFIELDS]; /* field addresses */
+ size_t fa[NUMADFIELDS]; /* field addresses */
int i; /* loop index */
- long address; /* other addresses */
+ size_t address; /* other addresses */
/* set field names */
fn[0] = "datatype";
@@ -984,13 +984,13 @@
fn[6] = "checksum";
/* set field addresses */
- fa[0] = (long)(&(ad->datatype));
- fa[1] = (long)(&(ad->nelem));
- fa[2] = (long)(&(ad->name));
- fa[3] = (long)(&(ad->client_space));
- fa[4] = (long)(&(ad->nbytes));
- fa[5] = (long)(&(ad->next));
- fa[6] = (long)(&(ad->checksum));
+ fa[0] = (size_t)(&(ad->datatype));
+ fa[1] = (size_t)(&(ad->nelem));
+ fa[2] = (size_t)(&(ad->name));
+ fa[3] = (size_t)(&(ad->client_space));
+ fa[4] = (size_t)(&(ad->nbytes));
+ fa[5] = (size_t)(&(ad->next));
+ fa[6] = (size_t)(&(ad->checksum));
/* print AD fields to stderr */
(void)fprintf(stderr, "debug_ad_print:\n");
@@ -1003,19 +1003,19 @@
fn[i]);
/* print other addresses to stderr */
- address = (long)guard1(ad);
+ address = (size_t)guard1(ad);
(void)fprintf(stderr, "\t0x%lx mod4,8,16=%d,%d,%-2d guard1\n",
address,
address % 4,
address % 8,
address % 16);
- address = (long)ad->client_space;
+ address = (size_t)ad->client_space;
(void)fprintf(stderr, "\t0x%lx mod4,8,16=%d,%d,%-2d client_space\n",
address,
address % 4,
address % 8,
address % 16);
- address = (long)guard2(ad);
+ address = (size_t)guard2(ad);
(void)fprintf(stderr, "\t0x%lx mod4,8,16=%d,%d,%-2d guard2\n",
address,
address % 4,
@@ -1328,11 +1328,11 @@
(void)printf("\ttype of elements:\t\t%s\n",
ma_datatype[ad->datatype]);
(void)printf("\tnumber of elements:\t\t%ld\n",
- (long)ad->nelem);
+ (size_t)ad->nelem);
(void)printf("\taddress of client space:\t0x%lx\n",
- (long)ad->client_space);
+ (size_t)ad->client_space);
(void)printf("\tindex for client space:\t\t%ld\n",
- (long)(client_space_index(ad) + index_base));
+ (size_t)(client_space_index(ad) + index_base));
(void)printf("\ttotal number of bytes:\t\t%lu\n",
ad->nbytes);
}
@@ -1641,7 +1641,7 @@
{
(void)sprintf(ma_ebuf,
"invalid block address (0x%lx) for memhandle %ld",
- (long)ad, (long)memhandle);
+ (size_t)ad, (size_t)memhandle);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1652,7 +1652,7 @@
{
(void)sprintf(ma_ebuf,
"invalid checksum for memhandle %ld (name: '%s')",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1664,7 +1664,7 @@
{
(void)sprintf(ma_ebuf,
"invalid guard(s) for memhandle %ld (name: '%s')",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1676,7 +1676,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not in heap",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1687,7 +1687,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not in stack",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1699,7 +1699,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not in stack",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1709,7 +1709,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not top of stack",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1720,7 +1720,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not in heap or stack",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_External, caller, ma_ebuf);
return MA_FALSE;
}
@@ -1747,7 +1747,7 @@
{
(void)sprintf(ma_ebuf,
"cannot find memhandle for block address 0x%lx",
- (long)ad);
+ (size_t)ad);
ma_error(EL_Nonfatal, ET_Internal, "mh_free", ma_ebuf);
}
else
@@ -1761,14 +1761,14 @@
*/
/* ------------------------------------------------------------------------- */
-private long mai_round(value, unit)
- long value; /* to round */
+private size_t mai_round(value, unit)
+ size_t value; /* to round */
ulongi unit; /* to round to */
{
/* voodoo ... */
unit--;
value += unit;
- value &= ~(long)unit;
+ value &= ~(size_t)unit;
return value;
}
@@ -1825,7 +1825,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Nonfatal, ET_Internal, "MAi_inform_base", ma_ebuf);
return MA_FALSE;
}
@@ -1982,7 +1982,7 @@
{
(void)sprintf(ma_ebuf,
"block '%s', invalid datatype: %ld",
- name, (long)datatype);
+ name, (size_t)datatype);
ma_error(EL_Nonfatal, ET_External, "MA_allocate_heap", ma_ebuf);
return MA_FALSE;
}
@@ -1992,7 +1992,7 @@
{
(void)sprintf(ma_ebuf,
"block '%s', invalid nelem: %ld",
- name, (long)nelem);
+ name, (size_t)nelem);
ma_error(EL_Nonfatal, ET_External, "MA_allocate_heap", ma_ebuf);
return MA_FALSE;
}
@@ -2156,7 +2156,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not on heap used list",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_Internal, "MA_free_heap", ma_ebuf);
return MA_FALSE;
}
@@ -2216,7 +2216,7 @@
{
(void)sprintf(ma_ebuf,
"block '%s', invalid nelem: %ld",
- ad->name, (long)nelem);
+ ad->name, (size_t)nelem);
ma_error(EL_Nonfatal, ET_External, "MA_free_heap_piece", ma_ebuf);
return MA_FALSE;
}
@@ -2228,7 +2228,7 @@
if (ma_trace)
(void)printf("MA: freeing %ld elements of '%s'\n",
- (long)nelem, ad->name);
+ (size_t)nelem, ad->name);
/* set AR for data to keep */
ar.datatype = ad->datatype;
@@ -2327,7 +2327,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_get_mbase", ma_ebuf);
return NULL;
}
@@ -2472,7 +2472,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Nonfatal, ET_External, "MA_init", ma_ebuf);
return MA_FALSE;
}
@@ -2490,7 +2490,7 @@
heap_bytes = (nominal_heap * ma_sizeof[datatype]) +
(DEFAULT_REQUESTS_HEAP * max_block_overhead(datatype));
}
- heap_bytes = (unsigned long)mai_round((long)heap_bytes, (ulongi)ALIGNMENT);
+ heap_bytes = (size_t)mai_round((size_t)heap_bytes, (ulongi)ALIGNMENT);
/* compute # of bytes in stack */
if (nominal_stack < 0)
@@ -2502,7 +2502,7 @@
stack_bytes = (nominal_stack * ma_sizeof[datatype]) +
(DEFAULT_REQUESTS_STACK * max_block_overhead(datatype));
}
- stack_bytes = (unsigned long)mai_round((long)stack_bytes, (ulongi)ALIGNMENT);
+ stack_bytes = (size_t)mai_round((size_t)stack_bytes, (ulongi)ALIGNMENT);
/* segment consists of heap and stack */
total_bytes = heap_bytes + stack_bytes;
@@ -2609,7 +2609,7 @@
public Integer MA_inquire_avail(Integer datatype)
{
- long gap_length; /* # of bytes between heap and stack */
+ size_t gap_length; /* # of bytes between heap and stack */
Integer nelem_gap; /* max elements containable in gap */
#ifdef STATS
@@ -2635,7 +2635,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_avail", ma_ebuf);
return DONTCARE;
}
@@ -2648,7 +2648,7 @@
*/
/* try space between heap and stack */
- gap_length = (long)(ma_sp - ma_hp);
+ gap_length = (size_t)(ma_sp - ma_hp);
if (gap_length > 0)
nelem_gap = ma_nelem(ma_hp, (ulongi)gap_length, datatype);
else
@@ -2673,7 +2673,7 @@
public Integer MA_inquire_heap(Integer datatype)
{
- long gap_length; /* # of bytes between heap and partition */
+ size_t gap_length; /* # of bytes between heap and partition */
Integer nelem_gap; /* max elements containable in gap */
Integer nelem_frag; /* max elements containable in any frag */
@@ -2700,7 +2700,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_heap", ma_ebuf);
return DONTCARE;
}
@@ -2713,7 +2713,7 @@
*/
/* try space between heap and partition */
- gap_length = (long)(ma_partition - ma_hp);
+ gap_length = (size_t)(ma_partition - ma_hp);
if (gap_length > 0)
nelem_gap = ma_nelem(ma_hp, (ulongi)gap_length, datatype);
else
@@ -2744,7 +2744,7 @@
public Integer MA_inquire_heap_check_stack(Integer datatype)
{
- long gap_length; /* # of bytes between heap and partition */
+ size_t gap_length; /* # of bytes between heap and partition */
Integer nelem_gap; /* max elements containable in gap */
Integer nelem_frag; /* max elements containable in any frag */
@@ -2771,7 +2771,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_heap_check_stack", ma_ebuf);
return DONTCARE;
}
@@ -2784,7 +2784,7 @@
*/
/* try space between heap and partition or heap and stack */
- gap_length = min((long)(ma_partition - ma_hp), (long)(ma_sp - ma_hp));
+ gap_length = min((size_t)(ma_partition - ma_hp), (size_t)(ma_sp - ma_hp));
if (gap_length > 0)
nelem_gap = ma_nelem(ma_hp, (ulongi)gap_length, datatype);
else
@@ -2814,7 +2814,7 @@
public Integer MA_inquire_heap_no_partition(Integer datatype)
{
- long gap_length; /* # of bytes between heap and partition */
+ size_t gap_length; /* # of bytes between heap and partition */
Integer nelem_gap; /* max elements containable in gap */
Integer nelem_frag; /* max elements containable in any frag */
@@ -2841,7 +2841,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_heap_no_partition", ma_ebuf);
return DONTCARE;
}
@@ -2854,7 +2854,7 @@
*/
/* try space between heap and stack */
- gap_length = (long)(ma_sp - ma_hp);
+ gap_length = (size_t)(ma_sp - ma_hp);
if (gap_length > 0)
nelem_gap = ma_nelem(ma_hp, (ulongi)gap_length, datatype);
else
@@ -2882,7 +2882,7 @@
public Integer MA_inquire_stack(Integer datatype)
{
- long gap_length; /* # of bytes between partition and stack */
+ size_t gap_length; /* # of bytes between partition and stack */
Integer nelem_gap; /* max elements containable in gap */
#ifdef STATS
@@ -2908,7 +2908,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_stack", ma_ebuf);
return DONTCARE;
}
@@ -2921,7 +2921,7 @@
*/
/* try space between partition and stack */
- gap_length = (long)(ma_sp - ma_partition);
+ gap_length = (size_t)(ma_sp - ma_partition);
if (gap_length > 0)
nelem_gap = ma_nelem(ma_partition, (ulongi)gap_length, datatype);
else
@@ -2949,7 +2949,7 @@
public Integer MA_inquire_stack_check_heap(Integer datatype)
{
- long gap_length; /* # of bytes between partition and stack */
+ size_t gap_length; /* # of bytes between partition and stack */
Integer nelem_gap; /* max elements containable in gap */
#ifdef STATS
@@ -2975,7 +2975,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_stack_check_heap", ma_ebuf);
return DONTCARE;
}
@@ -2988,7 +2988,7 @@
*/
/* try space between partition and stack or heap and stack */
- gap_length = min((long)(ma_sp - ma_partition), (long)(ma_sp - ma_hp));
+ gap_length = min((size_t)(ma_sp - ma_partition), (size_t)(ma_sp - ma_hp));
if (gap_length > 0)
nelem_gap = ma_nelem(ma_partition, (ulongi)gap_length, datatype);
else
@@ -3018,7 +3018,7 @@
public Integer MA_inquire_stack_no_partition(Integer datatype)
{
- long gap_length; /* # of bytes between heap and partition */
+ size_t gap_length; /* # of bytes between heap and partition */
Integer nelem_gap; /* max elements containable in gap */
#ifdef STATS
@@ -3044,7 +3044,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_inquire_stack_no_partition", ma_ebuf);
return DONTCARE;
}
@@ -3057,7 +3057,7 @@
*/
/* try space between heap and stack */
- gap_length = (long)(ma_sp - ma_hp);
+ gap_length = (size_t)(ma_sp - ma_hp);
if (gap_length > 0)
nelem_gap = ma_nelem(ma_hp, (ulongi)gap_length, datatype);
else
@@ -3101,7 +3101,7 @@
{
(void)sprintf(ma_ebuf,
"memhandle %ld (name: '%s') not on stack used list",
- (long)memhandle, ad->name);
+ (size_t)memhandle, ad->name);
ma_error(EL_Nonfatal, ET_Internal, "MA_pop_stack", ma_ebuf);
return MA_FALSE;
}
@@ -3255,7 +3255,7 @@
{
(void)sprintf(ma_ebuf,
"block '%s', invalid datatype: %ld",
- name, (long)datatype);
+ name, (size_t)datatype);
ma_error(EL_Nonfatal, ET_External, "MA_push_stack", ma_ebuf);
return MA_FALSE;
}
@@ -3265,7 +3265,7 @@
{
(void)sprintf(ma_ebuf,
"block '%s', invalid nelem: %ld",
- name, (long)nelem);
+ name, (size_t)nelem);
ma_error(EL_Nonfatal, ET_External, "MA_push_stack", ma_ebuf);
return MA_FALSE;
}
@@ -3411,7 +3411,7 @@
{
(void)sprintf(ma_ebuf,
"invalid alignment: %ld",
- (long)value);
+ (size_t)value);
ma_error(EL_Nonfatal, ET_External, "MA_set_numalign", ma_ebuf);
return MA_FALSE;
}
@@ -3451,7 +3451,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype1);
+ (size_t)datatype1);
ma_error(EL_Fatal, ET_External, "MA_sizeof", ma_ebuf);
return DONTCARE;
}
@@ -3461,7 +3461,7 @@
{
(void)sprintf(ma_ebuf,
"invalid nelem: %ld",
- (long)nelem1);
+ (size_t)nelem1);
ma_error(EL_Fatal, ET_External, "MA_sizeof", ma_ebuf);
return DONTCARE;
}
@@ -3471,7 +3471,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype2);
+ (size_t)datatype2);
ma_error(EL_Fatal, ET_External, "MA_sizeof", ma_ebuf);
return DONTCARE;
}
@@ -3520,7 +3520,7 @@
{
(void)sprintf(ma_ebuf,
"invalid datatype: %ld",
- (long)datatype);
+ (size_t)datatype);
ma_error(EL_Fatal, ET_External, "MA_sizeof_overhead", ma_ebuf);
return DONTCARE;
}
--- ga-5.7.2/ma/memcpy.h.org 2020-02-28 11:39:16.000000000 -0800
+++ ga-5.7.2/ma/memcpy.h 2020-06-26 17:02:36.464960502 -0700
@@ -22,7 +22,7 @@
**/
/* allocate bytes */
-#define bytealloc(nbytes) malloc((unsigned long)(nbytes))
+#define bytealloc(nbytes) malloc((size_t)(nbytes))
/* deallocate bytes */
#define bytefree(pointer) (void)free((char *)(pointer))
--- $1/tcgmsg/tcgmsg-mpi/nxtval-armci.c.org 2020-06-08 16:56:58.610007026 -0700
+++ $1/tcgmsg/tcgmsg-mpi/nxtval-armci.c 2020-06-08 16:57:05.114032467 -0700
@@ -66,12 +66,17 @@
if (*mproc > 0) {
#if SIZEOF_F77_INTEGER == SIZEOF_INT
int op = ARMCI_FETCH_AND_ADD;
+ rc = ARMCI_Rmw(op,(void*)&local,(void*)pnxtval_counter,1,server);
#elif SIZEOF_F77_INTEGER == SIZEOF_LONG
+ rc = ARMCI_Rmw(op,(void*)&local,(void*)pnxtval_counter,1,server);
int op = ARMCI_FETCH_AND_ADD_LONG;
#else
+#ifdef WIN64
+#else
+ Error("nxtval: not implemented",0);
# error
#endif
- rc = ARMCI_Rmw(op,(void*)&local,(void*)pnxtval_counter,1,server);
+#endif
}
} else {
/* Not running in parallel ... just do a simulation */
EOF
patch -p0 < win64_ma_nxtval.patch

View file

@ -1,64 +0,0 @@
#!/usr/bin/env bash
rm -f mpipr-too-many.patch
cat > mpipr-too-many.patch <<EOF
--- $1/comex/src-mpi-pr/comex.c.org 2023-07-12 19:10:15.711084258 -0700
+++ $1/comex/src-mpi-pr/comex.c 2023-07-12 19:10:21.851117110 -0700
@@ -51,7 +51,7 @@
#define XSTR(x) #x
#define STR(x) XSTR(x)
-
+#define MIN(a, b) (((b) < (a)) ? (b) : (a))
/* data structures */
typedef enum {
@@ -358,6 +358,8 @@
static int devshm_initialized = 0;
static long devshm_fs_left = 0;
static long devshm_fs_initial = 0;
+static long counter_open_fds = 0;
+STATIC void count_open_fds(void);
int comex_init()
{
@@ -4746,6 +4748,7 @@
/* set the size of my shared memory object */
check_devshm(fd, size);
+ count_open_fds();
retval = ftruncate(fd, size);
if (-1 == retval) {
perror("_shm_create: ftruncate");
@@ -7248,3 +7251,29 @@
#endif
#endif
}
+
+STATIC void count_open_fds(void) {
+#ifdef __linux__
+ /* check only every 100 ops && rank == 1 */
+ counter_open_fds += 1;
+ if (counter_open_fds % 100 == 0 && g_state.rank == MIN(1,g_state.node_size)) {
+ FILE *f = fopen("/proc/sys/fs/file-nr", "r");
+
+ long nfiles, unused, maxfiles;
+ fscanf(f, "%ld %ld %ld", &nfiles, &unused, &maxfiles);
+#ifdef DEBUGSHM
+ if(nfiles % 1000 == 0) fprintf(stderr," %d: no. open files = %ld maxfiles = %ld\n", g_state.rank, nfiles, maxfiles);
+#endif
+ if(nfiles > (maxfiles/100)*80) {
+ printf(" %d: running out of files; files = %ld maxfiles = %ld \n", g_state.rank, nfiles, maxfiles);
+#if PAUSE_ON_ERROR
+ fprintf(stderr,"%d(%d): too many open files\n",
+ g_state.rank, getpid());
+ pause();
+#endif
+ comex_error("count_open_fds: too many open files", -1);
+ }
+ fclose(f);
+ }
+#endif
+}
EOF
patch -p0 -s -N < ./mpipr-too-many.patch
echo mpipr-too-many.patch applied

View file

@ -1,28 +0,0 @@
#!/usr/bin/env bash
rm -f comex_configure.patch
cat > comex_configure.patch <<EOF
--- $1/comex/configure.orig 2020-06-04 11:16:29.506196033 -0700
+++ $1/comex/configure 2020-06-04 11:19:01.610898545 -0700
@@ -7501,11 +7501,19 @@
#ifdef __cplusplus
extern "C"
#endif
+#ifdef WIN32
+char __stdcall MPI_Finalize ();
+#else
char MPI_Init ();
+#endif
int
main ()
{
+#ifdef WIN32
+return MPI_Finalize ();
+#else
return MPI_Init ();
+#endif
;
return 0;
}
EOF
patch -p0 < comex_configure.patch

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
rm -f nodelist.patch
cat > nodelist.patch <<EOF
--- $1/comex/src-armci/armci.c
+++ $1/comex/src-armci/armci.c
@@ -91,6 +91,7 @@ void armci_init_domains(MPI_Comm comm)
nodelist[i] = _my_node_id*_number_of_procs_per_node+i;
comex_group_create(_number_of_procs_per_node, nodelist,
COMEX_GROUP_WORLD, &ARMCI_Node_group);
+ free(nodelist);
}
}
EOF
patch -p0 -s -N < nodelist.patch
echo nodelist.patch applied

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
rm -f nompif.patch
cat > nompif.patch <<EOF
--- $1/global/src/scalapack.F
+++ $1/global/src/scalapack.F
@@ -3605,7 +3605,7 @@ c broadcast evals
#endif
#endif
implicit none
-#include "mpif.h"
+c#include "mpif.h"
#include "mafdecls.fh"
#include "global.fh"
#include "scalapack.fh"
EOF
patch -p0 -s -N < nompif.patch
echo nompif.patch applied

View file

@ -1,22 +0,0 @@
#!/usr/bin/env bash
rm -f peigstubs.patch
cat > peigstubs.patch <<EOF
--- $1/global/src/peigstubs.c
+++ $1/global/src/peigstubs.c
@@ -11,9 +11,9 @@
# define gai_diag_ F77_FUNC_(gai_diag,GAI_DIAG)
# define gai_diag_std_ F77_FUNC_(gai_diag_std,GAI_DIAG_STD)
# define gai_diag_reuse_ F77_FUNC_(gai_diag_reuse,GAI_DIAG_REUSE)
-extern gai_diag_(Integer*,Integer*,Integer*,DoublePrecision*);
-extern gai_diag_std_(Integer*,Integer*,DoublePrecision*);
-extern gai_diag_reuse_(Integer*,Integer*,Integer*,Integer*,DoublePrecision*);
+extern void gai_diag_(Integer*,Integer*,Integer*,DoublePrecision*);
+extern void gai_diag_std_(Integer*,Integer*,DoublePrecision*);
+extern void gai_diag_reuse_(Integer*,Integer*,Integer*,Integer*,DoublePrecision*);
# else
# endif
#else
EOF
patch -p0 -s -N < peigstubs.patch
echo strdup.patch applied

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
rm -f ptstride.patch
cat > ptstride.patch <<EOF
--- $1/comex/src-mpi-pt/comex.c
+++ $1/comex/src-mpi-pt/comex.c
@@ -2432,7 +2432,7 @@ STATIC void _put_packed_handler(header_t *header, int proc)
unpack(packed_buffer, mapped_offset,
stride->stride, stride->count, stride->stride_levels);
-
+ free(stride);
if ((unsigned)header->length > COMEX_STATIC_BUFFER_SIZE) {
free(packed_buffer);
}
EOF
patch -p0 -s -N < ptstride.patch
echo ptstride.patch applied

View file

@ -1,75 +0,0 @@
#!/usr/bin/env bash
rm -f scalapacki4.patch
cat > scalapacki4.patch <<EOF
--- $1/global/src/scalapack.F.org 2023-10-26 16:35:47.951995538 -0700
+++ $1/global/src/scalapack.F 2023-10-26 16:36:44.840284758 -0700
@@ -1076,13 +1076,12 @@
c****
character*1 uplo ! (input) 'U' or 'L'
integer g_A ! (input/output)
- logical status
integer dimA1, dimA2, typeA
integer me, nproc
integer n
integer i, j, hBUF
+ integer j0,j1,i0,i1
MA_ACCESS_INDEX_TYPE adrBUF
-
c**** Check Environment
nproc = ga_nnodes()
me = ga_nodeid()
@@ -1101,27 +1100,38 @@
n = dimA1
c**** Allocate BUF
- status = ma_push_get(MT_DBL, n, 'BUF', hBUF, adrBUF)
- if (.not.status)
+ if(.not.ma_push_get(MT_DBL, n, 'BUF', hBUF, adrBUF))
& call ga_error(' ga_zeroUL: mem alloc failed BUF ', -1)
+ do i=0,n-1
+ dbl_mb(adrBUF+i)=0d0
+ enddo
call ga_sync()
- do i = me+1, n, nproc
- call ga_get(g_A, 1, n, i, i, dbl_mb(adrBUF), n)
+ i0=me+1
+ i1=n
+ if (uplo.eq.'L') then
+ i0=me+2
+ elseif (uplo.eq.'U') then
+ i1=n-1
+ else
+ call ga_error('ga_symUL: uplo must be L or U ', 1)
+ endif
+ do i = i0, i1, nproc
if (uplo.eq.'L') then
-c**** case L: make zero the upper triangle
- call dcopy(i-1,0.0d0,0, dbl_mb(adrBUF),1)
+c**** case L: make zero the upper triangle
+ j0=1
+ j1=i-1
elseif (uplo.eq.'U') then
-c**** case U: make zero the lower triangle
- call dcopy(n-i,0.0d0,0, dbl_mb(adrBUF+i),1)
- else
- call ga_error('ga_symUL: uplo must be L or U ', 1)
+c**** case U: make zero the lower triangle
+ j0=i+1
+ j1=n
endif
- call ga_put(g_A, 1, n, i, i, dbl_mb(adrBUF), n)
- end do !i
+ call ga_put(g_a, j0, j1, i, i, dbl_mb(adrBUF), n)
+ end do !i
c
- status = ma_pop_stack(hBUF)
+ if(.not.ma_pop_stack(hBUF)) call
+ c ga_error(' ga_zeroUL: pop_stack failed ',-1)
call ga_sync()
end
EOF
patch -p0 -s -N < ./scalapacki4.patch
echo scalapacki4.patch applied

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
rm -f strdup.patch
cat > strdup.patch <<EOF
--- $1/tcgmsg/fapi.c
+++ $1/tcgmsg/fapi.c
@@ -200,6 +200,7 @@ void FATR _PBEGINF_()
argv[argc] = 0;
tcgi_pbegin(argc, argv);
+ for (i=0; i<argc; i++) free(argv[i]);
free(argv);
}
EOF
patch -p0 -s -N < strdup.patch
echo strdup.patch applied