bytes = LX*LY*LZ*T*4*sizeof(su3);
bytes = (off_t)(LX*LY*LZ*T*4*sizeof(su3));
int write_lime_gauge_field(char * filename, const double plaq, const int counter){  FILE * ofs;  LimeWriter * limewriter;  LimeRecordHeader * limeheader;  /* Message end and Message begin flag */  int ME_flag=0, MB_flag=0, status=0;  int t=0, x=0, y=0, z=0;  char message[100];  off_t bytes;#ifdef LITTLE_ENDIAN  su3 tmp[4];#endif  sprintf(message,"plaquette = %e\n trajectory nr = %d", plaq, counter);  bytes = strlen( message );  ofs = fopen(filename, "w");  if(ofs == (FILE*)NULL) {    fprintf(stderr, "Could not open file %s for writing!\n Aboring...\n", filename);    exit(500);  }  limewriter = limeCreateWriter( ofs );  if(limewriter == (LimeWriter*)NULL) {    fprintf(stderr, "LIME error in file %s for writing!\n Aboring...\n", filename);    exit(500);  }  write_ildg_format_xml("temp.xml", limewriter);  limeheader = limeCreateHeader(MB_flag, ME_flag, "xlf-info", bytes);  status = limeWriteRecordHeader( limeheader, limewriter);  if(status < 0 ) {    fprintf(stderr, "LIME write header error %d\n", status);    exit(500);  }  limeDestroyHeader( limeheader );  limeWriteRecordData(message, &bytes, limewriter);  bytes = LX*LY*LZ*T*4*sizeof(su3);  MB_flag=0; ME_flag=1;  limeheader = limeCreateHeader(MB_flag, ME_flag, "ildg-binary-data", bytes);  status = limeWriteRecordHeader( limeheader, limewriter);  if(status < 0 ) {    fprintf(stderr, "LIME write header error %d\n", status);    exit(500);  }  limeDestroyHeader( limeheader );  bytes = sizeof(su3);  for(t = 0; t < T; t++){    for(z = 0; z < LZ; z++){      for(y = 0; y < LY; y++){	for(x = 0; x < LX; x++){#ifdef LITTLE_ENDIAN	  byte_swap_assign(tmp, g_gauge_field[ g_ipt[t][x][y][z] ], 4*sizeof(su3)/8); 	  status = limeWriteRecordData((void*)&tmp[1], &bytes, limewriter);	  status = limeWriteRecordData((void*)&tmp[2], &bytes, limewriter);	  status = limeWriteRecordData((void*)&tmp[3], &bytes, limewriter);	  status = limeWriteRecordData((void*)&tmp[0], &bytes, limewriter);#else	  status = limeWriteRecordData((void*)&g_gauge_field[ g_ipt[t][x][y][z] ][1], &bytes, limewriter);	  status = limeWriteRecordData((void*)&g_gauge_field[ g_ipt[t][x][y][z] ][2], &bytes, limewriter);	  status = limeWriteRecordData((void*)&g_gauge_field[ g_ipt[t][x][y][z] ][3], &bytes, limewriter);	  status = limeWriteRecordData((void*)&g_gauge_field[ g_ipt[t][x][y][z] ][0], &bytes, limewriter);#endif	  if(status < 0 ) {	    fprintf(stderr, "LIME write error %d\n", status);	    exit(500);	  }	}      }    }  }  limeDestroyWriter( limewriter );  fclose(ofs);  return(0);}