"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gpshmem.c" between
NetPIPE_4.x.tar.gz and NetPIPE-3.7.2.tar.gz

About: NetPIPE - a Network Protocol Independent Performance Evaluator

gpshmem.c  (NetPIPE_4.x):gpshmem.c  (NetPIPE-3.7.2)
skipping to change at line 54 skipping to change at line 54
void PrepareToReceive(ArgStruct *p) { } void PrepareToReceive(ArgStruct *p) { }
void SendData(ArgStruct *p) void SendData(ArgStruct *p)
{ {
if(p->bufflen%4==0) if(p->bufflen%4==0)
gpshmem_put32((short*)p->buff,(short*)p->buff,p->bufflen/4,p->prot.nbor); gpshmem_put32((short*)p->buff,(short*)p->buff,p->bufflen/4,p->prot.nbor);
else else
gpshmem_putmem(p->buff,p->buff,p->bufflen,p->prot.nbor); gpshmem_putmem(p->buff,p->buff,p->bufflen,p->prot.nbor);
} }
/* DDT - I have not tested the CPU workload measurement for GPSHMEM */
int TestForCompletion(ArgStruct *p)
{
if( p->r_ptr[p->bufflen-1] == (p->tr ? p->expected+1 : p->expected-1) ) {
return 1;
} else return 0;
}
void RecvData(ArgStruct *p) void RecvData(ArgStruct *p)
{ {
int i=0; int i=0;
while( p->r_ptr[p->bufflen-1] != (p->tr ? p->expected+1 : p->expected-1) ) { while( p->buff[p->bufflen-1] != 'b'+p->prot.ipe ) {
if( ++i%10000000==0 ) printf(""); if( ++i%10000000==0 ) printf("");
} }
/* p->buff[p->bufflen-1] = 'b' + p->prot.nbor; */ p->buff[p->bufflen-1] = 'b' + p->prot.nbor;
} }
void SendTime(ArgStruct *p, double *t) void SendTime(ArgStruct *p, double *t)
{ {
*pTime=*t; *pTime=*t;
gpshmem_putmem(pTime,pTime,sizeof(double),p->prot.nbor); gpshmem_putmem(pTime,pTime,sizeof(double),p->prot.nbor);
gpshmem_putmem(p->prot.flag,p->prot.flag,sizeof(int),p->prot.nbor); gpshmem_putmem(p->prot.flag,p->prot.flag,sizeof(int),p->prot.nbor);
} }
skipping to change at line 130 skipping to change at line 121
void CleanUp(ArgStruct *p) void CleanUp(ArgStruct *p)
{ {
gpshmem_finalize(); gpshmem_finalize();
} }
void Reset(ArgStruct *p) void Reset(ArgStruct *p)
{ {
} }
void MyMalloc(ArgStruct *p, int bufflen) void MyMalloc(ArgStruct *p, int bufflen, int soffset, int roffset)
{ {
if((p->buff=(char *)gpshmalloc(bufflen+MAX(p->soffset,p->roffset)))==(char *) NULL) if((p->buff=(char *)gpshmalloc(bufflen+MAX(soffset,roffset)))==(char *)NULL)
{ {
fprintf(stderr,"couldn't allocate memory\n"); fprintf(stderr,"couldn't allocate memory\n");
exit(-1); exit(-1);
} }
p->buff[bufflen-1]='b'+p->tr; p->buff[bufflen-1]='b'+p->tr;
if((p->buff1=(char *)gpshmalloc(bufflen+p->soffset))==(char *)NULL) if((p->buff1=(char *)gpshmalloc(bufflen+soffset))==(char *)NULL)
{ {
fprintf(stderr,"Couldn't allocate memory\n"); fprintf(stderr,"Couldn't allocate memory\n");
exit(-1); exit(-1);
} }
return 0; return 0;
} }
void FreeBuff(char *buff1, char* buff2) void FreeBuff(char *buff1, char* buff2)
{ {
gpshfree(buff1); gpshfree(buff1);
gpshfree(buff2); gpshfree(buff2);
 End of changes. 6 change blocks. 
14 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS