Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
de62bfa
add the pow_exp kernel and tested
Nov 23, 2023
b1c0165
all fixes
mahmoudElkarargyBS Jan 8, 2024
d8cefec
resolve threads plus some modifications
mahmoudElkarargyBS Jan 10, 2024
eea866b
Fix cuda
mahmoudElkarargyBS Jan 11, 2024
6884d5c
fix for linking cuda
mahmoudElkarargyBS Jan 11, 2024
cd7cda3
fix: hicma modifactions
mahmoudElkarargyBS Jan 11, 2024
f72d63c
try fixing Jenkines
mahmoudElkarargyBS Jan 16, 2024
210c06b
Adding R structure
mahmoudElkarargyBS Jan 16, 2024
5b604ba
fix:add doxygen in Jenkines
mahmoudElkarargyBS Jan 16, 2024
b1f0fbf
add test file for pow-exp kernel
Jan 16, 2024
b5d530e
test with -fpic
mahmoudElkarargyBS Jan 17, 2024
957dd0c
some modifications for HiCMA
mahmoudElkarargyBS Jan 17, 2024
fe1f893
updates
mahmoudElkarargyBS Jan 18, 2024
6a61410
try 2 gpu devices
mahmoudElkarargyBS Jan 20, 2024
346a0d8
back to starsh
mahmoudElkarargyBS Jan 22, 2024
2d3bc17
a potential fix to doxygen
mahmoudElkarargyBS Jan 22, 2024
5446c76
roll back
mahmoudElkarargyBS Jan 23, 2024
da8ad1f
test Rcpp
mahmoudElkarargyBS Feb 4, 2024
2ea149e
Fix Jenkines
mahmoudElkarargyBS Feb 4, 2024
6481324
fix errors
mahmoudElkarargyBS Feb 4, 2024
038e923
Updated in design
mahmoudElkarargyBS Feb 4, 2024
836ccbc
updates
mahmoudElkarargyBS Feb 11, 2024
21e826b
all release issue without src checks
mahmoudElkarargyBS Feb 11, 2024
f56153c
Merge pull request #1 from ecrc/FIX-release-issue-MK
mahmoudElkarargyBS Feb 11, 2024
18564f6
merge devel
mahmoudElkarargyBS Feb 11, 2024
c3fd36a
Merge pull request #2 from ecrc/kernel/pow-exp
mahmoudElkarargyBS Feb 11, 2024
ad24449
merge devel
mahmoudElkarargyBS Feb 11, 2024
b4c6e7d
adding MakeFile
mahmoudElkarargyBS Feb 11, 2024
f4e7e80
Updated MPI
mahmoudElkarargyBS Feb 12, 2024
96d6dde
Documentation
mahmoudElkarargyBS Feb 12, 2024
9f94224
fix examples tests
mahmoudElkarargyBS Feb 13, 2024
47f1c1b
modeling takes pointers
mahmoudElkarargyBS Feb 13, 2024
e308baf
example for read and write data
mahmoudElkarargyBS Feb 19, 2024
ae0d55c
fix: typpo in Initialize
mahmoudElkarargyBS Feb 26, 2024
0110a82
fix passing numbers of theta
mahmoudElkarargyBS Feb 26, 2024
9a4081f
fix: performance of gsl
mahmoudElkarargyBS Feb 27, 2024
2f65d19
fix: GPU support
mahmoudElkarargyBS Feb 27, 2024
d72800a
fix:mspe
mahmoudElkarargyBS Mar 3, 2024
96931cf
updated devel
mahmoudElkarargyBS Mar 3, 2024
7c6f095
R branch init
mahmoudElkarargyBS Mar 3, 2024
d77d5ab
merge devel
mahmoudElkarargyBS Mar 3, 2024
7b812bc
merge diffrence
mahmoudElkarargyBS Mar 3, 2024
ad9530d
tests:add r tests
mahmoudElkarargyBS Mar 3, 2024
e119bb2
fix tests
mahmoudElkarargyBS Mar 3, 2024
258785b
bug: in tlr
mahmoudElkarargyBS Mar 3, 2024
6486456
fix:tlr
mahmoudElkarargyBS Mar 3, 2024
9e9a28e
fix Jenkines
mahmoudElkarargyBS Mar 3, 2024
c61eaf1
fix: Jenkines in Documentation
mahmoudElkarargyBS Mar 4, 2024
06220cc
minior updates
mahmoudElkarargyBS Mar 4, 2024
ff4ce3e
huge refactoring
mahmoudElkarargyBS Mar 29, 2024
e7b412c
full R
mahmoudElkarargyBS Apr 2, 2024
93844aa
Merge pull request #3 from ecrc/FT-adding-Rcpp-MK
mahmoudElkarargyBS Apr 2, 2024
f8a670b
potential for tlr issue
Apr 5, 2024
3e47fb1
updates in heavy tests
mahmoudElkarargyBS Apr 14, 2024
8480f4f
a fix for gpu in gaussian kernels
mahmoudElkarargyBS Apr 14, 2024
ccacbf9
smalling tlr size
mahmoudElkarargyBS Apr 15, 2024
d268ca3
update sizes of heavy_tests
mahmoudElkarargyBS Apr 15, 2024
115c0a4
smalling size for gpu
mahmoudElkarargyBS Apr 15, 2024
128af20
minior changes
mahmoudElkarargyBS Apr 15, 2024
a629ef3
Huge refactoring in docs
mahmoudElkarargyBS Apr 21, 2024
00fafed
resolve threads
mahmoudElkarargyBS Apr 21, 2024
23c4c5f
fix MPI
mahmoudElkarargyBS Apr 21, 2024
6488a8a
resolve thread
mahmoudElkarargyBS Apr 21, 2024
746d875
updated R documentation
mahmoudElkarargyBS Apr 22, 2024
dec9d1a
documentation and hardware changes
mahmoudElkarargyBS Apr 28, 2024
2aaf398
finalized documentations
mahmoudElkarargyBS Apr 28, 2024
6daad10
minior change in Hardware
mahmoudElkarargyBS Apr 28, 2024
1864818
Ft test mpi mk (#6)
mahmoudElkarargyBS May 10, 2024
fd721cd
minior cleanings (#7)
mahmoudElkarargyBS May 12, 2024
aa56c1c
v1.1.0 (#4) (#8)
mahmoudElkarargyBS Jun 2, 2024
3fce527
Fix P & Q
mahmoudElkarargyBS Jun 2, 2024
e459c18
updates in R (#9)
mahmoudElkarargyBS Jul 3, 2024
58197b0
resolve conflicts
mahmoudElkarargyBS Jul 3, 2024
733723d
Fix error in R
mahmoudElkarargyBS Dec 31, 2024
f995a5f
Fix using of openblas (#16)
mahmoudElkarargyBS Jan 12, 2025
bd6fd82
resolve conflicts
mahmoudElkarargyBS Jan 12, 2025
0cdb463
Update main (#19)
mahmoudElkarargyBS Feb 18, 2025
a4df6cf
Fix for zero values in locations (#20)
mahmoudElkarargyBS Feb 18, 2025
a090ab2
update devel (#21)
mahmoudElkarargyBS Feb 18, 2025
eba9f5e
Fix tlr in R (#24)
mahmoudElkarargyBS Feb 24, 2025
8c655ab
Ft add accuracy tlr (#26)
mahmoudElkarargyBS Feb 25, 2025
e2af57e
change value of acc
mahmoudElkarargyBS Feb 25, 2025
97690fe
update params values
mahmoudElkarargyBS Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ list(APPEND LIBS ${LAPACKE_LIBRARIES})
link_directories(${LAPACKE_LIBRARY_DIRS_DEP})
include_directories(${LAPACKE_INCLUDE_DIRS})

if (${BLA_VENDOR} MATCHES "Intel10_64lp" OR ${BLA_VENDOR} MATCHES "Intel" OR ${BLA_VENDOR} MATCHES "Intel10_64lp_seq")
message(STATUS "Linked to MKL")
add_compile_definitions(USE_MKL)
endif()

# Add all dependencies for ExaGeoStatCPP
#-----------------------------

Expand Down Expand Up @@ -164,7 +169,7 @@ if (USE_R)
if (${R_FOUND})
message(STATUS "Using R technology")
list(APPEND LIBS R)
add_definitions(-DUSING_R)
add_definitions(-DUSE_R)
endif ()
endif ()

Expand Down
128 changes: 113 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ statisticians with modest computational resources.

## Installation

> Note: Installation requires at least **CMake of version 3.2**. to build ExaGeoStatCPP.
### Requirements
To build and run this software, you will need:

1. [CMake](https://cmake.org/download/) (version 3.2 or higher)
2. [wget](https://www.gnu.org/software/wget/)
3. **gcc** and **g++** compilers
4. **autoconf** and **automake**
5. [libtool](https://www.gnu.org/software/libtool/)
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 @@ -70,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 @@ -91,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 @@ -127,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 @@ -188,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)
22 changes: 10 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BLUE='\033[0;34m'
NC='\033[0m'

INSTALL_PREFIX=$PWD/installdir/_deps
BASE_DIR=$PWD

# Function to install CMake from source
install_cmake() {
Expand All @@ -36,12 +37,11 @@ install_cmake() {
cd cmake-3.28.1 || exit 1

# Configure, build, and install CMake to the specified location
./bootstrap --prefix="$INSTALL_PREFIX" --parallel=2 -- -DCMAKE_USE_OPENSSL=OFF
./bootstrap --prefix="$INSTALL_PREFIX/CMAKE" --parallel=2 -- -DCMAKE_USE_OPENSSL=OFF
make -j 2
sudo make install

make install
# Clean up
cd "$temp_dir" || exit 1
cd "$BASE_DIR" || exit 1
rm -rf "$temp_dir"
}

Expand All @@ -59,7 +59,7 @@ fi
BUILDING_TESTS="OFF"
BUILDING_HEAVY_TESTS="OFF"
BUILDING_EXAMPLES="OFF"
USING_HiCMA="OFF"
USE_HiCMA="OFF"
VERBOSE="OFF"
USE_CUDA="OFF"
USE_MPI="OFF"
Expand Down Expand Up @@ -112,7 +112,7 @@ while getopts ":tevhHi:cmpTwr" opt; do
;;
H) ##### Using HiCMA #####
echo "${GREEN}Using HiCMA.${NC}"
USING_HiCMA="ON"
USE_HiCMA="ON"
;;
c) ##### Using cuda enabled #####
echo "${GREEN}Cuda enabled ${NC}"
Expand Down Expand Up @@ -179,7 +179,7 @@ if [ -z "$BUILDING_EXAMPLES" ]; then
echo "${RED}Building examples disabled.${NC}"
fi

if [ -z "$USING_HiCMA" ]; then
if [ -z "$USE_HiCMA" ]; then
echo "${RED}Using HiCMA is disabled.${NC}"
fi

Expand Down Expand Up @@ -226,10 +226,8 @@ elif [ -x "/Applications/CMake.app/Contents/bin/cmake" ]; then
cmake_command_bin="${cmake_install_dir}/cmake"
else
echo "Installing CMake from source"
mkdir "${ABSOLUTE_PATH}/inst/_deps/"
install_dir="${ABSOLUTE_PATH}/inst/_deps/"
install_cmake "$install_dir"
cmake_command_bin="${ABSOLUTE_PATH}/inst/_deps/bin/cmake"
install_cmake
cmake_command_bin="${INSTALL_PREFIX}/CMAKE/bin/cmake"
fi

"$cmake_command_bin" "$DEVELOPER_WARNINGS" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
Expand All @@ -238,7 +236,7 @@ fi
-DBUILD_TESTS="${BUILDING_TESTS}" \
-DBUILD_HEAVY_TESTS="${BUILDING_HEAVY_TESTS}" \
-DBUILD_EXAMPLES="${BUILDING_EXAMPLES}" \
-DUSE_HICMA="${USING_HiCMA}" \
-DUSE_HICMA="${USE_HiCMA}" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=${VERBOSE} \
-DUSE_CUDA="${USE_CUDA}" \
-DUSE_MPI="${USE_MPI}" \
Expand Down
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
50 changes: 0 additions & 50 deletions man/get_Z_measurement_vector.Rd

This file was deleted.

49 changes: 0 additions & 49 deletions man/get_locations.Rd

This file was deleted.

Loading