int main(int argc, char **argv) { /* int heap=300000, stack=300000; */ int me, nprocs; /* Step1: Initialize Message Passing library */ armci_msg_init(&argc, &argv); /* Step2: Initialize ARMCI */ ARMCI_Init(); /* Step3: Initialize Memory Allocator (MA) */ /*bjp if(! MA_init(C_DBL, stack, heap) ) ARMCI_Error("MA_init failed",stack+heap); */ me = armci_msg_me(); nprocs = armci_msg_nproc(); if(me==0) { printf("\nUsing %d processes\n\n", nprocs); fflush(stdout); } TRANSPOSE1D(); if(me==0)printf("\nTerminating ..\n"); ARMCI_Finalize(); armci_msg_finalize(); return(0); }
int main(int argc, char **argv) { int heap=300000, stack=300000; int me, nprocs, i; double start, end; /* Initialize Message Passing library */ MPI_Init(&argc, &argv); /* Initialize GA */ GA_Initialize(); /* Initialize Memory Allocator (MA) */ if(! MA_init(C_DBL, stack, heap) ) GA_Error("MA_init failed",stack+heap); me = GA_Nodeid(); nprocs = GA_Nnodes(); if(me==0) { printf("\nUsing %d processes\n\n", nprocs); fflush(stdout); } start = MPI_Wtime(); for(i =0; i< 1000; i++) { TRANSPOSE1D(); } end = MPI_Wtime(); if(me==0) printf(" Time=%2.5e secs\n\n",end-start); if(me==0)printf("\nTerminating ..\n"); GA_Terminate(); MPI_Finalize(); }
int main(int argc, char **argv) { int heap=300000, stack=300000; int me, nprocs; /* Step1: Initialize Message Passing library */ #ifdef MPI MPI_Init(&argc, &argv); /* initialize MPI */ #else PBEGIN_(argc, argv); /* initialize TCGMSG */ #endif /* Step2: Initialize GA */ /* ### intialize the GA library */ GA_Initialize(); /* Step3: Initialize Memory Allocator (MA) */ if(! MA_init(C_DBL, stack, heap) ) GA_Error("MA_init failed",stack+heap); /* ### assign the local processor ID to the int variable "me" * ### and the total number of processors to the int variable * ### "nprocs" */ me = GA_Nodeid(); nprocs = GA_Nnodes(); if(me==0) { printf("\nUsing %d processes\n\n", nprocs); fflush(stdout); } TRANSPOSE1D(); if(me==0)printf("\nTerminating ..\n"); /* ### terminate the GA library */ GA_Terminate(); #ifdef MPI MPI_Finalize(); #else PEND_(); #endif }