PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
papi_1.c File Reference
Include dependency graph for papi_1.c:

Go to the source code of this file.

Macros

#define MAX_COUNTERS   256
 
#define NUMBER_COUNTERS_PER_ROW   8
 

Functions

void Do_Tests (void)
 
void Do_Low_Level_Tests (void)
 
void Do_High_Level_Tests (void)
 
void Do_Multiplex_Tests (void)
 
void Run_Cycle (const int pNumEvents)
 
void Zero_Local_Counters (long long *pCounters)
 
void FPUArith (void)
 
void List_PAPI_Events (const int pEventSet, int *pEvents, int *xNumEvents)
 
void Print_Native_Counters ()
 
void Print_Native_Counters_via_Buffer (const BGP_UPC_Read_Counters_Struct_t *pBuffer)
 
void Print_Native_Counters_for_PAPI_Counters (const int pEventSet)
 
void Print_Native_Counters_for_PAPI_Counters_From_List (const int *pEvents, const int pNumEvents)
 
void Print_PAPI_Counters (const int pEventSet, const long long *pCounters)
 
void Print_PAPI_Counters_From_List (const int *pEventList, const int pNumEvents, const long long *pCounters)
 
void Print_Counters (const int pEventSet)
 
void Print_Node_Info (void)
 
void Read_Native_Counters (const int pLength)
 
void Print_PAPI_Events (const int pEventSet)
 
void Print_Counter_Values (const long long *pCounters, const int pNumCounters)
 
void DumpInHex (const char *pBuffer, int pSize)
 
int main (int argc, char *argv[])
 

Variables

int PAPI_Events [MAX_COUNTERS]
 
long long PAPI_Counters [MAX_COUNTERS]
 
