/* _test_int_allfunc.c: a test case that includes all the functions implemented in MuPC. (X) Date created : October 23, 2002 Date modified: November 4, 2002 Function tested: All functions. Description: - This program incorporates all the functions currently implemented in MuPC. - This is not an application program, but simply a test program that tries to make use of all functions and generate lots of communications between threads. This test case is an extension of test_alltype.c. - Thread 0 allocates memory for 6 arrays of diff data types using upc_local_alloc. - Thread 0 initializes the contents of the 6 arrays with upc_memset. This is not necessary, but we incorporate it anyway. - Thread 0 fills in the 6 arrays with some values. - Each thread copies the contents of the 6 arrays from thread 0 into its own. Platform Tested No. Proc Date Tested Success UPC0 2,4 November 4, 2002 Yes CSE0 2,4,8,16 November 9, 2002 No CSE0 2 November 16, 2002 No LION 2 November 19, 2002 No UPC0 2 December 3, 2002 No Bugs Found: [11/09/2002] On cse0, Test case failed for n=2,4,8,16. Since test_int_alltype.c failed, this test case would probably failed too since it builds upon test_int_alltype.c Error: test_int_allfunc.c failed! [th=2, error=1] [11/16/2002] Previous bug has not been fixed. [11/19/2002] On lionel, test case failed for n=2. Error message as follows: MPI process rank 0 (n0, p29427) caught a SIGSEGV in MPI_Isend. [12/03/2002] On upc0, test case failed for n=2, S=3.2K. Problem might lie in the upc_memput function. */ #include #include //#define VERBOSE0 #define SIZE 3200 #ifdef sgi /* IRIX linker has a predefined symbol called fdata */ #define fdata fdata_uniqname #endif upc_lock_t *lock_1; upc_lock_t *shared lock_2; shared int *totalCopy; shared int *shared totalCopy2; shared [] char *shared cdata[THREADS]; shared [] short *shared sdata[THREADS]; shared [] long *shared ldata[THREADS]; shared [] int *shared idata[THREADS]; shared [] float *shared fdata[THREADS]; shared [] double *shared ddata[THREADS]; shared int err[THREADS]; char lcdata[SIZE]; /* Local char array */ short lsdata[SIZE]; /* Local short array */ long lldata[SIZE]; /* Local long array */ int lidata[SIZE]; /* Local integer array */ float lfdata[SIZE]; /* Local float array */ double lddata[SIZE]; /* Local double array */ int main (void) { int i, j, temp, error=0, check=0; err[MYTHREAD] = 0; /* Lock allocation and initialization */ lock_1 = upc_all_lock_alloc (); #if 0 upc_lock_init(lock_1); #endif /* Huge allocation of memory, and initialization */ totalCopy = upc_all_alloc (SIZE, sizeof(int)); #if 0 /* DOB: this is completely broken */ upc_memset (totalCopy, 0, SIZE*sizeof(int)); #endif upc_memset(totalCopy+MYTHREAD, 0, upc_affinitysize(SIZE*sizeof(int), sizeof(int), MYTHREAD)); if (MYTHREAD == 0) { int i; /* Allocate 2nd lock non-collectively */ lock_2 = upc_global_lock_alloc(); #if 0 upc_lock_init(lock_2); #endif /* Allocate shared memory non-collectively */ totalCopy2 = upc_global_alloc(SIZE, sizeof(int)); #if 0 /* DOB: also completely broken */ upc_memset (totalCopy2, 0, SIZE*sizeof(int)); #endif for (i=0;i