Skip to content

Commit

Permalink
V1.1.3 (#25)
Browse files Browse the repository at this point in the history
* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

* v1.1.0 (#4) (#8)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* Fix P & Q

* updates in R (#9)

* Fix error in R

* Fix using of openblas (#16)

* Update main (#19)

* V1.1.1 (#15)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

* v1.1.0 (#4) (#8)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* Fix P & Q

* updates in R (#9)

* Fix error in R

* Fix using of openblas (#16)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* V1.1.2 (#17)

* Fixed cmake installation and add  requirements in ReadME

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* Fix for zero values in locations (#20)

* update devel (#21)

* Fix tlr in R (#24)

* V1.1.1 (#15)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

* v1.1.0 (#4) (#8)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* Fix P & Q

* updates in R (#9)

* Fix error in R

* Fix using of openblas (#16)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* V1.1.2 (#17)

* Fixed cmake installation and add  requirements in ReadME

* All fixes for hicma

* Modify README.md (#22)

* modify README.md

* more edits to README.md

* more minor edits

* more minor edits to the R example

* fix the R code

* remove empty line

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>
Co-authored-by: Sameh Abdulah <23186151+SAbdulah@users.noreply.github.com>

* Ft add accuracy tlr (#26)

* V1.1.1 (#15)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

* v1.1.0 (#4) (#8)

* add the pow_exp kernel and tested

* all fixes

* resolve threads plus some modifications

* Fix cuda

* fix for linking cuda

* fix: hicma modifactions

* try fixing Jenkines

* Adding R structure

* fix:add doxygen in Jenkines

* add test file for pow-exp kernel

* test with -fpic

* some modifications for HiCMA

* updates

* try 2 gpu devices

* back to starsh

* a potential fix to doxygen

* roll back

* test Rcpp

* Fix Jenkines

* fix errors

* Updated in design

* updates

* all release issue without src checks

* adding MakeFile

* Updated MPI

* Documentation

* fix examples tests

* modeling takes pointers

* example for read and write data

* fix: typpo in Initialize

* fix passing numbers of theta

* fix: performance of gsl

* fix: GPU support

* fix:mspe

* updated devel

* R branch init

* tests:add r tests

* fix tests

* bug: in tlr

* fix:tlr

* fix Jenkines

* fix: Jenkines in Documentation

* minior updates

* huge refactoring

* full R

* potential for tlr issue

* updates in heavy tests

* a fix for gpu in gaussian kernels

* smalling tlr size

* update sizes of heavy_tests

* smalling size for gpu

* minior changes

* Huge refactoring in docs

* resolve threads

* fix MPI

* resolve thread

* updated R documentation

* documentation and hardware changes

* finalized documentations

* minior change in Hardware

* Ft test mpi mk (#6)

* solve multi thread issue in MPI

* Fix MPI tests with chameleon

* Fixed HiCMA with MPI

* update license

* minior cleanings (#7)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* Fix P & Q

* updates in R (#9)

* Fix error in R

* Fix using of openblas (#16)

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>

* V1.1.2 (#17)

* Fixed cmake installation and add  requirements in ReadME

* All fixes for hicma

* Modify README.md (#22)

* modify README.md

* more edits to README.md

* more minor edits

* more minor edits to the R example

* fix the R code

* remove empty line

* debuging prints

* cleaner version

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>
Co-authored-by: Sameh Abdulah <23186151+SAbdulah@users.noreply.github.com>

* change value of acc

* update params values

---------

Co-authored-by: Sameh M. Abdulah <abdullsm@kw60194.kaust.edu.sa>
Co-authored-by: Mahmoud Karargy <x_karargma@almaha.kaust.edu.sa>
Co-authored-by: Sameh Abdulah <23186151+SAbdulah@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 25, 2025
1 parent 73d4cbe commit 1b629f4
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 26 deletions.
118 changes: 104 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To build and run this software, you will need:
6. [R](https://cran.r-project.org/bin/windows/base/) (only if you plan on using the R functionality)

### C++ source code installation
To install the `ExaGeoStat` project locally, run the following commands in your terminal:
To install the `ExaGeoStatCPP` project locally (C++ version), run the following commands in your terminal:

1. Clone the project from the remote gitHub repository into your local machine using the following command
```bash
Expand All @@ -78,14 +78,14 @@ To install the `ExaGeoStat` project locally, run the following commands in your
cd ExaGeoStatCPP
```

3. Run `configure` script with the flag `-h` for help, to know the supported options and their corresponding flags.
3. Run `configure` script (use the `-h` flag for help, to know the supported options and their corresponding flags). This step is **not required** when using R.
```bash
./configure -h
./configure -e
```

4. Run `clean_build.sh` script with the flag `-h` for help, to know the needed arguments to run with your specific options.
4. Run `clean_build.sh` (use the `-h` flag for help, to know the needed arguments to run with your specific options). This step is **not required** when using R.
```bash
./clean_build.sh -h
./clean_build.sh
```

5. Export the installation paths of the dependencies to your `.bashrc` file, e.g.
Expand All @@ -99,18 +99,56 @@ ExaGeoStatCPP.
### R package installation
1. Open the R prompt window by simply running `R` command in the terminal, inside the prompt, we will install needed packages by running the following commands:
```R
install.packages(Rcpp)
install.packages("assert")
install.packages("Rcpp")
install.packages("assertthat")
```

2. close the R prompt and return to the terminal. Run the following command, make sure your current path is the ExaGeoStat project directory
2. close the R prompt and return to the terminal. Run the following command, make sure your current path is the ExaGeoStatCPP project directory

```commandline
R CMD INSTALL . --configure-args="-r"
```

> For more detailed information on installing ExaGeoStat with different configurations and enabling technologies such as CUDA, MPI, R, etc., please refer to the [User Manual](USER_MANUAL.md)
## Common Installation Errors and Solutions

### 1. Missing CMake
The installation requires **CMake** version 3.2 or higher. Ensure it is installed on your system before proceeding with the installation of **ExaGeoStatCPP**.

To install CMake, use:
```sh
sudo apt install cmake
```

### 2. Missing Libtool
If you encounter the following error during installation:
```
./autogen.sh: line 17: libtool: command not found
./autogen.sh: line 20: glibtool: command not found
```
This indicates that **Libtool** is missing. You can install it using:
```sh
sudo apt install libtool libtool-bin
```

Alternatively, you can install **Libtool** locally:
```sh
wget http://ftpmirror.gnu.org/libtool/libtool-2.4.7.tar.gz
tar -xvzf libtool-2.4.7.tar.gz
cd libtool-2.4.7
./configure --prefix=$HOME/local
make
make install
```
Then, update your environment variables:
```sh
export PATH=$HOME/local/bin:$PATH
export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$PKG_CONFIG_PATH
```
After this, restart your terminal or run `source ~/.bashrc` to apply the changes.


## Usage
#### C++ Example
Expand All @@ -135,14 +173,66 @@ int main(int argc, char **argv) {
return 0;
}
```
### R Example:
```R
## R Example
Here is an example demonstrating how to use **ExaGeoStatCPP** in R:
```r
# Load the ExaGeoStatCPP library
library(ExaGeoStatCPP)
# Set parameters for the simulation
ncores <- 30
ngpus <- 0
problem_size <- 1600
dts <- 320
lts <- 0
computation <- "exact"
dimension <- "2D"
kernel <- "univariate_matern_stationary"
initial_theta <- c(1,0.1,0.5)
lower_bound <- c(0.1,0.1,0.1)
upper_bound <- c(5,5,5)
p <- 1
q <- 1
opt_itrs <- 100
# Initialize hardware configuration
hardware <- new(Hardware, computation, ncores, ngpus, p, q)
exageostat_data <- simulate_data(kernel=kernel, initial_theta=initial_theta, problem_size=problem_size, dts=dts, dimension=dimension)
estimated_theta <- model_data(data=exageostat_data, kernel=kernel, dts=dts, dimension=dimension,lb=lower_bound, ub=upper_bound, mle_itr=10)
predict_data(train_data=list(x, y, z_measurement), test_data=list(test_x, test_y), kernel=kernel, dts=dts, estimated_theta=estimated_theta)
# Simulate spatial data based on the specified kernel and parameters
exageostat_data <- simulate_data(
kernel = kernel,
initial_theta = initial_theta,
problem_size = problem_size,
dts = dts,
dimension = dimension
)
# Estimate model parameters using MLE
estimated_theta <- model_data(
matrix=exageostat_data$m,
x=exageostat_data$x,
y=exageostat_data$y,
kernel=kernel, dts=dts,
dimension=dimension,
lb=lower_bound,
ub=upper_bound,
mle_itr=opt_itrs)
# Perform spatial prediction using the estimated parameters
test_x <- c(0.2, 0.330)
test_y <- c(0.104, 0.14)
predict_data(
train_data=list(x=exageostat_data$x, y=exageostat_data$y, exageostat_data$m),
test_data=list(test_x, test_y),
kernel=kernel,
dts=dts,
estimated_theta=estimated_theta)
```

This example walks through initializing hardware, simulating spatial data, estimating model parameters, and making predictions using **ExaGeoStatCPP** in R.

> Please take a look at the end-to-end examples as a reference for using all the operations.
## Contributing
Expand Down Expand Up @@ -196,4 +286,4 @@ Find detailed information on how to contribute to ExaGeoStatCPP [here](CONTRIBUT
[BSD 3-Clause](LICENSE)

## Handout
![ExaGeoStatCPP-handout.png](docs/ExaGeoStatCPP-handout.png)
![ExaGeoStatCPP-handout.png](docs/ExaGeoStatCPP-handout.png)
3 changes: 2 additions & 1 deletion inst/include/Rcpp-adapters/FunctionsAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace exageostat::adapters {
* @param[in] aDimension Dimensionality of the problem ("2D" or "3D").
* @param[in] aBand Bandwidth for band matrices, applicable in certain computational kernels.
* @param[in] aMaxRank Maximum rank for low-rank approximations.
* @param[in] aAccuracy Accuracy value for low-rank approximations, The final value is computed as 10^(-1.0 * aAccuracy)
* @param[in] apData Pointer to ExaGeoStatData object to be modeled.
* @param[in] aMeasurementsVector Optional vector of measurements to enhance modeling, can be nullable.
* @param[in] aLocationsX Optional vector of X coordinates for locations, can be nullable.
Expand All @@ -79,7 +80,7 @@ namespace exageostat::adapters {
const std::vector<double> &aUpperBound, const int &aTolerance,
const int &aMleIterations, const int &aDenseTileSize,
const int &aLowTileSize, const std::string &aDimension, const int &aBand,
const int &aMaxRank, SEXP apData,
const int &aMaxRank, const int &aAccuracy, SEXP apData,
Rcpp::Nullable<Rcpp::NumericVector> aMeasurementsVector = R_NilValue,
Rcpp::Nullable<Rcpp::NumericVector> aLocationsX = R_NilValue,
Rcpp::Nullable<Rcpp::NumericVector> aLocationsY = R_NilValue,
Expand Down
3 changes: 2 additions & 1 deletion man/model_data.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

\usage{
model_data(computation = "exact", kernel, distance_matrix = "euclidean", lb,
ub, tol = 4, mle_itr, dts, lts = 0, dimension = "2D", band = 0, max_rank = 500,
ub, tol = 4, mle_itr, dts, lts = 0, dimension = "2D", band = 0, max_rank = 500, acc = 0,
data = NULL, matrix = NULL, x = NULL, y = NULL, z = NULL)
}

Expand Down Expand Up @@ -54,6 +54,7 @@ data = NULL, matrix = NULL, x = NULL, y = NULL, z = NULL)
\item{dimension}{A string specifies the data dimension, either "2D" or "3D". Default is "2D".}
\item{band}{A numeric value Bandwidth for band matrices, applicable in certain computational kernels, Default is 0.}
\item{max_rank}{A numeric value specifies the Maximum rank for low-rank approximations, Default is 500.}
\item{acc}{A numeric value specifies the accuracy for low-rank approximations, The final value is computed as 10^(-1.0 * acc). Default is 0.}
\item{data}{A list of data vectors. Default is `R_NilValue`.}
\item{matrix}{A matrix object. Default is `R_NilValue`.}
\item{x}{A numeric vector. Default is `R_NilValue`.}
Expand Down
8 changes: 5 additions & 3 deletions src/Rcpp-adapters/FunctionsAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ namespace exageostat::adapters {
R_ExaGeoStatModelData(const string &aComputation, const string &aKernelName, const string &aDistanceMatrix,
const vector<double> &aLowerBound, const vector<double> &aUpperBound, const int &aTolerance,
const int &aMleIterations, const int &aDenseTileSize, const int &aLowTileSize,
const string &aDimension, const int &aBand, const int &aMaxRank, SEXP apData,
Nullable <NumericVector> aMeasurementsVector, Nullable <NumericVector> aLocationsX,
Nullable <NumericVector> aLocationsY, Nullable <NumericVector> aLocationsZ) {
const string &aDimension, const int &aBand, const int &aMaxRank, const int &aAccuracy,
SEXP apData, Nullable <NumericVector> aMeasurementsVector,
Nullable <NumericVector> aLocationsX, Nullable <NumericVector> aLocationsY,
Nullable <NumericVector> aLocationsZ) {

Configurations configurations;
bool is_initialized = ((SEXP) apData == R_NilValue);
Expand All @@ -144,6 +145,7 @@ namespace exageostat::adapters {
configurations.SetTolerance(aTolerance);
configurations.SetBand(aBand);
configurations.SetMaxRank(aMaxRank);
configurations.SetAccuracy(aAccuracy);

ExaGeoStat<double>::ExaGeoStatDataModeling(configurations, data, pMeasurementsVectorPtr);
// Take back ownership, to avoid deleting apData when the unique_ptr goes out of scope.
Expand Down
2 changes: 1 addition & 1 deletion src/Rcpp-adapters/RcppModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RCPP_MODULE(ExaGeoStatCPP) {
function("model_data", &exageostat::adapters::R_ExaGeoStatModelData,
List::create(_["computation"] = "exact", _["kernel"], _["distance_matrix"] = "euclidean", _["lb"], _["ub"],
_["tol"] = 4, _["mle_itr"], _["dts"], _["lts"] = 0, _["dimension"] = "2D", _["band"] = 0,
_["max_rank"] = 500, _["data"] = R_NilValue, _["matrix"] = R_NilValue, _["x"] = R_NilValue,
_["max_rank"] = 500, _["acc"] = 0, _["data"] = R_NilValue, _["matrix"] = R_NilValue, _["x"] = R_NilValue,
_["y"] = R_NilValue, _["z"] = R_NilValue));

function("predict_data", &exageostat::adapters::R_ExaGeoStatPredictData,
Expand Down
11 changes: 11 additions & 0 deletions src/api/ExaGeoStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ using namespace exageostat::configurations;
template<typename T>
void ExaGeoStat<T>::ExaGeoStatLoadData(Configurations &aConfigurations, std::unique_ptr<ExaGeoStatData<T>> &aData) {

int seed = 0;
std::srand(seed);
aConfigurations.PrintSummary();
LOGGER("** ExaGeoStat data generation/loading **")
// Register and create a kernel object
Expand Down Expand Up @@ -67,6 +69,15 @@ T ExaGeoStat<T>::ExaGeoStatDataModeling(Configurations &aConfigurations, std::un
// Set max iterations value.
optimizing_function.set_maxeval(max_number_of_iterations);
optimizing_function.set_max_objective(ExaGeoStatMLETileAPI, (void *) modeling_data);

if (aConfigurations.GetComputation() == common::EXACT_DENSE) {
LOGGER("\t--> Modeling Using Dense Tile - Chameleon")
} else if (aConfigurations.GetComputation() == common::DIAGONAL_APPROX){
LOGGER("\t--> Modeling Using Diagonal Super Tile - Chameleon")
}
else {
LOGGER("\t--> Modeling Using Tile Low Rank - HiCMA")
}
// Optimize mle using nlopt.
optimizing_function.optimize(aConfigurations.GetStartingTheta(), opt_f);
aConfigurations.SetEstimatedTheta(aConfigurations.GetStartingTheta());
Expand Down
4 changes: 2 additions & 2 deletions src/configurations/Configurations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ Computation Configurations::CheckComputationValue(const std::string &aValue) {

if (aValue != "exact" and aValue != "Exact" and aValue != "Dense" and aValue != "dense" and
aValue != "diag_approx" and aValue != "diagonal_approx" and aValue != "lr_approx" and aValue != "tlr" and
aValue != "TLR") {
aValue != "TLR" and aValue != "dst") {
throw range_error("Invalid value for Computation. Please use Exact, diagonal_approx or TLR.");
}
if (aValue == "exact" or aValue == "Exact" or aValue == "Dense" or aValue == "dense") {
return EXACT_DENSE;
} else if (aValue == "diag_approx" or aValue == "diagonal_approx") {
} else if (aValue == "diag_approx" or aValue == "diagonal_approx" or aValue == "dst") {
return DIAGONAL_APPROX;
}
return TILE_LOW_RANK;
Expand Down
6 changes: 3 additions & 3 deletions src/data-units/Locations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace exageostat::common;
template<typename T>
void Locations<T>::SetLocationX(T &aLocationX, const int &aSize) {

if (aLocationX && aSize == this->mSize) {
if (&aLocationX != nullptr && aSize == this->mSize) {
memcpy(this->mpLocationX, &aLocationX, this->mSize * sizeof(T));
} else {
throw std::runtime_error("Invalid value for setting Locations X");
Expand All @@ -41,7 +41,7 @@ T *Locations<T>::GetLocationX() {
template<typename T>
void Locations<T>::SetLocationY(T &aLocationY, const int &aSize) {

if (aLocationY && aSize == this->mSize) {
if (&aLocationY != nullptr && aSize == this->mSize) {
memcpy(this->mpLocationY, &aLocationY, this->mSize * sizeof(T));
} else {
throw std::runtime_error("Invalid value for setting Locations Y");
Expand All @@ -59,7 +59,7 @@ T *Locations<T>::GetLocationY() {
template<typename T>
void Locations<T>::SetLocationZ(T &aLocationZ, const int &aSize) {

if (aLocationZ && aSize == this->mSize) {
if (&aLocationZ != nullptr && aSize == this->mSize) {
memcpy(this->mpLocationZ, &aLocationZ, this->mSize * sizeof(T));
} else {
throw std::runtime_error("Invalid value for setting Locations Z");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ T HicmaImplementation<T>::ExaGeoStatMLETile(std::unique_ptr<ExaGeoStatData<T>> &
//Calculate Cholesky Factorization (C=LL-1)
VERBOSE("LR: Cholesky factorization of Sigma...")
START_TIMING(time_facto);

this->ExaGeoStatPotrfTile(EXAGEOSTAT_LOWER, HICMA_descCUV, 0, HICMA_descCD, HICMA_descCrk, max_rank,
pow(10, -1.0 * acc));

Expand Down
17 changes: 16 additions & 1 deletion tests/R-tests/TestExaGeoStatAPI.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ncores <- 1
ngpus <- 0
problem_size <- 16
dts <- 8
lts <- 0
computation <- "exact"
dimension = "2D"
kernel <- "univariate_matern_stationary"
Expand Down Expand Up @@ -75,3 +74,19 @@ test_x <- c(0.2, 0.330)
test_y <- c(0.104, 0.14)

predict_data(train_data=list(locations_x, locations_y, z_value), test_data=list(test_x, test_y), kernel=kernel, dts=dts, estimated_theta=estimated_theta)

paste("---------------------------------------------------------------")
paste("ExaGeoStat with all Modules - tile low rank")

problem_size <- 1600
computation <- "tlr"
lts <- 400
dts <- 400
max_rank <- 200
# The final value is computed as 10^(-1.0 * aAccuracy)
acc <- 5

hardware <- new(Hardware, computation, ncores, ngpus, p, q)
exageostat_data <- simulate_data(kernel=kernel, initial_theta=initial_theta, problem_size=problem_size, dts=dts, dimension=dimension)
estimated_theta <- model_data(matrix=exageostat_data$m, x=exageostat_data$x, y=exageostat_data$y, kernel=kernel, dts=dts, lts = lts, dimension=dimension,lb=lower_bound, ub=upper_bound, mle_itr=10, computation=computation, max_rank=max_rank, acc=acc)

0 comments on commit 1b629f4

Please sign in to comment.