char Native_Buffer [BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
 
double x[32] ALIGN_L3_CACHE
 
const int NumEventsPerSet = MAX_COUNTERS
 
const int MaxPresetEventId = 104
 
const int MaxNativeEventId = 511
 

Macro Definition Documentation

#define MAX_COUNTERS   256

Definition at line 65 of file papi_1.c.

#define NUMBER_COUNTERS_PER_ROW   8

Definition at line 66 of file papi_1.c.

Function Documentation

void Do_High_Level_Tests ( void  )

Definition at line 1118 of file papi_1.c.

1118  {
1119  uint xEventId, xEventCode;
1120  int xRC, xNumEvents;
1121 
1122  printf("==> Do_High_Level_Tests(): Beginning of the main body...\n");
1123 
1124  xRC = PAPI_num_counters();
1125  if (xRC == 256)
1126  printf("SUCCESS: PAPI_num_counters returned 256 hardware counters...\n");
1127  else
1128  printf("FAILURE: PAPI_num_counters failed, returned xRC=%d...\n", xRC);
1129 
1130  xRC = PAPI_num_components();
1131  if (xRC == 1)
1132  printf("SUCCESS: PAPI_num_components returned 256 hardware counters...\n");
1133  else
1134  printf("FAILURE: PAPI_num_components failed, returned xRC=%d...\n", xRC);
1135 
1136  xEventId = 0;
1137  while (xEventId < MaxPresetEventId) {
1138  xNumEvents = 0;
1139  while (xEventId <= MaxPresetEventId && xNumEvents < NumEventsPerSet) {
1140  xEventCode = xEventId | 0x80000000;
1141  xRC = PAPI_query_event(xEventCode);
1142  if (xRC == PAPI_OK) {
1143  switch(xEventCode) {
1144  case 0x80000003:
1145  case 0x80000004:
1146  case 0x80000005:
1147  case 0x80000007:
1148  case 0x80000008:
1149  case 0x8000000A:
1150  case 0x8000000B:
1151  case 0x8000000C:
1152  case 0x8000000D:
1153  case 0x8000000F:
1154  case 0x80000010:
1155  case 0x80000011:
1156  case 0x80000012:
1157  case 0x80000013:
1158  case 0x80000014:
1159  case 0x80000015:
1160  case 0x80000016:
1161  case 0x80000017:
1162  case 0x80000018:
1163  case 0x80000019:
1164  case 0x8000001A:
1165  case 0x8000001B:
1166  case 0x8000001D:
1167  case 0x8000001E:
1168  case 0x8000001F:
1169  case 0x80000020:
1170  case 0x80000021:
1171  case 0x80000022:
1172  case 0x80000023:
1173  case 0x80000024:
1174  case 0x80000025:
1175  case 0x80000026:
1176  case 0x80000027:
1177  case 0x80000028:
1178  case 0x80000029:
1179  case 0x8000002A:
1180  case 0x8000002B:
1181  case 0x8000002C:
1182  case 0x8000002D:
1183  case 0x8000002E:
1184  case 0x8000002F:
1185  case 0x80000031:
1186  case 0x80000032:
1187  case 0x80000033:
1188  case 0x80000037:
1189  case 0x80000038:
1190  case 0x80000039:
1191  case 0x8000003A:
1192  case 0x8000003D:
1193  case 0x80000042:
1194  case 0x80000045:
1195  case 0x80000046:
1196  case 0x80000048:
1197  case 0x8000004A:
1198  case 0x8000004B:
1199  case 0x8000004D:
1200  case 0x8000004E:
1201  case 0x80000050:
1202  case 0x80000051:
1203  case 0x80000053:
1204  case 0x80000054:
1205  case 0x80000056:
1206  case 0x80000057:
1207  case 0x80000059:
1208  case 0x8000005c:
1209  case 0x8000005f:
1210  case 0x80000061:
1211  case 0x80000062:
1212  case 0x80000063:
1213  case 0x80000064:
1214  case 0x80000065:
1215  printf("FAILURE: Do_High_Level_Tests, preset event code %#8.8x added to list of events to be started, but should not be allowed...\n", xEventCode);
1216  break;
1217  default:
1218  printf("SUCCESS: Do_High_Level_Tests, preset event code %#8.8x added to list of events to be started...\n", xEventCode);
1219  }
1220  PAPI_Events[xNumEvents] = xEventCode;
1221  xNumEvents++;
1222  }
1223  else {
1224  switch(xEventCode) {
1225  case 0x80000003:
1226  case 0x80000004:
1227  case 0x80000005:
1228  case 0x80000007:
1229  case 0x80000008:
1230  case 0x8000000A:
1231  case 0x8000000B:
1232  case 0x8000000C:
1233  case 0x8000000D:
1234  case 0x8000000F:
1235  case 0x80000010:
1236  case 0x80000011:
1237  case 0x80000012:
1238  case 0x80000013:
1239  case 0x80000014:
1240  case 0x80000015:
1241  case 0x80000016:
1242  case 0x80000017:
1243  case 0x80000018:
1244  case 0x80000019:
1245  case 0x8000001A:
1246  case 0x8000001B:
1247  case 0x8000001D:
1248  case 0x8000001E:
1249  case 0x8000001F:
1250  case 0x80000020:
1251  case 0x80000021:
1252  case 0x80000022:
1253  case 0x80000023:
1254  case 0x80000024:
1255  case 0x80000025:
1256  case 0x80000026:
1257  case 0x80000027:
1258  case 0x80000028:
1259  case 0x80000029:
1260  case 0x8000002A:
1261  case 0x8000002B:
1262  case 0x8000002C:
1263  case 0x8000002D:
1264  case 0x8000002E:
1265  case 0x8000002F:
1266  case 0x80000031:
1267  case 0x80000032:
1268  case 0x80000033:
1269  case 0x80000037:
1270  case 0x80000038:
1271  case 0x80000039:
1272  case 0x8000003A:
1273  case 0x8000003D:
1274  case 0x80000042:
1275  case 0x80000045:
1276  case 0x80000046:
1277  case 0x80000048:
1278  case 0x8000004A:
1279  case 0x8000004B:
1280  case 0x8000004D:
1281  case 0x8000004E:
1282  case 0x80000050:
1283  case 0x80000051:
1284  case 0x80000053:
1285  case 0x80000054:
1286  case 0x80000056:
1287  case 0x80000057:
1288  case 0x80000059:
1289  case 0x8000005c:
1290  case 0x8000005f:
1291  case 0x80000061:
1292  case 0x80000062:
1293  case 0x80000063:
1294  case 0x80000064:
1295  case 0x80000065:
1296  printf("SUCCESS: Do_High_Level_Tests, preset event code %#8.8x cannot be added to list of events to be started, xRC = %d...\n", xEventCode, xRC);
1297  break;
1298  default:
1299  printf("FAILURE: Do_High_Level_Tests, preset event code %#8.8x cannot be added to list of events to be started, xRC = %d...\n", xEventCode, xRC);
1300  }
1301  }
1302  xEventId++;
1303  }
1304  if (xNumEvents)
1305  Run_Cycle(xNumEvents);
1306  }
1307 
1308  xEventId = 0;
1309  while (xEventId < MaxNativeEventId) {
1310  xNumEvents = 0;
1311  while (xEventId <= MaxNativeEventId && xNumEvents < NumEventsPerSet) {
1312  xEventCode = xEventId | 0x40000000;
1313  xRC = PAPI_query_event(xEventCode);
1314  if (xRC == PAPI_OK) {
1315  switch(xEventCode) {
1316  case 0x4000005C:
1317  case 0x4000005D:
1318  case 0x4000005E:
1319  case 0x4000005F:
1320  case 0x40000060:
1321  case 0x40000061:
1322  case 0x40000062:
1323  case 0x40000063:
1324  case 0x40000064:
1325  case 0x4000007C:
1326  case 0x4000007D:
1327  case 0x4000007E:
1328  case 0x4000007F:
1329  case 0x40000080:
1330  case 0x40000081:
1331  case 0x40000082:
1332  case 0x40000083:
1333  case 0x40000084:
1334  case 0x400000D8:
1335  case 0x400000D9:
1336  case 0x400000DA:
1337  case 0x400000DB:
1338  case 0x400000DC:
1339  case 0x400000DD:
1340  case 0x400000FD:
1341  case 0x400000FE:
1342  case 0x40000198:
1343  case 0x40000199:
1344  case 0x4000019A:
1345  case 0x4000019B:
1346  case 0x4000019C:
1347  case 0x4000019D:
1348  case 0x4000019E:
1349  case 0x4000019F:
1350  case 0x400001A0:
1351  case 0x400001B8:
1352  case 0x400001B9:
1353  case 0x400001BA:
1354  case 0x400001BB:
1355  case 0x400001BC:
1356  case 0x400001BD:
1357  case 0x400001BE:
1358  case 0x400001BF:
1359  case 0x400001C0:
1360  case 0x400001D2:
1361  case 0x400001D3:
1362  case 0x400001D4:
1363  case 0x400001D5:
1364  case 0x400001D6:
1365  case 0x400001D7:
1366  case 0x400001E6:
1367  case 0x400001E7:
1368  case 0x400001E8:
1369  case 0x400001E9:
1370  case 0x400001EA:
1371  case 0x400001EB:
1372  case 0x400001FE:
1373  printf("FAILURE: Do_High_Level_Tests, native event code %#8.8x added to list of events to be started, but should not be allowed...\n", xEventCode);
1374  break;
1375  default:
1376  printf("SUCCESS: Do_High_Level_Tests, native event code %#8.8x added to list of events to be started...\n", xEventCode);
1377  }
1378  PAPI_Events[xNumEvents] = xEventCode;
1379  xNumEvents++;
1380  }
1381  else {
1382  switch(xEventCode) {
1383  case 0x4000005C:
1384  case 0x4000005D:
1385  case 0x4000005E:
1386  case 0x4000005F:
1387  case 0x40000060:
1388  case 0x40000061:
1389  case 0x40000062:
1390  case 0x40000063:
1391  case 0x40000064:
1392  case 0x4000007C:
1393  case 0x4000007D:
1394  case 0x4000007E:
1395  case 0x4000007F:
1396  case 0x40000080:
1397  case 0x40000081:
1398  case 0x40000082:
1399  case 0x40000083:
1400  case 0x40000084:
1401  case 0x400000D8:
1402  case 0x400000D9:
1403  case 0x400000DA:
1404  case 0x400000DB:
1405  case 0x400000DC:
1406  case 0x400000DD:
1407  case 0x400000FD:
1408  case 0x400000FE:
1409  case 0x40000198:
1410  case 0x40000199:
1411  case 0x4000019A:
1412  case 0x4000019B:
1413  case 0x4000019C:
1414  case 0x4000019D:
1415  case 0x4000019E:
1416  case 0x4000019F:
1417  case 0x400001A0:
1418  case 0x400001B8:
1419  case 0x400001B9:
1420  case 0x400001BA:
1421  case 0x400001BB:
1422  case 0x400001BC:
1423  case 0x400001BD:
1424  case 0x400001BE:
1425  case 0x400001BF:
1426  case 0x400001C0:
1427  case 0x400001D2:
1428  case 0x400001D3:
1429  case 0x400001D4:
1430  case 0x400001D5:
1431  case 0x400001D6:
1432  case 0x400001D7:
1433  case 0x400001E6:
1434  case 0x400001E7:
1435  case 0x400001E8:
1436  case 0x400001E9:
1437  case 0x400001EA:
1438  case 0x400001EB:
1439  case 0x400001FE:
1440  printf("SUCCESS: Do_High_Level_Tests, native event code %#8.8x cannot be added to list of events to be started, xRC = %d...\n", xEventCode, xRC);
1441  break;
1442  default:
1443  printf("FAILURE: Do_High_Level_Tests, native event code %#8.8x cannot be added to list of events to be started, xRC = %d...\n", xEventCode, xRC);
1444  }
1445  }
1446  xEventId++;
1447  }
1448  if (xNumEvents)
1449  Run_Cycle(xNumEvents);
1450  }
1451 
1452  float xRtime, xPtime, xMflips, xMflops, xIpc;
1453  long long xFlpins, xFlpops, xIns;
1454  long long values[3] = {PAPI_FP_INS, PAPI_FP_OPS, PAPI_TOT_CYC};
1455 
1456  xRC = PAPI_flips(&xRtime, &xPtime, &xFlpins, &xMflips);
1457 
1458  if (xRC == PAPI_OK)
1459  printf("SUCCESS: PAPI_flips started.\n");
1460  else
1461  printf("FAILURE: PAPI_flips failed, returned xRC=%d...\n", xRC);
1462 
1463  FPUArith();
1464 
1465  xRC = PAPI_flips(&xRtime, &xPtime, &xFlpins, &xMflips);
1466  if (xRC == PAPI_OK)
1467  printf("SUCCESS: PAPI_flips Rtime=%e Ptime=%e, Flpins=%lld, Mflips=%e\n", xRtime, xPtime, xFlpins, xMflips);
1468  else
1469  printf("FAILURE: PAPI_flips failed, returned xRC=%d...\n", xRC);
1470 
1471  FPUArith();
1472  FPUArith();
1473 
1474  xRC = PAPI_flips(&xRtime, &xPtime, &xFlpins, &xMflips);
1475  if (xRC == PAPI_OK)
1476  printf("SUCCESS: PAPI_flips Rtime=%e Ptime=%e, Flpins=%lld, Mflips=%e\n", xRtime, xPtime, xFlpins, xMflips);
1477  else
1478  printf("FAILURE: PAPI_flips failed, returned xRC=%d...\n", xRC);
1479 
1480  xRC = PAPI_stop_counters(values, 3);
1481  if (xRC == PAPI_OK)
1482  printf("SUCCESS: PAPI_stop_counters stopped counters.\n");
1483  else
1484  printf("FAILURE: PAPI_stop_counters failed, returned xRC=%d...\n", xRC);
1485 
1486 
1487  xRC = PAPI_flops(&xRtime, &xPtime, &xFlpops, &xMflops);
1488  if (xRC == PAPI_OK)
1489  printf("SUCCESS: PAPI_flops started.\n");
1490  else
1491  printf("FAILURE: PAPI_flops failed, returned xRC=%d...\n", xRC);
1492 
1493  FPUArith();
1494 
1495  xRC = PAPI_flops(&xRtime, &xPtime, &xFlpops, &xMflops);
1496  if (xRC == PAPI_OK)
1497  printf("SUCCESS: PAPI_flops Rtime=%e Ptime=%e Flpops=%lld Mflops=%e\n", xRtime, xPtime, xFlpops, xMflops);
1498  else
1499  printf("FAILURE: PAPI_flops failed, returned xRC=%d...\n", xRC);
1500 
1501  FPUArith();
1502  FPUArith();
1503 
1504  xRC = PAPI_flops(&xRtime, &xPtime, &xFlpops, &xMflops);
1505  if (xRC == PAPI_OK)
1506  printf("SUCCESS: PAPI_flops Rtime=%e Ptime=%e Flpops=%lld Mflops=%e\n", xRtime, xPtime, xFlpops, xMflops);
1507  else
1508  printf("FAILURE: PAPI_flops failed, returned xRC=%d...\n", xRC);
1509 
1510  xRC = PAPI_stop_counters(values, 3);
1511  if (xRC == PAPI_OK)
1512  printf("SUCCESS: PAPI_stop_counters stopped counters.\n");
1513  else
1514  printf("FAILURE: PAPI_stop_counters failed, returned xRC=%d...\n", xRC);
1515 
1516  xRC = PAPI_ipc(&xRtime, &xPtime, &xIns, &xIpc);
1517  if (xRC == PAPI_ENOEVNT)
1518  printf("SUCCESS: PAPI_ipc, no event found...\n");
1519  else
1520  printf("FAILURE: PAPI_ipc failed, returned xRC=%d...\n", xRC);
1521 
1522  printf("==> Do_High_Level_Tests(): End of the main body...\n");
1523 
1524  return;
1525 }
#define PAPI_ENOEVNT
Definition: papi.h:258
void FPUArith(void)
Definition: papi_1.c:1645
#define PAPI_FP_OPS
int PAPI_ipc(float *rtime, float *ptime, long long *ins, float *ipc)
Definition: papi_hl.c:316
int PAPI_flops(float *rtime, float *ptime, long long *flpops, float *mflops)
Definition: papi_hl.c:259
int PAPI_num_components(void)
Definition: papi.c:4326
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
const int MaxPresetEventId
Definition: papi_1.c:102
int PAPI_flips(float *rtime, float *ptime, long long *flpins, float *mflips)
Definition: papi_hl.c:204
const int NumEventsPerSet
Definition: papi_1.c:101
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:803
#define PAPI_TOT_CYC
void Run_Cycle(const int pNumEvents)
Definition: papi_1.c:1549
unsigned uint
Definition: perfmon.c:40
const int MaxNativeEventId
Definition: papi_1.c:103
int PAPI_query_event(int EventCode)
Definition: papi.c:698
int PAPI_num_counters(void)
Definition: papi_hl.c:537
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
#define PAPI_FP_INS

Here is the call graph for this function:

Here is the caller graph for this function:

void Do_Low_Level_Tests ( void  )

Definition at line 265 of file papi_1.c.

265  {
266  int xRC, xEventSet, xEventCode, xState;
267  long long xLLValue;
268  char xName[256];
269 
270  printf("==> Do_Low_Level_Tests(): Beginning of the main body...\n");
271 
272  /*
273  * Low-level API tests...
274  */
275 
276  xRC = PAPI_is_initialized();
277  if (xRC == 1)
278  printf("SUCCESS: PAPI has been low-level initialized by main()...\n");
279  else {
280  printf("FAILURE: PAPI has not been properly initialized by main(), xRC=%d, ending...\n", xRC);
281  return;
282  }
283 
284  /*
285  * Print out the node information with respect to UPC units...
286  */
287  Print_Node_Info();
288 
289  /*
290  * Zero the buffers for counters...
291  */
293  BGP_UPC_Read_Counters_Struct_t* xTemp;
294  xTemp = (BGP_UPC_Read_Counters_Struct_t*)(void*)Native_Buffer;
295  Zero_Local_Counters(xTemp->counter);
296 
297  /*
298  * Start of real tests...
299  */
300  xLLValue = -1;
301  xLLValue = PAPI_get_real_cyc();
302  printf("PAPI_get_real_cyc: xLLValue=%lld...\n", xLLValue);
303 
304  xLLValue = -1;
305  xLLValue = PAPI_get_virt_cyc();
306  printf("PAPI_get_virt_cyc: xLLValue=%lld...\n", xLLValue);
307 
308  xLLValue = -1;
309  xLLValue = PAPI_get_real_usec();
310  printf("PAPI_get_real_usec: xLLValue=%lld...\n", xLLValue);
311 
312  xLLValue = -1;
313  xLLValue = PAPI_get_virt_usec();
314  printf("PAPI_get_virt_usec: xLLValue=%lld...\n", xLLValue);
315 
316  xRC = PAPI_num_hwctrs();
317  if (xRC == 256)
318  printf("SUCCESS: PAPI_num_hwctrs returned 256 hardware counters...\n");
319  else
320  printf("FAILURE: PAPI_num_hwctrs failed, returned xRC=%d...\n", xRC);
321 
322  *xName = 0;
323  char* xEventName_1 = "PAPI_L3_LDM";
324  xRC = PAPI_event_code_to_name(PAPI_L3_LDM, xName);
325  if (xRC == PAPI_OK) {
326  xRC = strcmp(xName,xEventName_1);
327  if (!xRC)
328  printf("SUCCESS: PAPI_event_code_to_name for PAPI_L3_LDM...\n");
329  else
330  printf("FAILURE: PAPI_event_code_to_name returned incorrect name, xName=%s\n", xName);
331  }
332  else
333  printf("FAILURE: PAPI_event_code_to_name failed, xRC=%d...\n", xRC);
334 
335  *xName = 0;
336  char* xEventName_2 = "PNE_BGP_PU1_IPIPE_INSTRUCTIONS";
338  if (xRC == PAPI_OK) {
339  xRC = strcmp(xName,xEventName_2);
340  if (!xRC)
341  printf("SUCCESS: PAPI_event_code_to_name for PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
342  else
343  printf("FAILURE: PAPI_event_code_to_name returned incorrect name, xName=%s\n", xName);
344  }
345  else
346  printf("FAILURE: PAPI_event_code_to_name failed, xRC=%d...\n", xRC);
347 
348  strcpy(xName,"PAPI_L3_LDM");
349  xRC = PAPI_event_name_to_code(xName, &xEventCode);
350  if (xRC == PAPI_OK)
351  if (xEventCode == 0x8000000E)
352  printf("SUCCESS: PAPI_event_name_to_code for PAPI_L3_LDM...\n");
353  else
354  printf("FAILURE: PAPI_event_name_to_code returned incorrect code, xEventCode=%d\n", xEventCode);
355  else
356  printf("FAILURE: PAPI_event_name_to_code failed, xRC=%d...\n", xRC);
357 
358  strcpy(xName,"PNE_BGP_PU1_IPIPE_INSTRUCTIONS");
359  xRC = PAPI_event_name_to_code(xName, &xEventCode);
360  if (xRC == PAPI_OK)
361  if (xEventCode == 0x40000027)
362  printf("SUCCESS: PAPI_event_name_to_code for PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
363  else
364  printf("FAILURE: PAPI_event_name_to_code returned incorrect code, xEventCode=%8.8x\n", xEventCode);
365  else
366  printf("FAILURE: PAPI_event_name_to_code failed, xRC=%d...\n", xRC);
367 
368  xEventCode = 0x80000000;
369  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
370  if (xRC == PAPI_OK)
371  if (xEventCode == 0x80000001)
372  printf("SUCCESS: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL, returned 0x80000001...\n");
373  else
374  printf("FAILURE: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
375  else
376  printf("FAILURE: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
377 
378  xEventCode = 0x80000002;
379  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
380  if (xRC == PAPI_OK)
381  if (xEventCode == 0x80000003)
382  printf("SUCCESS: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL, returned 0x80000003...\n");
383  else
384  printf("FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
385  else
386  printf("FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
387 
388  xEventCode = 0x80000067;
389  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
390  if (xRC == PAPI_OK)
391  if (xEventCode == 0x80000068)
392  printf("SUCCESS: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL, returned 0x80000068...\n");
393  else
394  printf("FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
395  else
396  printf("FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
397 
398  xEventCode = 0x80000068;
399  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
400  if (xRC == PAPI_ENOEVNT)
401  printf("SUCCESS: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_ALL, no next event...\n");
402  else
403  printf("FAILURE: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
404 
405  xEventCode = 0x40000000;
406  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
407  if (xRC == PAPI_OK)
408  if (xEventCode == 0x40000001)
409  printf("SUCCESS: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL, returned 0x40000001...\n");
410  else
411  printf("FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
412  else
413  printf("FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
414 
415  xEventCode = 0x40000001;
416  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
417  if (xRC == PAPI_OK)
418  if (xEventCode == 0x40000002)
419  printf("SUCCESS: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL, returned 0x40000002...\n");
420  else
421  printf("FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
422  else
423  printf("FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
424 
425  xEventCode = 0x400000FC;
426  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
427  if (xRC == PAPI_OK)
428  if (xEventCode == 0x400000FF)
429  printf("SUCCESS: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL, returned 0x400000FF...\n");
430  else
431  printf("FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
432  else
433  printf("FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
434 
435  xEventCode = 0x400001FD;
436  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
437  if (xRC == PAPI_OK)
438  if (xEventCode == 0x400001FF)
439  printf("SUCCESS: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL, returned 0x400001FF...\n");
440  else
441  printf("FAILURE: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
442  else
443  printf("FAILURE: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL failed, xRC=%d...\n", xRC);
444 
445  xEventCode = 0x400001FF;
446  xRC = PAPI_enum_event(&xEventCode, PAPI_ENUM_ALL);
447  if (xRC == PAPI_ENOEVNT)
448  printf("SUCCESS: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_ALL, no next event...\n");
449  else
450  printf("FAILURE: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
451 
452  xEventCode = 0x80000000;
453  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
454  if (xRC == PAPI_OK)
455  if (xEventCode == 0x80000001)
456  printf("SUCCESS: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_AVAIL, returned 0x80000001...\n");
457  else
458  printf("FAILURE: PAPI_enum_event for 0x80000000PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
459  else
460  printf("FAILURE: PAPI_enum_event for 0x80000000PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
461 
462  xEventCode = 0x80000002;
463  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
464  if (xRC == PAPI_OK)
465  if (xEventCode == 0x80000006)
466  printf("SUCCESS: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL, returned 0x80000006...\n");
467  else
468  printf("FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
469  else
470  printf("FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
471 
472  xEventCode = 0x80000067;
473  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
474  if (xRC == PAPI_OK)
475  if (xEventCode == 0x80000068)
476  printf("SUCCESS: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL, returned 0x80000068...\n");
477  else
478  printf("FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
479  else
480  printf("FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
481 
482  xEventCode = 0x80000068;
483  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
484  if (xRC == PAPI_ENOEVNT)
485  printf("SUCCESS: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_AVAIL, no next event...\n");
486  else
487  printf("FAILURE: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
488 
489  xEventCode = 0x40000000;
490  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
491  if (xRC == PAPI_OK)
492  if (xEventCode == 0x40000001)
493  printf("SUCCESS: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL, returned 0x40000001...\n");
494  else
495  printf("FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
496  else
497  printf("FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
498 
499  xEventCode = 0x40000001;
500  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
501  if (xRC == PAPI_OK)
502  if (xEventCode == 0x40000002)
503  printf("SUCCESS: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL, returned 0x40000002...\n");
504  else
505  printf("FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
506  else
507  printf("FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
508 
509  printf("NOTE: Might get two messages indicating invalid event id specified for 253 and 254. These are OK...\n");
510  xEventCode = 0x400000FC;
511  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
512  if (xRC == PAPI_OK)
513  if (xEventCode == 0x400000FF)
514  printf("SUCCESS: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL, returned 0x400000FF...\n");
515  else
516  printf("FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
517  else
518  printf("FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
519 
520  printf("NOTE: Might get one message indicating invalid event id specified for 510. This is OK...\n");
521  xEventCode = 0x400001FD;
522  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
523  if (xRC == PAPI_OK)
524  if (xEventCode == 0x400001FF)
525  printf("SUCCESS: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL, returned 0x400001FF...\n");
526  else
527  printf("FAILURE: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
528  else
529  printf("FAILURE: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
530 
531  xEventCode = 0x400001FF;
532  xRC = PAPI_enum_event(&xEventCode, PAPI_PRESET_ENUM_AVAIL);
533  if (xRC == PAPI_ENOEVNT)
534  printf("SUCCESS: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_AVAIL, no next event...\n");
535  else
536  printf("FAILURE: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
537 
538  PAPI_dmem_info_t xDmemSpace;
539  xRC = PAPI_get_dmem_info(&xDmemSpace);
540  if (xRC == PAPI_OK) {
541  DumpInHex((char*)&xDmemSpace, sizeof( PAPI_dmem_info_t));
542  printf("SUCCESS: PAPI_get_dmem_info...\n");
543  }
544  else
545  printf("FAILURE: PAPI_get_dmem_info failed, xRC=%d...\n", xRC);
546 
547  PAPI_event_info_t xInfoSpace;
548  xRC = PAPI_get_event_info(PAPI_L3_LDM, &xInfoSpace);
549  if (xRC == PAPI_OK) {
550  DumpInHex((char*)&xInfoSpace, sizeof( PAPI_event_info_t));
551  printf("SUCCESS: PAPI_get_event_info for PAPI_L3_LDM...\n");
552  }
553  else
554  printf("FAILURE: PAPI_get_event_info failed for PAPI_L3_LDM, xRC=%d...\n", xRC);
555 
556  const PAPI_exe_info_t* xExeInfo = NULL;
557  if ((xExeInfo = PAPI_get_executable_info()) != NULL) {
558  DumpInHex((char*)xExeInfo, sizeof( PAPI_exe_info_t));
559  printf("SUCCESS: PAPI_get_executable_info...\n");
560  }
561  else
562  printf("FAILURE: PAPI_get_executable_info failed, returned null pointer...\n");
563 
564  const PAPI_hw_info_t* xHwInfo = NULL;
565  if ((xHwInfo = PAPI_get_hardware_info()) != NULL) {
566  DumpInHex((char*)xHwInfo, sizeof( PAPI_hw_info_t));
567  printf("SUCCESS: PAPI_get_hardware_info...\n");
568  }
569  else
570  printf("FAILURE: PAPI_get_hardware_info failed, returned null pointer...\n");
571 
572  const PAPI_shlib_info_t* xShLibInfo = NULL;
573  if ((xShLibInfo = PAPI_get_shared_lib_info()) != NULL) {
574  DumpInHex((char*)xShLibInfo, sizeof( PAPI_shlib_info_t));
575  printf("SUCCESS: PAPI_get_shared_lib_info...\n");
576  }
577  else
578  printf("FAILURE: PAPI_get_shared_lib_info failed, returned null pointer...\n");
579 
580  xEventSet = PAPI_NULL;
581  xRC = PAPI_create_eventset(&xEventSet);
582  if (xRC == PAPI_OK)
583  printf("SUCCESS: PAPI_create_eventset created...\n");
584  else {
585  printf("FAILURE: PAPI_create_eventset failed, xRC=%d...\n", xRC);
586  return;
587  }
588 
589  printf("==> No events should be in the event set...\n");
590  Print_Counters(xEventSet);
591 
592  xRC = PAPI_num_events(xEventSet);
593  if (xRC == 0)
594  printf("SUCCESS: PAPI_num_events returned 0...\n");
595  else
596  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
597 
598  xRC = PAPI_add_event(xEventSet, PAPI_L1_DCM);
599  if (xRC == PAPI_OK)
600  printf("SUCCESS: PAPI_add_event PAPI_L1_DCM...\n");
601  else
602  printf("FAILURE: PAPI_add_event PAPI_L1_DCM failed, xRC=%d...\n", xRC);
603 
604  xRC = PAPI_num_events(xEventSet);
605  if (xRC == 1)
606  printf("SUCCESS: PAPI_num_events returned 1...\n");
607  else
608  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
609 
611  if (xRC == PAPI_OK)
612  printf("SUCCESS: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES...\n");
613  else
614  printf("FAILURE: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES failed, xRC=%d...\n", xRC);
615 
616  xRC = PAPI_num_events(xEventSet);
617  if (xRC == 2)
618  printf("SUCCESS: PAPI_num_events returned 2...\n");
619  else
620  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
621 
622  xRC = PAPI_add_event(xEventSet, BGP_PU3_L2_MEMORY_WRITES);
623  if (xRC == PAPI_EINVAL)
624  printf("SUCCESS: PAPI_add_event BGP_PU3_L2_MEMORY_WRITES not allowed...\n");
625  else
626  printf("FAILURE: PAPI_add_event BGP_PU3_L2_MEMORY_WRITES allowed, or failed incorrectly..., xRC=%d...\n", xRC);
627 
628  xRC = PAPI_num_events(xEventSet);
629  if (xRC == 2)
630  printf("SUCCESS: PAPI_num_events returned 2...\n");
631  else
632  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
633 
634  xRC = PAPI_add_event(xEventSet, 0x40000208);
635  if (xRC == PAPI_ENOEVNT)
636  printf("SUCCESS: PAPI_add_event 0x40000208 not allowed...\n");
637  else
638  printf("FAILURE: PAPI_add_event 0x40000208 allowed, or failed incorrectly..., xRC=%d...\n", xRC);
639 
640  xRC = PAPI_num_events(xEventSet);
641  if (xRC == 2)
642  printf("SUCCESS: PAPI_num_events returned 2...\n");
643  else
644  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
645 
646  xRC = PAPI_add_event(xEventSet, PAPI_L1_ICM);
647  if (xRC == PAPI_OK)
648  printf("SUCCESS: PAPI_add_event PAPI_L1_ICM...\n");
649  else
650  printf("FAILURE: PAPI_add_event PAPI_L1_ICM failed, xRC=%d...\n", xRC);
651 
652  xRC = PAPI_num_events(xEventSet);
653  if (xRC == 3)
654  printf("SUCCESS: PAPI_num_events returned 3...\n");
655  else
656  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
657 
658  xRC = PAPI_add_event(xEventSet, PAPI_L1_TCM);
659  if (xRC == PAPI_OK)
660  printf("SUCCESS: PAPI_add_event PAPI_L1_TCM...\n");
661  else
662  printf("FAILURE: PAPI_add_event PAPI_L1_TCM failed, xRC=%d...\n", xRC);
663 
664  xRC = PAPI_num_events(xEventSet);
665  if (xRC == 4)
666  printf("SUCCESS: PAPI_num_events returned 4...\n");
667  else
668  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
669 
670  xRC = PAPI_add_event(xEventSet, PAPI_L1_DCM);
671  if (xRC == PAPI_ECNFLCT)
672  printf("SUCCESS: PAPI_add_event, redundantly adding PAPI_L1_DCM not allowed...\n");
673  else
674  printf("FAILURE: PAPI_add_event PAPI_L1_DCM failed incorrectly, xRC=%d...\n", xRC);
675 
677  if (xRC == PAPI_ECNFLCT)
678  printf("SUCCESS: PAPI_add_event, redundantly adding PNE_BGP_PU3_L2_MEMORY_WRITES not allowed...\n");
679  else
680  printf("FAILURE: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES failed incorectly, xRC=%d...\n", xRC);
681 
682  printf("\n==> All events added... Perform a read now...\n");
683  xRC = PAPI_read(xEventSet, PAPI_Counters);
684  if (xRC == PAPI_OK)
685  printf("SUCCESS: PAPI_read...\n");
686  else
687  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
688 
689  printf("\n==> Perform a reset now...\n");
690  xRC = PAPI_reset(xEventSet);
691  if (xRC == PAPI_OK)
692  printf("SUCCESS: PAPI_reset...\n");
693  else
694  printf("FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
695 
696  printf("\n==> Perform another read now...\n");
697  xRC = PAPI_read(xEventSet, PAPI_Counters);
698  if (xRC == PAPI_OK)
699  printf("SUCCESS: PAPI_read...\n");
700  else
701  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
702 
703  printf("\n==> Should be 4 counters below, preset, native, preset, and preset. All counter values should be zero.\n");
704  Print_Counters(xEventSet);
705 
706  printf("\n==> Stop the UPC now...\n");
707  xRC = PAPI_stop(xEventSet, PAPI_Counters);
708  if (xRC == PAPI_ENOTRUN)
709  printf("SUCCESS: PAPI_stop, but not running...\n");
710  else
711  printf("FAILURE: PAPI_stop failed incorectly, xRC=%d...\n", xRC);
712 
713  printf("\n==> Start the UPC now...\n");
714  xRC = PAPI_start(xEventSet);
715  if (xRC == PAPI_OK)
716  printf("SUCCESS: PAPI_start...\n");
717  else {
718  printf("FAILURE: PAPI_start failed, xRC=%d...\n", xRC);
719  return;
720  }
721 
722  printf("\n==> Try to start it again...\n");
723  xRC = PAPI_start(xEventSet);
724  if (xRC == PAPI_EISRUN)
725  printf("SUCCESS: PAPI_start, but already running...\n");
726  else
727  printf("FAILURE: PAPI_start failed incorectly, xRC=%d...\n", xRC);
728 
729  FPUArith();
730 
731  printf("\n==> Stop the UPC after the arithmetic was performed... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the UPC(s) being stopped...\n");
732  xRC = PAPI_stop(xEventSet, PAPI_Counters);
733  if (xRC == PAPI_OK)
734  printf("SUCCESS: PAPI_stop...\n");
735  else {
736  printf("FAILURE: PAPI_stop failed, xRC=%d...\n", xRC);
737  return;
738  }
739  Print_Counters(xEventSet);
740 
741  printf("\n==> Perform a read of the counters after performing arithmetic, UPC is stopped... Values should be the same as right after the prior PAPI_Stop()...\n");
742  xRC = PAPI_read(xEventSet, PAPI_Counters);
743  if (xRC == PAPI_OK)
744  printf("SUCCESS: PAPI_read...\n");
745  else
746  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
747  Print_Counters(xEventSet);
748 
749  printf("\n==> Zero local counters. Perform a PAPI_accum, UPC is stopped... Native values should be zero, and the local PAPI counters the same as the previous read...\n");
751  xRC = PAPI_accum(xEventSet, PAPI_Counters);
752  if (xRC == PAPI_OK) {
753  printf("SUCCESS: PAPI_accum...\n");
754  }
755  else {
756  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
757  return;
758  }
759  Print_Counters(xEventSet);
760 
761  printf("\n==> Perform a PAPI_read, UPC is stopped... All values should be zero...\n");
762  xRC = PAPI_read(xEventSet, PAPI_Counters);
763  if (xRC == PAPI_OK) {
764  printf("SUCCESS: PAPI_read...\n");
765  }
766  else {
767  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
768  return;
769  }
770  Print_Counters(xEventSet);
771 
772  printf("\n==> Perform a reset after performing arithmetic, UPC is stopped... All values should be zero...\n");
773  xRC = PAPI_reset(xEventSet);
774  if (xRC == PAPI_OK) {
775  printf("SUCCESS: PAPI_reset...\n");
776  }
777  else {
778  printf("FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
779  return;
780  }
781  Print_Counters(xEventSet);
782 
783  printf("\n==> Perform another read of the counters after resetting the counters, UPC is stopped... All values should be zero...\n");
784  xRC = PAPI_read(xEventSet, PAPI_Counters);
785  if (xRC == PAPI_OK)
786  printf("SUCCESS: PAPI_read...\n");
787  else
788  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
789  Print_Counters(xEventSet);
790 
791  printf("\n==> Perform another PAPI_accum after resetting the counters, UPC is stopped... All values should be zero...\n");
793  xRC = PAPI_accum(xEventSet, PAPI_Counters);
794  if (xRC == PAPI_OK) {
795  printf("SUCCESS: PAPI_accum...\n");
796  }
797  else {
798  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
799  return;
800  }
801  Print_Counters(xEventSet);
802 
803  printf("\n==> Perform another PAPI_read after accumulating and resetting the UPC, UPC is stopped... All values should be zero...\n");
804  xRC = PAPI_read(xEventSet, PAPI_Counters);
805  if (xRC == PAPI_OK) {
806  printf("SUCCESS: PAPI_read...\n");
807  }
808  else {
809  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
810  return;
811  }
812  Print_Counters(xEventSet);
813 
814  printf("\n==> Start the UPC again...\n");
815  xRC = PAPI_start(xEventSet);
816  if (xRC == PAPI_OK)
817  printf("SUCCESS: PAPI_start...\n");
818  else {
819  printf("FAILURE: PAPI_start failed, xRC=%d...\n", xRC);
820  return;
821  }
822 
823  FPUArith();
824 
825  printf("\n==> Get the state of the event set...\n");
826  xRC = PAPI_state(xEventSet, &xState);
827  if (xRC == PAPI_OK) {
828  if (xState == PAPI_RUNNING) {
829  printf("SUCCESS: PAPI_state is RUNNING...\n");
830  }
831  else {
832  printf("FAILURE: PAPI_state failed, incorrect state, xState=%d...\n", xState);
833  }
834  }
835  else {
836  printf("FAILURE: PAPI_state failed, xRC=%d...\n", xRC);
837  return;
838  }
839 
840  printf("\n==> Perform a read of the counters, UPC is running... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the reads for the individual counter values...\n");
841  xRC = PAPI_read(xEventSet, PAPI_Counters);
842  if (xRC == PAPI_OK)
843  printf("SUCCESS: PAPI_read...\n");
844  else
845  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
846  Print_Counters(xEventSet);
847 
848  FPUArith();
849 
850  printf("\n==> Perform another read of the counters, UPC is running... Values should be increasing...\n");
851  xRC = PAPI_read(xEventSet, PAPI_Counters);
852  if (xRC == PAPI_OK)
853  printf("SUCCESS: PAPI_read...\n");
854  else
855  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
856  Print_Counters(xEventSet);
857 
858  FPUArith();
859 
860  printf("\n==> Perform another read of the counters, UPC is running... Values should continue increasing...\n");
861  xRC = PAPI_read(xEventSet, PAPI_Counters);
862  if (xRC == PAPI_OK)
863  printf("SUCCESS: PAPI_read...\n");
864  else
865  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
866  Print_Counters(xEventSet);
867 
868  printf("\n==> Perform a reset after performing arithmetic, UPC is still running... Native counter values should be less than prior read, but PAPI counter values should be identical to the prior read (local buffer was not changed)...\n");
869  xRC = PAPI_reset(xEventSet);
870  if (xRC == PAPI_OK) {
871  printf("SUCCESS: PAPI_reset...\n");
872  }
873  else {
874  printf("FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
875  return;
876  }
877  Print_Counters(xEventSet);
878 
879  printf("\n==> Zero local counters. Perform a PAPI_accum, UPC is still running...\n");
881  xRC = PAPI_accum(xEventSet, PAPI_Counters);
882  if (xRC == PAPI_OK) {
883  printf("SUCCESS: PAPI_accum...\n");
884  }
885  else {
886  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
887  return;
888  }
889  Print_Counters(xEventSet);
890 
891  FPUArith();
892 
893  printf("\n==> Accumulate local counters. Perform a PAPI_accum, UPC is still running... PAPI counters should show an increase from prior accumulate...\n");
894  xRC = PAPI_accum(xEventSet, PAPI_Counters);
895  if (xRC == PAPI_OK) {
896  printf("SUCCESS: PAPI_accum...\n");
897  }
898  else {
899  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
900  return;
901  }
902  Print_Counters(xEventSet);
903 
904  FPUArith();
905 
906  printf("\n==> Accumulate local counters. Perform another PAPI_accum, UPC is still running... PAPI counters should show an increase from prior accumulate...\n");
907  xRC = PAPI_accum(xEventSet, PAPI_Counters);
908  if (xRC == PAPI_OK) {
909  printf("SUCCESS: PAPI_accum...\n");
910  }
911  else {
912  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
913  return;
914  }
915  Print_Counters(xEventSet);
916 
917  printf("\n==> Zero local counters. Perform a PAPI_accum, UPC is still running... PAPI counters should be less than the prior accumulate...\n");
919  xRC = PAPI_accum(xEventSet, PAPI_Counters);
920  if (xRC == PAPI_OK) {
921  printf("SUCCESS: PAPI_accum...\n");
922  }
923  else {
924  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
925  return;
926  }
927  Print_Counters(xEventSet);
928 
929  printf("\n==> Perform a PAPI_read, UPC is still running... Native counters and PAPI counters should have both increased from prior accumulate...\n");
930  xRC = PAPI_read(xEventSet, PAPI_Counters);
931  if (xRC == PAPI_OK) {
932  printf("SUCCESS: PAPI_read...\n");
933  }
934  else {
935  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
936  return;
937  }
938  Print_Counters(xEventSet);
939 
940  printf("\n==> Perform a PAPI_write (not supported when UPC is running)...\n");
941  xRC = PAPI_write(xEventSet, PAPI_Counters);
942  if (xRC == PAPI_ECMP) {
943  printf("SUCCESS: PAPI_write, not allowed...\n");
944  }
945  else {
946  printf("FAILURE: PAPI_write failed, xRC=%d...\n", xRC);
947  return;
948  }
949 
950  printf("\n==> Stop the UPC... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the UPC(s) being stopped...\n");
951  xRC = PAPI_stop(xEventSet, PAPI_Counters);
952  if (xRC == PAPI_OK)
953  printf("SUCCESS: PAPI_stop...\n");
954  else {
955  printf("FAILURE: PAPI_stop failed, xRC=%d...\n", xRC);
956  return;
957  }
958  Print_Counters(xEventSet);
959 
960  printf("\n==> Perform a PAPI_read with the UPC stopped...\n");
961  xRC = PAPI_read(xEventSet, PAPI_Counters);
962  if (xRC == PAPI_OK)
963  printf("SUCCESS: PAPI_read...\n");
964  else
965  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
966 
967  printf("\n==> Should be same 4 counters below, with the same native and PAPI counters as after the PAPI_stop...\n");
968  Print_Counters(xEventSet);
969 
970  printf("\n==> Perform a PAPI_accum with the UPC stopped... Native counters sould be zeroed, with the PAPI counters unchanged from prior read (with the UPC already stopped, the accumulate does not add any counter values to the local buffer)...\n");
972  xRC = PAPI_accum(xEventSet, PAPI_Counters);
973  if (xRC == PAPI_OK) {
974  printf("SUCCESS: PAPI_accum...\n");
975  }
976  else {
977  printf("FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
978  return;
979  }
980  Print_Counters(xEventSet);
981 
982  printf("\n==> Perform a PAPI_read with the UPC stopped... Native and PAPI counters are zero...\n");
983  xRC = PAPI_read(xEventSet, PAPI_Counters);
984  if (xRC == PAPI_OK)
985  printf("SUCCESS: PAPI_read...\n");
986  else
987  printf("FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
988  Print_Counters(xEventSet);
989 
990  printf("\n==> Perform a reset, UPC is stopped... Native and PAPI counters are zero...\n");
991  xRC = PAPI_reset(xEventSet);
992  if (xRC == PAPI_OK) {
993  printf("SUCCESS: PAPI_reset...\n");
994  }
995  else {
996  printf("FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
997  return;
998  }
999  Print_Counters(xEventSet);
1000 
1001  printf("\n==> Perform a PAPI_write, but only to local memory...\n");
1002  xRC = PAPI_write(xEventSet, PAPI_Counters);
1003  if (xRC == PAPI_OK) {
1004  printf("SUCCESS: PAPI_write, but only to local memory...\n");
1005  }
1006  else {
1007  printf("FAILURE: PAPI_write failed, xRC=%d...\n", xRC);
1008  return;
1009  }
1010 
1011  printf("\n==> Get the state of the event set...\n");
1012  xRC = PAPI_state(xEventSet, &xState);
1013  if (xRC == PAPI_OK) {
1014  if (xState == PAPI_STOPPED) {
1015  printf("SUCCESS: PAPI_state is STOPPED...\n");
1016  }
1017  else {
1018  printf("FAILURE: PAPI_state failed, incorrect state, xState=%d...\n", xState);
1019  }
1020  }
1021  else {
1022  printf("FAILURE: PAPI_state failed, xRC=%d...\n", xRC);
1023  return;
1024  }
1025 
1026  printf("\n==> Get the multiplex status of the eventset...\n");
1027  xRC = PAPI_get_multiplex(xEventSet);
1028  if (xRC == PAPI_OK) {
1029  printf("SUCCESS: PAPI_get_multiplex (NOTE: The rest of the multiplex path is untested)...\n");
1030  }
1031  else {
1032  printf("FAILURE: PAPI_get_multiplex failed, xRC=%d...\n", xRC);
1033  return;
1034  }
1035 
1036  printf("\n==> Remove the events, and clean up the event set...\n");
1038  if (xRC == PAPI_EINVAL)
1039  printf("SUCCESS: PAPI_remove_event could not find PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
1040  else
1041  printf("FAILURE: PAPI_remove_event PNE_BGP_PU1_IPIPE_INSTRUCTIONS failed, xRC=%d...\n", xRC);
1042 
1043  xRC = PAPI_remove_event(xEventSet, PAPI_L3_LDM);
1044  if (xRC == PAPI_EINVAL)
1045  printf("SUCCESS: PAPI_remove_event could not find PAPI_L3_LDM...\n");
1046  else
1047  printf("FAILURE: PAPI_remove_event PAPI_L3_LDM failed, xRC=%d...\n", xRC);
1048 
1049  xRC = PAPI_remove_event(xEventSet, PAPI_L1_TCM);
1050  if (xRC == PAPI_OK)
1051  printf("SUCCESS: PAPI_remove_event PAPI_L1_TCM...\n");
1052  else
1053  printf("FAILURE: PAPI_remove_event PAPI_L1_TCM failed, xRC=%d...\n", xRC);
1054 
1055  xRC = PAPI_num_events(xEventSet);
1056  if (xRC == 3)
1057  printf("SUCCESS: PAPI_num_events returned 3...\n");
1058  else
1059  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1060 
1061  xRC = PAPI_remove_event(xEventSet, PAPI_L1_ICM);
1062  if (xRC == PAPI_OK)
1063  printf("SUCCESS: PAPI_remove_event PAPI_L1_ICM...\n");
1064  else
1065  printf("FAILURE: PAPI_remove_event PAPI_L1_ICM failed, xRC=%d...\n", xRC);
1066 
1067  xRC = PAPI_num_events(xEventSet);
1068  if (xRC == 2)
1069  printf("SUCCESS: PAPI_num_events returned 2...\n");
1070  else
1071  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1072 
1074  if (xRC == PAPI_OK)
1075  printf("SUCCESS: PAPI_remove_event PNE_BGP_PU3_L2_MEMORY_WRITES...\n");
1076  else
1077  printf("FAILURE: PAPI_remove_event PNE_BGP_PU3_L2_MEMORY_WRITES failed, xRC=%d...\n", xRC);
1078 
1079  xRC = PAPI_num_events(xEventSet);
1080  if (xRC == 1)
1081  printf("SUCCESS: PAPI_num_events returned 1...\n");
1082  else
1083  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1084 
1085  xRC = PAPI_remove_event(xEventSet, PAPI_L1_DCM);
1086  if (xRC == PAPI_OK)
1087  printf("SUCCESS: PAPI_remove_event PAPI_L1_DCM...\n");
1088  else
1089  printf("FAILURE: PAPI_remove_event PAPI_L1_DCM failed, xRC=%d...\n", xRC);
1090 
1091  xRC = PAPI_num_events(xEventSet);
1092  if (xRC == 0)
1093  printf("SUCCESS: PAPI_num_events returned 0...\n");
1094  else
1095  printf("FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1096 
1097  xRC = PAPI_cleanup_eventset(xEventSet);
1098  if (xRC == PAPI_OK)
1099  printf("SUCCESS: PAPI_cleanup_eventset...\n");
1100  else
1101  printf("FAILURE: PAPI_cleanup_eventset failed, xRC=%d...\n", xRC);
1102 
1103  xRC = PAPI_destroy_eventset(&xEventSet);
1104  if (xRC == PAPI_OK)
1105  printf("SUCCESS: PAPI_destroy_eventset...\n");
1106  else
1107  printf("FAILURE: PAPI_destroy_eventset failed, xRC=%d...\n", xRC);
1108 
1109  printf("==> Do_Low_Level_Tests(): End of the main body...\n");
1110 
1111  return;
1112 }
#define PAPI_ENOEVNT
Definition: papi.h:258
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2258
int PAPI_is_initialized(void)
Definition: papi.c:6389
void FPUArith(void)
Definition: papi_1.c:1645
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1622
Hardware info structure.
Definition: papi.h:777
long long PAPI_get_virt_usec(void)
Definition: papi.c:6298
int PAPI_reset(int EventSet)
Definition: papi.c:2403
#define PAPI_L1_DCM
const PAPI_shlib_info_t * PAPI_get_shared_lib_info(void)
Definition: papi.c:6070
int PAPI_write(int EventSet, long long *values)
Definition: papi.c:2757
int PAPI_remove_event(int EventSet, int EventCode)
Definition: papi.c:1717
#define PAPI_L1_TCM
long long PAPI_get_virt_cyc(void)
Definition: papi.c:6226
#define PAPI_NULL
Definition: papi.h:290
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1150
get the executable&#39;s info
Definition: papi.h:704
return PAPI_OK
Definition: linux-nvml.c:458
char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
Definition: papi_1.c:97
#define PAPI_ENOTRUN
Definition: papi.h:260
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PAPI_ENUM_ALL
Definition: papi.h:508
#define printf
Definition: papi_test.h:125
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
Definition: papi.c:846
#define PAPI_L3_LDM
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2689
long long PAPI_Counters[MAX_COUNTERS]
Definition: papi_1.c:96
int PAPI_num_hwctrs(void)
Definition: papi.c:3848
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:868
const PAPI_exe_info_t * PAPI_get_executable_info(void)
Definition: papi.c:6040
int PAPI_num_events(int EventSet)
Definition: papi.c:4365
int PAPI_state(int EventSet, int *status)
Definition: papi.c:2997
#define PAPI_ECNFLCT
Definition: papi.h:259
#define PAPI_ECMP
Definition: papi.h:254
#define PAPI_EISRUN
Definition: papi.h:261
int PAPI_cleanup_eventset(int EventSet)
Definition: papi.c:2834
void Print_Node_Info(void)
Definition: papi_1.c:2020
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1424
#define PAPI_L1_ICM
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
void Print_Counters(const int pEventSet)
Definition: papi_1.c:1829
strcpy(filename, default_filename)
int PAPI_event_name_to_code(char *in, int *out)
Definition: papi.c:1010
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
Definition: papi.c:5989
void DumpInHex(const char *pBuffer, int pSize)
Definition: papi_1.c:2089
long long PAPI_get_real_usec(void)
Definition: papi.c:6190
#define PAPI_RUNNING
Definition: papi.h:373
#define PAPI_STOPPED
Definition: papi.h:372
int PAPI_destroy_eventset(int *EventSet)
Definition: papi.c:1971
long long PAPI_get_real_cyc(void)
Definition: papi.c:6143
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2503
int PAPI_start(int EventSet)
Definition: papi.c:2053
int PAPI_get_multiplex(int EventSet)
Definition: papi.c:3967
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6111
void Zero_Local_Counters(long long *pCounters)
Definition: papi_1.c:1633

Here is the call graph for this function:

Here is the caller graph for this function:

void Do_Multiplex_Tests ( void  )

Definition at line 1532 of file papi_1.c.

1532  {
1533  int xRC;
1534 
1535  printf("==> Do_Multiplex_Tests(): Beginning of the main body...\n");
1536 
1537  xRC = PAPI_multiplex_init();
1538  if (xRC == PAPI_OK)
1539  printf("SUCCESS: PAPI_multiplex_init...\n");
1540  else
1541  printf("FAILURE: PAPI_multiplex_init failed, returned xRC=%d...\n", xRC);
1542 
1543  printf("==> Do_Multiplex_Tests(): End of the main body...\n");
1544 
1545  return;
1546 }
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
int PAPI_multiplex_init(void)
Definition: papi.c:2926

Here is the call graph for this function:

Here is the caller graph for this function:

void Do_Tests ( void  )

Definition at line 244 of file papi_1.c.

244  {
245  printf("==> Do_Tests(): Beginning of the main body...\n");
246 
247  // NOTE: PAPI_library_init() has already been done for each participating node
248  // prior to calling this routine...
249 
252  Do_Multiplex_Tests(); // NOTE: Not supported...
253  PAPI_shutdown();
254 
255  printf("==> Do_Tests(): End of the main body...\n");
256  fflush(stdout);
257 
258  return;
259 }
void Do_High_Level_Tests(void)
Definition: papi_1.c:1118
fflush(stdout)
#define printf
Definition: papi_test.h:125
void Do_Multiplex_Tests(void)
Definition: papi_1.c:1532
void PAPI_shutdown(void)
Definition: papi.c:4400
void Do_Low_Level_Tests(void)
Definition: papi_1.c:265

Here is the call graph for this function:

Here is the caller graph for this function:

void DumpInHex ( const char *  pBuffer,
int  pSize 
)

Definition at line 2089 of file papi_1.c.

2089  {
2090 
2091  return;
2092 }

Here is the caller graph for this function:

void FPUArith ( void  )

Definition at line 1645 of file papi_1.c.

1645  {
1646  int i;
1647 
1648  printf("\n==> Start: Performing arithmetic...\n");
1649  register unsigned int zero = 0;
1650  register double *x_p = &x[0];
1651 
1652  for ( i = 0; i < 32; i++ )
1653  x[i] = 1.0;
1654 
1655  // Single Hummer Instructions:
1656 
1657  #if 1
1658 
1659  asm volatile ("fabs 1,2");
1660  asm volatile ("fmr 1,2");
1661  asm volatile ("fnabs 1,2");
1662  asm volatile ("fneg 1,2");
1663 
1664  asm volatile ("fadd 1,2,3");
1665  asm volatile ("fadds 1,2,3");
1666  asm volatile ("fdiv 1,2,3");
1667  asm volatile ("fdivs 1,2,3");
1668  asm volatile ("fmul 1,2,3");
1669  asm volatile ("fmuls 1,2,3");
1670  asm volatile ("fres 1,2");
1671  asm volatile ("frsqrte 1,2");
1672  //asm volatile ("fsqrt 1,2"); // gives exception
1673  //asm volatile ("fsqrts 1,2"); // gives exception
1674  asm volatile ("fsub 1,2,3");
1675  asm volatile ("fsubs 1,2,3");
1676 
1677  asm volatile ("fmadd 3,4,5,6");
1678  asm volatile ("fmadds 3,4,5,6");
1679  asm volatile ("fmsub 3,4,5,6");
1680  asm volatile ("fmsubs 3,4,5,6");
1681  asm volatile ("fnmadd 3,4,5,6");
1682  asm volatile ("fnmadds 3,4,5,6");
1683  asm volatile ("fnmsub 3,4,5,6");
1684  asm volatile ("fnmsubs 3,4,5,6");
1685 
1686  //asm volatile ("fcfid 5,6"); // invalid instruction
1687  //asm volatile ("fctid 5,6"); // invalid instruction
1688  //asm volatile ("fctidz 5,6"); // invalid instruction
1689  asm volatile ("fctiw 5,6");
1690  asm volatile ("fctiwz 5,6");
1691  asm volatile ("frsp 5,6");
1692 
1693  asm volatile ("fcmpo 0,1,2");
1694  asm volatile ("fcmpu 0,1,2");
1695  asm volatile ("fsel 0,1,2,3");
1696 
1697  #endif
1698 
1699  #if 1
1700 
1701  asm volatile("fpadd 9,10,11");
1702  asm volatile("fpsub 9,10,11");
1703 
1704  #endif
1705 
1706 
1707  #if 1
1708 
1709  asm volatile("fpmul 23,24,25");
1710  asm volatile("fxmul 26, 27, 28");
1711  asm volatile("fxpmul 28, 29, 30");
1712  asm volatile("fxsmul 2, 3, 4");
1713  #endif
1714 
1715  #if 1
1716 
1717  asm volatile("fpmadd 10,11,12,13");
1718  asm volatile("fpmsub 18, 19, 20, 21");
1719  asm volatile("fpnmadd 26, 27, 28, 29");
1720  asm volatile("fpnmsub 16,17,18,19");
1721 
1722  asm volatile("fxmadd 10,11,12,13");
1723  asm volatile("fxmsub 18, 19, 20, 21");
1724  asm volatile("fxnmadd 26, 27, 28, 29");
1725  asm volatile("fxnmsub 16,17,18,19");
1726 
1727  asm volatile("fxcpmadd 10,11,12,13");
1728  asm volatile("fxcpmsub 18, 19, 20, 21");
1729  asm volatile("fxcpnmadd 26, 27, 28, 29");
1730  asm volatile("fxcpnmsub 16,17,18,19");
1731 
1732  asm volatile("fxcsmadd 10,11,12,13");
1733  asm volatile("fxcsmsub 18, 19, 20, 21");
1734  asm volatile("fxcsnmadd 26, 27, 28, 29");
1735  asm volatile("fxcsnmsub 16,17,18,19");
1736 
1737  asm volatile("fxcpnpma 1,2,3,4");
1738  asm volatile("fxcsnpma 5,6,7,8");
1739  asm volatile("fxcpnsma 9,10,11,12");
1740  asm volatile("fxcsnsma 3,4,5,6");
1741 
1742  asm volatile("fxcxnpma 9,10,11,12");
1743  asm volatile("fxcxnsma 8,9,10,11");
1744  asm volatile("fxcxma 3,4,5,6");
1745  asm volatile("fxcxnms 8,9,10,11");
1746 
1747  #endif
1748 
1749 
1750  #if 1
1751 
1752  asm volatile("fpre 12, 13");
1753  asm volatile("fprsqrte 15, 16");
1754  asm volatile("fpsel 17, 18, 19, 20");
1755  asm volatile("fpctiw 1,2");
1756  asm volatile("fpctiwz 3,4");
1757  asm volatile("fprsp 5,6");
1758  asm volatile("fscmp 1,2,3");
1759  asm volatile("fpmr 1,2");
1760  asm volatile("fpneg 1,2");
1761  asm volatile("fpabs 1,2");
1762  asm volatile("fpnabs 1,2");
1763  asm volatile("fsmr 1,2");
1764  asm volatile("fsneg 1,2");
1765  asm volatile("fsabs 1,2");
1766  asm volatile("fsnabs 1,2");
1767  asm volatile("fxmr 1,2");
1768  asm volatile("fsmfp 1,2");
1769  asm volatile("fsmtp 1,2");
1770 
1771  #endif
1772 
1773  #if 1
1774  asm volatile("lfdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1775  asm volatile("lfdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1776  asm volatile("lfsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1777  asm volatile("lfsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1778 
1779  asm volatile("lfsdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1780  asm volatile("lfsdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1781  asm volatile("lfssx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1782  asm volatile("lfssux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1783 
1784  asm volatile("lfpsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1785  asm volatile("lfpsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1786  asm volatile("lfxsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1787  asm volatile("lfxsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1788  #endif
1789 
1790  #if 1
1791  asm volatile("lfpdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1792  asm volatile("lfpdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1793  asm volatile("lfxdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1794  asm volatile("lfxdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1795  #endif
1796 
1797  #if 1
1798  asm volatile("stfdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1799  asm volatile("stfdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1800  asm volatile("stfsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1801  asm volatile("stfsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1802 
1803  asm volatile("stfsdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1804  asm volatile("stfsdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1805  asm volatile("stfssx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1806  //asm volatile("stfssux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1807 
1808  asm volatile("stfpsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1809  asm volatile("stfpsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1810  asm volatile("stfxsx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1811  asm volatile("stfxsux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1812  #endif
1813 
1814  #if 1
1815  asm volatile("stfpdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1816  asm volatile("stfpdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1817  asm volatile("stfxdx 16,%0,%1" : "+b"(x_p) : "b"(zero));
1818  asm volatile("stfxdux 16,%0,%1" : "+b"(x_p) : "b"(zero));
1819  #endif
1820  printf("==> End: Performing arithmetic...\n");
1821 
1822  return;
1823 }
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
int x
Definition: fileop.c:78

Here is the caller graph for this function:

void List_PAPI_Events ( const int  pEventSet,
int pEvents,
int xNumEvents 
)

Definition at line 2075 of file papi_1.c.

2075  {
2076  int xRC = PAPI_list_events(pEventSet, pEvents, pNumEvents);
2077  if (xRC != PAPI_OK) {
2078  printf("FAILURE: PAPI_list_events failed, returned xRC=%d...\n", xRC);
2079  exit(1);
2080  }
2081 
2082  return;
2083 }
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
void exit()
int PAPI_list_events(int EventSet, int *Events, int *number)
Definition: papi.c:5927

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 105 of file papi_1.c.

105  {
106  _BGP_Personality_t personality;
107  int pRank=0, pMode=-2, pCore=0, pEdge=1, xActiveCore=0, xActiveRank=0, xRC;
108 
109  /*
110  * Check args, print test inputs.
111  */
112 
113  if ( argc > 1 )
114  sscanf(argv[1], "%d", &pRank);
115  if ( argc > 2 )
116  sscanf(argv[2], "%d", &pMode);
117  if ( argc > 3 )
118  sscanf(argv[3], "%d", &pCore);
119  if ( argc > 4 )
120  sscanf(argv[4], "%d", &pEdge);
121 
122 /*
123  * Check for valid rank...
124  */
125  if ( pRank < 0 || pRank > 31 ) {
126  printf("Invalid rank (%d) specified\n", pRank);
127  exit(1);
128  }
129 /*
130  * Check for valid mode...
131  * Mode = -2 means use what was initialized by CNK
132  * Mode = -1 means to initialize with the default
133  * Mode = 0-3 means to initialize with mode 0-3
134  */
135  if ( pMode < -2 || pMode > 3 ) {
136  printf("Invalid mode (%d) specified\n", pMode);
137  exit(1);
138  }
139 /*
140  * Check for valid core...
141  */
142  if ( pCore < 0 || pCore > 3 ) {
143  printf("Invalid core (%d) specified\n", pCore);
144  exit(1);
145  }
146 /*
147  * Check for valid edge...
148  * Edge = 1 means initialize with the default edge
149  * Edge = 0 means initialize with level high
150  * Edge = 4 means initialize with edge rise
151  * Edge = 8 means initialize with edge fall
152  * Edge = 12 means initialize with level low
153  */
154  if ( pEdge != 0 && pEdge != 1 && pEdge != 4 && pEdge != 8 && pEdge != 12 ) {
155  printf("Invalid edge (%d) specified\n", pEdge);
156  exit(1);
157  }
158 
159 /*
160  * Initialize the UPC environment...
161  * NOTE: Must do this from all 'ranks'...
162  */
163 // BGP_UPC_Initialize();
165  if (xRC != 50921472) {
166  printf("PAPI_library_init failed: xRC=%d, ending...\n", xRC);
167  exit(1);
168  }
169 
170 /*
171  * Only run if this is specified rank...
172  */
173 
174  xRC = Kernel_GetPersonality(&personality, sizeof(_BGP_Personality_t));
175  if (xRC !=0) {
176  printf(" Kernel_GetPersonality returned %d\n",xRC) ;
177  exit(xRC);
178  }
179  xActiveRank = personality.Network_Config.Rank;
180  xActiveCore = Kernel_PhysicalProcessorID();
181 
182  printf("Rank %d, core %d reporting...\n", xActiveRank, xActiveCore);
183 
184  if (xActiveRank != pRank) {
185  printf("Rank %d is not to run... Exiting...\n", xActiveRank);
186  exit(0);
187  }
188 
189  if ( xActiveCore == pCore ) {
190  printf("Program is to run on rank %d core %d, using mode= %d, edge= %d\n", pRank, xActiveCore, pMode, pEdge);
191  }
192  else {
193  printf("Program is NOT to run on rank %d core %d... Exiting...\n", pRank, xActiveCore);
194  exit(0);
195  }
196 
197 /*
198  * Main processing...
199  */
200  printf("************************************************************\n");
201  printf("* Configuration parameters used: *\n");
202  printf("* Rank = %d *\n", pRank);
203  printf("* Mode = %d *\n", pMode);
204  printf("* Core = %d *\n", pCore);
205  printf("* Edge = %d *\n", pEdge);
206  printf("************************************************************\n\n");
207 
208  printf("Print config after PAPI_library_init...\n");
209  BGP_UPC_Print_Config();
210 
211 /*
212  * If we are to initialize, do so with user mode and edge...
213  * Otherwise, use what was initialized by CNK...
214  */
215  if (pMode > -2) {
216  BGP_UPC_Initialize_Counter_Config(pMode, pEdge);
217  printf("UPC unit(s) initialized with mode=%d, edge=%d...\n", pMode, pEdge);
218  }
219 
220  printf("Before running the main test procedure...\n");
221  BGP_UPC_Print_Config();
222  BGP_UPC_Print_Counter_Values(BGP_UPC_READ_EXCLUSIVE);
223 
224 /*
225  * Perform the main test procedure...
226  */
227  Do_Tests();
228 
229 /*
230  * Print out final configuration and results...
231  */
232  printf("After running the main test procedure...\n");
233  BGP_UPC_Print_Config();
234  BGP_UPC_Print_Counter_Values(BGP_UPC_READ_EXCLUSIVE);
235 
236  exit(0);
237 }
#define printf
Definition: papi_test.h:125
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
int PAPI_library_init(int version)
Definition: papi.c:497
sscanf(mnc->m_child_port,"%d",&mc.m_child_port)
void Do_Tests(void)
Definition: papi_1.c:244
#define PAPI_VER_CURRENT
Definition: papi.h:223
void exit()

Here is the call graph for this function:

void Print_Counter_Values ( const long long pCounters,
const int  pNumCounters 
)

Definition at line 1990 of file papi_1.c.

1990  {
1991  int i=0, j, xEnd;
1992  long long xCounters[NUMBER_COUNTERS_PER_ROW];
1993  printf("Print_Counter_Values: Native_Buffer*=%p, pCounters*=%p\n", Native_Buffer, pCounters);
1994  printf("Number of Counters = %d\n", pNumCounters);
1995  if (pNumCounters) {
1996  printf(" +0 +1 +2 +3 +4 +5 +6 +7\n");
1997  printf("---------------------------------------------------------------------------------------------\n");
1999  while (i < xEnd) {
2000  for (j=0; j<NUMBER_COUNTERS_PER_ROW; j++) {
2001  if (i+j < pNumCounters) {
2002  xCounters[j] = pCounters[i+j];
2003  }
2004  else
2005  xCounters[j] = -1;
2006  }
2007  printf("Ctrs %3.3d-%3.3d: %8lld %8lld %8lld %8lld %8lld %8lld %8lld %8lld\n",
2008  i, i+7, xCounters[0], xCounters[1], xCounters[2], xCounters[3], xCounters[4],
2009  xCounters[5], xCounters[6], xCounters[7]);
2011  }
2012  }
2013 
2014  return;
2015 }
char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
Definition: papi_1.c:97
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
#define NUMBER_COUNTERS_PER_ROW
Definition: papi_1.c:66
long j
Definition: iozone.c:19135

Here is the caller graph for this function:

void Print_Counters ( const int  pEventSet)

Definition at line 1829 of file papi_1.c.

1829  {
1830  printf("\n***** Start Print Counter Values *****\n");
1831 // Print_Native_Counters_via_Buffer((BGP_UPC_Read_Counters_Struct_t*)Native_Buffer);
1832 // Print_Native_Counters();
1834  Print_PAPI_Counters(pEventSet, PAPI_Counters);
1835  printf("\n***** End Print Counter Values *****\n");
1836 
1837  return;
1838 }
void Print_PAPI_Counters(const int pEventSet, const long long *pCounters)
Definition: papi_1.c:1935
void Print_Native_Counters_for_PAPI_Counters(const int pEventSet)
Definition: papi_1.c:1858
#define printf
Definition: papi_test.h:125
long long PAPI_Counters[MAX_COUNTERS]
Definition: papi_1.c:96

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_Native_Counters ( )

Definition at line 1845 of file papi_1.c.

1845  {
1846  printf("\n***** Start Print of Native Counter Values *****\n");
1847  BGP_UPC_Print_Counter_Values(BGP_UPC_READ_EXCLUSIVE);
1848  printf("***** End Print of Native Counter Values *****\n");
1849 
1850  return;
1851 }
#define printf
Definition: papi_test.h:125

Here is the caller graph for this function:

void Print_Native_Counters_for_PAPI_Counters ( const int  pEventSet)

Definition at line 1858 of file papi_1.c.

1858  {
1859  printf("\n***** Start Print of Native Counter Values for PAPI Counters *****\n");
1860  int xNumEvents = PAPI_num_events(pEventSet);
1861  if (xNumEvents) {
1862  List_PAPI_Events(pEventSet, PAPI_Events, &xNumEvents);
1864  }
1865  else {
1866  printf("No events are present in the event set.\n");
1867  }
1868  printf("***** End Print of Native Counter Values for PAPI Counters *****\n");
1869 
1870  return;
1871 }
void List_PAPI_Events(const int pEventSet, int *pEvents, int *xNumEvents)
Definition: papi_1.c:2075
#define printf
Definition: papi_test.h:125
int PAPI_num_events(int EventSet)
Definition: papi.c:4365
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95
void Print_Native_Counters_for_PAPI_Counters_From_List(const int *pEvents, const int pNumEvents)
Definition: papi_1.c:1877

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_Native_Counters_for_PAPI_Counters_From_List ( const int pEvents,
const int  pNumEvents 
)

Definition at line 1877 of file papi_1.c.

1877  {
1878  int i, j, xRC;
1879  char xName[256];
1880  BGP_UPC_Event_Id_t xNativeEventId;
1881  PAPI_event_info_t xEventInfo;
1882 
1883 // BGP_UPC_Print_Counter_Values(); // DLH
1884  for (i=0; i<pNumEvents; i++) {
1885  xRC = PAPI_event_code_to_name(PAPI_Events[i], xName);
1886  if (!xRC) {
1887  xRC = PAPI_get_event_info(PAPI_Events[i], &xEventInfo);
1888  if (xRC) {
1889  printf("FAILURE: PAPI_get_event_info failed for %s, xRC=%d\n", xName, xRC);
1890  exit(1);
1891  }
1892  printf("\n *** PAPI Counter Location %3.3d: %#8.8x %s\n", i, PAPI_Events[i], xName);
1893  if (PAPI_Events[i] & 0x80000000) {
1894  // Preset event
1895  for (j=0; j<xEventInfo.count; j++) {
1896  xNativeEventId = (BGP_UPC_Event_Id_t)(xEventInfo.code[j]&0xBFFFFFFF);
1897 // printf("Preset: j=%d, xEventInfo.code[j]=%#8.8x, xNativeEventId=%#8.8x\n", j, xEventInfo.code[j], xNativeEventId);
1898  BGP_UPC_Print_Counter_Value(xNativeEventId, BGP_UPC_READ_EXCLUSIVE);
1899  }
1900  }
1901  else {
1902  // Native event
1903  xNativeEventId = (BGP_UPC_Event_Id_t)(PAPI_Events[i]&0xBFFFFFFF);
1904 // printf("Native: i=%d, PAPI_Events[i]=%#8.8x, xNativeEventId=%#8.8x\n", i, PAPI_Events[i], xNativeEventId);
1905  BGP_UPC_Print_Counter_Value(xNativeEventId, BGP_UPC_READ_EXCLUSIVE);
1906  }
1907  }
1908  else {
1909  printf("\n *** PAPI Counter Location %3.3d: Not mapped\n", i);
1910  }
1911  }
1912 }
unsigned int count
Definition: papi.h:984
#define printf
Definition: papi_test.h:125
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
Definition: papi.c:846
int i
Definition: fileop.c:140
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
unsigned int code[PAPI_MAX_INFO_TERMS]
Definition: papi.h:1000
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95
long j
Definition: iozone.c:19135
void exit()

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_Native_Counters_via_Buffer ( const BGP_UPC_Read_Counters_Struct_t *  pBuffer)

Definition at line 1919 of file papi_1.c.

1919  {
1920  Read_Native_Counters(BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE);
1921  printf("\n***** Start Print of Native Counter Values *****\n");
1922  printf("Elapsed Running Time (native) = %lld\n", (*pBuffer).elapsed_time);
1923 // printf("Print_Native_Counters_via_Buffer: Native_Buffer*=%p, pBuffer=%p, (*pBuffer).counter=%p\n", Native_Buffer, pBuffer, (*pBuffer).counter);
1924  Print_Counter_Values((long long*)(*pBuffer).counter, pBuffer->number_of_counters);
1925  printf("***** End Print of Native Counter Values *****\n");
1926 
1927  return;
1928 }
void Read_Native_Counters(const int pLength)
Definition: papi_1.c:2041
#define printf
Definition: papi_test.h:125
void Print_Counter_Values(const long long *pCounters, const int pNumCounters)
Definition: papi_1.c:1990

Here is the call graph for this function:

void Print_Node_Info ( void  )

Definition at line 2020 of file papi_1.c.

2020  {
2021  Read_Native_Counters(BGP_UPC_MINIMUM_LENGTH_READ_COUNTERS_STRUCTURE);
2022  BGP_UPC_Read_Counters_Struct_t* xTemp;
2023  xTemp = (BGP_UPC_Read_Counters_Struct_t*)(void*)Native_Buffer;
2024  printf("***** Start Print of Node Information *****\n");
2025  printf("Rank = %d\n", xTemp->rank);
2026  printf("Core = %d\n", xTemp->core);
2027  printf("UPC Number = %d\n", xTemp->upc_number);
2028  printf("Number of Processes per UPC = %d\n", xTemp->number_processes_per_upc);
2029  printf("User Mode = %d\n", (int) xTemp->mode);
2030  printf("Location = %s\n", xTemp->location);
2031  printf("\n***** End Print of Node Information *****\n\n");
2032 
2033  return;
2034 }
void Read_Native_Counters(const int pLength)
Definition: papi_1.c:2041
char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
Definition: papi_1.c:97
#define printf
Definition: papi_test.h:125

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_PAPI_Counters ( const int  pEventSet,
const long long pCounters 
)

Definition at line 1935 of file papi_1.c.

1935  {
1936  int i;
1937  char xName[256];
1938  printf("\n***** Start Print of PAPI Counter Values *****\n");
1939 // printf("Print_PAPI_Counters: PAPI_Counters*=%p, pCounters*=%p\n", PAPI_Counters, pCounters);
1940  int pNumEvents = PAPI_num_events(pEventSet);
1941  printf("Number of Counters = %d\n", pNumEvents);
1942  if (pNumEvents) {
1943  printf(" Calculated Value Location Event Number Event Name\n");
1944  printf("-------------------- -------- ------------ --------------------------------------------\n");
1945  List_PAPI_Events(pEventSet, PAPI_Events, &pNumEvents);
1946  for (i=0; i<pNumEvents; i++) {
1947  if (PAPI_event_code_to_name(PAPI_Events[i], xName)) {
1948  printf("PAPI_event_code_to_name failed on event code %d\n", PAPI_Events[i]);
1949  exit(1);
1950  }
1951  printf("%20llu %3d %#8.8x %s\n", pCounters[i], i, PAPI_Events[i], xName);
1952  }
1953  }
1954  printf("***** End Print of PAPI Counter Values *****\n");
1955 
1956  return;
1957 }
void List_PAPI_Events(const int pEventSet, int *pEvents, int *xNumEvents)
Definition: papi_1.c:2075
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
int PAPI_num_events(int EventSet)
Definition: papi.c:4365
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95
void exit()

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_PAPI_Counters_From_List ( const int pEventList,
const int  pNumEvents,
const long long pCounters 
)

Definition at line 1964 of file papi_1.c.

1964  {
1965  int i;
1966  char xName[256];
1967  printf("\n***** Start Print of PAPI Counter Values *****\n");
1968  printf("Number of Counters = %d\n", pNumEvents);
1969  if (pNumEvents) {
1970  printf(" Calculated Value Location Event Number Event Name\n");
1971  printf("-------------------- -------- ------------ --------------------------------------------\n");
1972  for (i=0; i<pNumEvents; i++) {
1973  if (PAPI_event_code_to_name(pEventList[i], xName)) {
1974  printf("PAPI_event_code_to_name failed on event code %d\n", pEventList[i]);
1975  exit(1);
1976  }
1977  printf("%20llu %3d %#8.8x %s\n", pCounters[i], i, pEventList[i], xName);
1978  }
1979  }
1980  printf("***** End Print of PAPI Counter Values *****\n");
1981 
1982  return;
1983 }
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
void exit()

Here is the call graph for this function:

Here is the caller graph for this function:

void Print_PAPI_Events ( const int  pEventSet)

Definition at line 2056 of file papi_1.c.

2056  {
2057  int i;
2058  char xName[256];
2059  int pNumEvents = PAPI_num_events(pEventSet);
2060  List_PAPI_Events(pEventSet, PAPI_Events, &pNumEvents);
2061  for (i=0; i<pNumEvents; i++) {
2062  if (!PAPI_event_code_to_name(PAPI_Events[i], xName))
2063  printf("PAPI Counter Location %3.3d: %#8.8x %s\n", i, PAPI_Events[i], xName);
2064  else
2065  printf("PAPI Counter Location %3.3d: Not mapped\n", i);
2066  }
2067 
2068  return;
2069 }
void List_PAPI_Events(const int pEventSet, int *pEvents, int *xNumEvents)
Definition: papi_1.c:2075
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
int PAPI_num_events(int EventSet)
Definition: papi.c:4365
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95

Here is the call graph for this function:

void Read_Native_Counters ( const int  pLength)

Definition at line 2041 of file papi_1.c.

2041  {
2042 
2043  int xRC = BGP_UPC_Read_Counter_Values(Native_Buffer, pLength, BGP_UPC_READ_EXCLUSIVE);
2044  if (xRC < 0) {
2045  printf("FAILURE: BGP_UPC_Read_Counter_Values failed, xRC=%d...\n", xRC);
2046  exit(1);
2047  }
2048 
2049  return;
2050 }
char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
Definition: papi_1.c:97
#define printf
Definition: papi_test.h:125
void exit()

Here is the call graph for this function:

Here is the caller graph for this function:

void Run_Cycle ( const int  pNumEvents)

Definition at line 1549 of file papi_1.c.

1549  {
1550  int xRC;
1551 
1552 // BGP_UPC_Zero_Counter_Values();
1554  xRC = PAPI_start_counters(PAPI_Events, pNumEvents);
1555  if (xRC == PAPI_OK)
1556  printf("SUCCESS: PAPI_start_counters...\n");
1557  else
1558  printf("FAILURE: PAPI_start_counters failed, returned xRC=%d...\n", xRC);
1559 
1562  FPUArith();
1565 
1566  FPUArith();
1567 
1568  xRC = PAPI_read_counters(PAPI_Counters, pNumEvents);
1569  if (xRC == PAPI_OK)
1570  printf("SUCCESS: PAPI_read_counters...\n");
1571  else
1572  printf("FAILURE: PAPI_read_counters failed, returned xRC=%d...\n", xRC);
1573 
1576  FPUArith();
1579 
1580  FPUArith();
1581 
1583  xRC = PAPI_accum_counters(PAPI_Counters, pNumEvents);
1584  if (xRC == PAPI_OK)
1585  printf("SUCCESS: PAPI_accum_counters...\n");
1586  else
1587  printf("FAILURE: PAPI_accum_counters failed, returned xRC=%d...\n", xRC);
1588 
1591  FPUArith();
1594 
1595  FPUArith();
1596 
1597  xRC = PAPI_read_counters(PAPI_Counters, pNumEvents);
1598  if (xRC == PAPI_OK)
1599  printf("SUCCESS: PAPI_read_counters...\n");
1600  else
1601  printf("FAILURE: PAPI_read_counters failed, returned xRC=%d...\n", xRC);
1602 
1605  FPUArith();
1608 
1609  FPUArith();
1610 
1611  xRC = PAPI_stop_counters(PAPI_Counters, pNumEvents);
1612  if (xRC == PAPI_OK)
1613  printf("SUCCESS: PAPI_stop_counters...\n");
1614  else
1615  printf("FAILURE: PAPI_stop_counters failed, returned xRC=%d...\n", xRC);
1616 
1619  FPUArith();
1622 
1623  FPUArith();
1624 
1625  return;
1626 }
void FPUArith(void)
Definition: papi_1.c:1645
void Print_Native_Counters()
Definition: papi_1.c:1845
int PAPI_accum_counters(long long *values, int array_len)
Definition: papi_hl.c:756
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
long long PAPI_Counters[MAX_COUNTERS]
Definition: papi_1.c:96
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:803
void Print_PAPI_Counters_From_List(const int *pEventList, const int pNumEvents, const long long *pCounters)
Definition: papi_1.c:1964
int PAPI_read_counters(long long *values, int array_len)
Definition: papi_hl.c:706
int PAPI_start_counters(int *events, int array_len)
Definition: papi_hl.c:593
int PAPI_Events[MAX_COUNTERS]
Definition: papi_1.c:95
void Print_Native_Counters_for_PAPI_Counters_From_List(const int *pEvents, const int pNumEvents)
Definition: papi_1.c:1877
void Zero_Local_Counters(long long *pCounters)
Definition: papi_1.c:1633

Here is the call graph for this function:

Here is the caller graph for this function:

void Zero_Local_Counters ( long long pCounters)

Definition at line 1633 of file papi_1.c.

1633  {
1634  int i;
1635  for (i=0; i<255; i++)
1636  pCounters[i] = 0;
1637 
1638  return;
1639 }
int i
Definition: fileop.c:140

Here is the caller graph for this function:

Variable Documentation

double x [32] ALIGN_L3_CACHE

Definition at line 98 of file papi_1.c.

const int MaxNativeEventId = 511

Definition at line 103 of file papi_1.c.

const int MaxPresetEventId = 104

Definition at line 102 of file papi_1.c.

char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]

Definition at line 97 of file papi_1.c.

const int NumEventsPerSet = MAX_COUNTERS

Definition at line 101 of file papi_1.c.

long long PAPI_Counters[MAX_COUNTERS]

Definition at line 96 of file papi_1.c.

int PAPI_Events[MAX_COUNTERS]

Definition at line 95 of file papi_1.c.