|
|
Check if you have enough Huge pages:
|
|
|
```
|
|
|
cat /proc/sys/vm/nr_hugepages
|
|
|
```
|
|
|
|
|
|
If you need more:
|
|
|
```
|
|
|
echo 32 > /proc/sys/vm/nr_hugepages
|
|
|
```
|
|
|
|
|
|
In this repo, there are 2 files in the common directory with the routines. ( alloc_hp.{h,c} )
|
|
|
In your c code (example):
|
|
|
```
|
|
|
int number_of_elements = 100000;
|
|
|
double* X = (double*) malloc_hp(number_of_elements*sizeof(double));
|
|
|
|
|
|
[...]
|
|
|
free_hp(X, number_of_elements*sizeof(double));
|
|
|
|
|
|
```
|
|
|
|