diff --git a/.dockerignore b/.dockerignore index e33d3f5c3..92a193f20 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,7 +15,7 @@ build # Misc project files docker docs -k8s +deploy/k8s node_modules typescript venv diff --git a/.env b/.env index a84150979..bd2eecdea 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -FAASM_VERSION=0.0.9 +FAASM_VERSION=0.0.12 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 716aa3969..b1c51a343 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,13 +17,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: "Build the testing image" - run: docker build . -f docker/testing.dockerfile --tag faasm/testing:${GITHUB_SHA} --build-arg FAASM_VERSION=0.0.9 + run: docker build . -f docker/testing.dockerfile --tag faasm/testing:${GITHUB_SHA} --build-arg FAASM_VERSION=0.0.12 - name: "Create a docker network" run: docker network create -d bridge test-net - name: "Stop redis container" run: docker stop redis | true - name: "Run the redis container" - run: docker run -d --name redis --net=test-net --rm faasm/redis:0.0.9 + run: docker run -d --name redis --net=test-net --rm faasm/redis:0.0.12 - name: "Run the testing container" run: > docker run --privileged --net=test-net diff --git a/CMakeLists.txt b/CMakeLists.txt index c2eb16e74..f457c040b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,23 +11,22 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Faasm directories set(FAASM_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/src) set(FAASM_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include) -set(FAASM_LIB_C_DIR ${CMAKE_CURRENT_LIST_DIR}/lib-c) -set(FAASM_LIB_CPP_DIR ${CMAKE_CURRENT_LIST_DIR}/lib-cpp) -set(FAASM_PYTHON_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}/lib-pyinit) +set(FAASM_LIB_CPP_DIR ${CMAKE_CURRENT_LIST_DIR}/libs/cpp) +set(FAASM_PYTHON_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}/libs/pyinit) set(FAASM_WAVM_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/third-party/WAVM/Lib) option(FAASM_STATIC_LIBS "Statically link Faasm libs" ON) option(FAASM_AWS_SUPPORT "Whether to include AWS support" OFF) # Library type (for shared libraries) -if(FAASM_STATIC_LIBS) +if (FAASM_STATIC_LIBS) function(faasm_public_lib lib_name lib_deps) add_library(${lib_name} STATIC ${lib_deps}) endfunction() function(faasm_private_lib lib_name lib_deps) add_library(${lib_name} STATIC ${lib_deps}) endfunction() -else() +else () function(faasm_public_lib lib_name lib_deps) add_library(${lib_name} SHARED ${lib_deps}) endfunction() @@ -35,7 +34,7 @@ else() add_library(${lib_name} STATIC ${lib_deps}) target_compile_options(${lib_name} PRIVATE "-fPIC") endfunction() -endif() +endif () # Switch on WAVM stack traces in debug (potential performance gain?) set(WAVM_ENABLE_UNWIND ON CACHE BOOL "WAVM unwind") @@ -54,7 +53,7 @@ add_definitions(-DFAASM_PROFILE_ON=0) # Custom LLVM build (also for profiling) set(FAASM_CUSTOM_LLVM 0) -if(${FAASM_CUSTOM_LLVM}) +if (${FAASM_CUSTOM_LLVM}) message(STATUS "Using custom LLVM") # Force using custom build of LLVM for codegen @@ -63,11 +62,11 @@ if(${FAASM_CUSTOM_LLVM}) set(WAVM_PERF_LIBS 1) add_definitions(-DWAVM_PERF_EVENTS=1) -else() +else () # Use LLVM 8 explicitly for the lib parts (i.e. codegen) set(LLVM_DIR /usr/lib/llvm-8) find_package(LLVM REQUIRED CONFIG) -endif() +endif () message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") @@ -75,15 +74,15 @@ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") # add_definitions(-DEIGEN_DONT_PARALLELIZE) # add_definitions(-DEIGEN_NO_MALLOC) -if(FAASM_AWS_SUPPORT) -# AWS -find_package(aws-lambda-runtime) +if (FAASM_AWS_SUPPORT) + # AWS + find_package(aws-lambda-runtime) -# AWS SDK -find_package(AWSSDK REQUIRED COMPONENTS lambda s3 sqs) + # AWS SDK + find_package(AWSSDK REQUIRED COMPONENTS lambda s3 sqs) -add_definitions("-DAWS_SUPPORT=1") -endif() + add_definitions("-DAWS_SUPPORT=1") +endif () set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -91,7 +90,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) include_directories( ${FAASM_INCLUDE_DIR} - ${FAASM_LIB_C_DIR} ${FAASM_LIB_CPP_DIR} ${FAASM_PYTHON_LIB_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src # Required for protobuf @@ -101,8 +99,8 @@ if (FAASM_BUILD_TYPE STREQUAL "knative-native") message(STATUS "Running knative native build") add_subdirectory(func) - add_subdirectory(lib-cpp) - add_subdirectory(lib-pyinit) + add_subdirectory(libs/cpp) + add_subdirectory(libs/pyinit) add_subdirectory(src/emulator) add_subdirectory(src/endpoint) @@ -117,7 +115,7 @@ elseif (FAASM_BUILD_TYPE STREQUAL "lambda-func") message(STATUS "Running lambda function build") add_subdirectory(func) - add_subdirectory(lib-cpp) + add_subdirectory(libs/cpp) add_subdirectory(src/aws) add_subdirectory(src/lambda_func) @@ -189,8 +187,8 @@ elseif (FAASM_BUILD_TYPE STREQUAL "native-tools") set(FAASM_LIB_TYPE SHARED) - add_subdirectory(lib-cpp) - add_subdirectory(lib-faasmp) + add_subdirectory(libs/cpp) + add_subdirectory(libs/faasmp) add_subdirectory(src/emulator) add_subdirectory(src/proto) add_subdirectory(src/redis) @@ -213,31 +211,29 @@ else () add_subdirectory(func) # Faasm libraries - add_subdirectory(lib-cpp) - add_subdirectory(lib-faasmp) - add_subdirectory(lib-faasmpi) - add_subdirectory(lib-pyinit) + add_subdirectory(libs/cpp) + add_subdirectory(libs/faasmp) + add_subdirectory(libs/faasmpi) + add_subdirectory(libs/pyinit) + add_subdirectory(libs/rust) # Custom malloc add_subdirectory(third-party/malloc) - # Experiments - add_subdirectory(experiment) - # AWS-specific - if(FAASM_AWS_SUPPORT) + if (FAASM_AWS_SUPPORT) add_subdirectory(src/aws) add_subdirectory(src/lambda_func) add_subdirectory(src/dispatch) add_subdirectory(src/lambda) - endif() + endif () # Faasm runtime add_subdirectory(src/codegen) add_subdirectory(src/data) - add_subdirectory(src/edge) add_subdirectory(src/emulator) add_subdirectory(src/endpoint) + add_subdirectory(src/experiment) add_subdirectory(src/ibm) add_subdirectory(src/ir_cache) add_subdirectory(src/knative) @@ -258,12 +254,12 @@ else () # Tests add_library(catch INTERFACE) - add_subdirectory(test) - add_subdirectory(test_utils) - add_subdirectory(test_ibm) - add_subdirectory(test_knative) - - if(FAASM_AWS_SUPPORT) - add_subdirectory(test_aws) - endif() + add_subdirectory(tests/test) + add_subdirectory(tests/utils) + add_subdirectory(tests/ibm) + add_subdirectory(tests/knative) + + if (FAASM_AWS_SUPPORT) + add_subdirectory(tests/aws) + endif () endif () diff --git a/README.md b/README.md index 555e36b9b..1db9712ea 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ More detail on some key features and implementations can be found below: - [Usage and set-up](docs/setup.md) - using the CLI and other features. - [C/C++ functions](docs/cpp.md) - writing and deploying Faasm functions in C/C++. - [Python functions](docs/python.md) - isolating and executing functions in Python. +- [Rust functions](docs/rust.md) - links and resources for writing Faasm Rust functions. - [Distributed state](docs/state.md) - sharing state between functions. - [Faasm host interface](docs/host_interface.md) - the serverless-specific interface between functions and the underlying host. - [Kubernetes and Knative integration](docs/kubernetes.md)- deploying Faasm as part of a full serverless platform. diff --git a/VERSION b/VERSION index c5d54ec32..8cbf02c39 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.9 +0.0.12 diff --git a/conf/nginx-local.conf b/deploy/conf/nginx-local.conf similarity index 100% rename from conf/nginx-local.conf rename to deploy/conf/nginx-local.conf diff --git a/conf/redis-cluster.conf b/deploy/conf/redis-cluster.conf similarity index 100% rename from conf/redis-cluster.conf rename to deploy/conf/redis-cluster.conf diff --git a/conf/redis-volatile.conf b/deploy/conf/redis-volatile.conf similarity index 100% rename from conf/redis-volatile.conf rename to deploy/conf/redis-volatile.conf diff --git a/conf/tflite_bench.lua b/deploy/conf/tflite_bench.lua similarity index 100% rename from conf/tflite_bench.lua rename to deploy/conf/tflite_bench.lua diff --git a/k8s/bare-metal-remote/upload-service.yml b/deploy/k8s/bare-metal-remote/upload-service.yml similarity index 100% rename from k8s/bare-metal-remote/upload-service.yml rename to deploy/k8s/bare-metal-remote/upload-service.yml diff --git a/k8s/bare-metal/config.yaml b/deploy/k8s/bare-metal/config.yaml similarity index 100% rename from k8s/bare-metal/config.yaml rename to deploy/k8s/bare-metal/config.yaml diff --git a/k8s/bare-metal/upload-pod.yml b/deploy/k8s/bare-metal/upload-pod.yml similarity index 94% rename from k8s/bare-metal/upload-pod.yml rename to deploy/k8s/bare-metal/upload-pod.yml index 886ecd206..89459f826 100644 --- a/k8s/bare-metal/upload-pod.yml +++ b/deploy/k8s/bare-metal/upload-pod.yml @@ -9,7 +9,7 @@ metadata: spec: containers: - name: upload - image: faasm/upload:0.0.9 + image: faasm/upload:0.0.12 imagePullPolicy: Always ports: - containerPort: 8002 diff --git a/k8s/common/namespace.yml b/deploy/k8s/common/namespace.yml similarity index 100% rename from k8s/common/namespace.yml rename to deploy/k8s/common/namespace.yml diff --git a/k8s/common/redis-queue.yml b/deploy/k8s/common/redis-queue.yml similarity index 94% rename from k8s/common/redis-queue.yml rename to deploy/k8s/common/redis-queue.yml index 0d0493bf6..7700d83d5 100644 --- a/k8s/common/redis-queue.yml +++ b/deploy/k8s/common/redis-queue.yml @@ -11,7 +11,7 @@ metadata: spec: containers: - name: master - image: faasm/redis:0.0.9 + image: faasm/redis:0.0.12 env: - name: MASTER value: "true" diff --git a/k8s/common/redis-service.yml b/deploy/k8s/common/redis-service.yml similarity index 100% rename from k8s/common/redis-service.yml rename to deploy/k8s/common/redis-service.yml diff --git a/k8s/common/redis-state.yml b/deploy/k8s/common/redis-state.yml similarity index 94% rename from k8s/common/redis-state.yml rename to deploy/k8s/common/redis-state.yml index a538b45c4..046dc14e2 100644 --- a/k8s/common/redis-state.yml +++ b/deploy/k8s/common/redis-state.yml @@ -11,7 +11,7 @@ metadata: spec: containers: - name: master - image: faasm/redis:0.0.9 + image: faasm/redis:0.0.12 env: - name: MASTER value: "true" diff --git a/k8s/local/upload-service.yml b/deploy/k8s/local/upload-service.yml similarity index 100% rename from k8s/local/upload-service.yml rename to deploy/k8s/local/upload-service.yml diff --git a/k8s/redis-cluster/redis-service.yml b/deploy/k8s/redis-cluster/redis-service.yml similarity index 100% rename from k8s/redis-cluster/redis-service.yml rename to deploy/k8s/redis-cluster/redis-service.yml diff --git a/k8s/redis-cluster/redis-set.yml b/deploy/k8s/redis-cluster/redis-set.yml similarity index 100% rename from k8s/redis-cluster/redis-set.yml rename to deploy/k8s/redis-cluster/redis-set.yml diff --git a/docker-compose-ibm.env b/docker-compose-ibm.env deleted file mode 100644 index c20cfaeff..000000000 --- a/docker-compose-ibm.env +++ /dev/null @@ -1,10 +0,0 @@ -# Environment -LOG_LEVEL=debug -CGROUP_MODE=off -NETNS_MODE=off -IBM_API_KEY= - -# Redis -REDIS_STATE_HOST= -REDIS_QUEUE_HOST= -REDIS_PORT=6379 diff --git a/docker-compose-ibm.yml b/docker-compose-ibm.yml deleted file mode 100644 index 3dd0ecb07..000000000 --- a/docker-compose-ibm.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: "3" - -services: - ibm-worker-1: - image: faasm/ibm-worker:0.1.1 - env_file: - - docker-compose-ibm.env - ports: - - "8081:8080" - privileged: yes - - upload: - image: faasm/upload - ports: - - "8002:8002" - env_file: - - docker-compose-ibm.env - volumes: - - /usr/local/faasm/:/usr/local/faasm/ - - /usr/local/code/faasm/wasm/:/usr/local/code/faasm/wasm/ diff --git a/docker-compose.yml b/docker-compose.yml index 6df01c0f9..944e3b4b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,7 +51,7 @@ services: nginx: image: nginx:latest volumes: - - ./conf/nginx-local.conf:/etc/nginx/nginx.conf:ro + - ./deploy/conf/nginx-local.conf:/etc/nginx/nginx.conf:ro depends_on: - worker ports: diff --git a/docker/edge.dockerfile b/docker/edge.dockerfile deleted file mode 100644 index ad4cda604..000000000 --- a/docker/edge.dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM faasm/base - -COPY . /usr/local/code/faasm - -# Build the edge binary -WORKDIR /faasm/build -RUN cmake --build . --target edge - -CMD "/faasm/build/bin/edge" diff --git a/docker/knative-native-base.dockerfile.dockerignore b/docker/knative-native-base.dockerfile.dockerignore index c20996e61..d961692af 100644 --- a/docker/knative-native-base.dockerfile.dockerignore +++ b/docker/knative-native-base.dockerfile.dockerignore @@ -15,7 +15,7 @@ build # Misc project files docker docs -k8s +deploy/k8s node_modules typescript venv diff --git a/docker/redis-cluster.dockerfile b/docker/redis-cluster.dockerfile index e0f88e231..5169e47d4 100644 --- a/docker/redis-cluster.dockerfile +++ b/docker/redis-cluster.dockerfile @@ -1,7 +1,7 @@ FROM redis:5 # Put config in place -COPY conf/redis-cluster.conf /redis.conf +COPY deploy/conf/redis-cluster.conf /redis.conf # Add entrypoint script which will handle IPs changing COPY bin/redis-cluster-entrypoint.sh /entrypoint.sh diff --git a/docker/redis.dockerfile b/docker/redis.dockerfile index 379317071..19be6da59 100644 --- a/docker/redis.dockerfile +++ b/docker/redis.dockerfile @@ -1,6 +1,6 @@ FROM redis:5 # Put config in place -COPY conf/redis-volatile.conf /redis.conf +COPY deploy/conf/redis-volatile.conf /redis.conf CMD ["redis-server", "/redis.conf"] \ No newline at end of file diff --git a/docker/testing.dockerfile.dockerignore b/docker/testing.dockerfile.dockerignore index 127c8e6cc..b09d1190e 100644 --- a/docker/testing.dockerfile.dockerignore +++ b/docker/testing.dockerfile.dockerignore @@ -15,7 +15,7 @@ build # Misc project files docker docs -k8s +deploy/k8s node_modules typescript venv @@ -46,5 +46,6 @@ third-party !wasm/omp/ !wasm/mpi/ !wasm/python/ +!wasm/rust/ !wasm/sgd/ !wasm/tf/ \ No newline at end of file diff --git a/docker/testing.dockerignore.j2 b/docker/testing.dockerignore.j2 index 9f46f8e1a..72268b314 100644 --- a/docker/testing.dockerignore.j2 +++ b/docker/testing.dockerignore.j2 @@ -5,5 +5,6 @@ !wasm/omp/ !wasm/mpi/ !wasm/python/ +!wasm/rust/ !wasm/sgd/ !wasm/tf/ diff --git a/docker/toolchain.dockerfile b/docker/toolchain.dockerfile index 56a175ac1..efd16ef07 100644 --- a/docker/toolchain.dockerfile +++ b/docker/toolchain.dockerfile @@ -4,6 +4,7 @@ FROM faasm/worker:$FAASM_VERSION SHELL ["/bin/bash", "-c"] # Install various deps +RUN apt-get update RUN apt-get install -y libpython3-dev \ python3-dev \ python3-pip \ diff --git a/docs/kubernetes.md b/docs/kubernetes.md index 9db26f72b..e0f66de54 100644 --- a/docs/kubernetes.md +++ b/docs/kubernetes.md @@ -4,7 +4,7 @@ Faasm is a runtime designed to be integrated into other serverless platforms. The recommended integration is with [Knative](https://knative.dev/). All of Faasm's Kubernetes and Knative configuration can be found in the -[k8s](../k8s) directory, and the relevant parts of the Faasm CLI can be +[k8s](../deploy/k8s) directory, and the relevant parts of the Faasm CLI can be found in the [Knative tasks](../tasks/knative.py). These steps generally assume that you have diff --git a/docs/mpi.md b/docs/mpi.md index fd92dbda4..a06b18a48 100644 --- a/docs/mpi.md +++ b/docs/mpi.md @@ -120,6 +120,6 @@ mpirun ... -mca btl_tcp_if_include 192.168.0.0/16 ... ## Extending the Faasm MPI implementation -The MPI interface declarations live in `lib-faasmpi` and the definitions in `src/wasm/mpi.cpp`. +The MPI interface declarations live in `libs/faasmpi` and the definitions in `src/wasm/mpi.cpp`. -Any new functions need to be included in `lib-faasmpi/faasmpi.imports`. +Any new functions need to be included in `libs/faasmpi/faasmpi.imports`. diff --git a/docs/openmp.md b/docs/openmp.md index 0706fb7d5..a477b89c9 100644 --- a/docs/openmp.md +++ b/docs/openmp.md @@ -18,6 +18,6 @@ inv invoke omp hellomp Runtime OMP functions are implemented just like any other host interface function and can be found in `src/wasm/openmp.cpp`. -The list of acceptable unresolved imports is in `lib-faasmp/faasmp.imports`. +The list of acceptable unresolved imports is in `libs/faasmp/faasmp.imports`. To add a new function you need to include it in both of these files. diff --git a/docs/releases.md b/docs/releases.md index ba555db10..5635d6916 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -31,7 +31,7 @@ Version needs to be updated in: - `VERSION` at the project root - `FAASM_VERSION` variable in `.env` file at project root -- Any kubernetes config files in `k8s` that specify image names +- Any kubernetes config files in `deploy/k8s` that specify image names This can usually be done with a find-and-replace on the current version number. diff --git a/docs/rust.md b/docs/rust.md new file mode 100644 index 000000000..4d1441924 --- /dev/null +++ b/docs/rust.md @@ -0,0 +1,10 @@ +# Rust Functions + +Rust support in Faasm is still a work in progress, but is made possible +by two other projects: + +- [Faasm Rust workspace](https://github.com/mfournial/rust-faasm) - Scaffolding for building Faasm Rust functions +- [Faasm Rust bindings](https://github.com/mfournial/faasm-sys) - A Rust implementation of the Faasm host interface + +The [Faasm Rust README](https://github.com/mfournial/rust-faasm) has all the info +you need to write and deploy Rust functions in Faasm. \ No newline at end of file diff --git a/docs/toolchain.md b/docs/toolchain.md index 87547e338..ab79ce1bd 100644 --- a/docs/toolchain.md +++ b/docs/toolchain.md @@ -1,58 +1,102 @@ # Faasm Toolchain -Although wasm support is included in upstream LLVM, we still need to build things ourselves. This will hopefully change in future. +Faasm aims to support a range of legacy applications, so requires a toolchain +capable of compiling large projects that may require threading, C++ exceptions +and dynamic linking. Unfortunately these features are not covered by the +[wasi-sdk](https://github.com/WebAssembly/wasi-sdk) and +[wasi-libc](https://github.com/WebAssembly/wasi-libc) at this time, therefore +we need to use a custom LLVM toolchain and musl fork. The musl fork is based +off the now-archived project found [here](https://github.com/jfbastien/musl). + +Fortunately we only rarely need to build the toolchain, and it can be downloaded +by running: + +```bash +# Toolchain - clang, clang++, wasm-ld etc. +inv toolchain.download-toolchain -We need to build a custom LLVM toolchain with a modified musl and libcxx and libcxxabi set to use pthreads. +# Sysroot - wasm-compiled libc, libcxx etc. +inv toolchain.download-sysroot +``` -To download the built toolchain you can run: +This repo contains a [Faasm CMake toolchain](../toolchain/FaasmToolchain.cmake), +file that's used under the hood to build functions and libraries. -``` -inv toolchain.download-toolchain -``` +# Building + +On the rare occasion that we do need to rebuild the toolchain (e.g. when a new +LLVM version is released), we can run through the steps below. -This also includes the relevant sysroot files (which will be placed at `/usr/local/faasm/llvm-sysroot`). +## Toolchain Updates + +When updating the underlying LLVM version of the toolchain you'll need to create a +[new release](releases.md). The steps should be something like: -A CMake toolchain file exists at `toolchain/FaasmToolchain.cmake`. +- Upgrade the LLVM submodule if necessary (see below) +- Bump up the Faasm version (as outlined in [release docs](releases.md)) +- Rebuild the toolchain itself (see below) +- Rebuild the basic sysroot libraries (`inv libs.toolchain --clean`) +- Rebuild 3rd party libraries (Pyodide and Tensorflow, see relevant docs) +- Rebuild and upload _all_ wasm functions (all those under `funcs`) +- Set up the runtime root (see Python docs and Ansible `runtime_fs.yml` playbook) +- Make sure all the tests run +- Create a new [release](releases.md) +- Rebuild all Docker images for this release -## Runtime +## Upgrading LLVM -Certain files need to be in place at runtime, to download these: +To upgrade the underlying LLVM version you need to update the _submodule_ in this +project. Find the commit related to tag name for the desired release in +[the LLVM repo](https://github.com/llvm/llvm-project/releases) (e.g. `llvmorg-10.0.0`), then: -``` -inv toolchain.download-runtime +```bash +cd third-party/llvm-project +git checkout master +git fetch origin +git checkout ``` -# Building +Once done, check the [toolchain Makefile](../toolchain/Makefile) for any references to LLVM +versions and update accordingly. + +You can then follow the steps below as normal, making sure you start with `make clean-all`. + ## Building Toolchain To build from scratch you just need to be in the `toolchain` directory, then run: -``` +```bash make ``` -This takes ages as it builds a whole LLVM toolchain. +This a while (perhaps 30/40 mins) as it builds a lot of the LLVM toolchain from scratch. + +When it finishes, check things are up to the new version with: + +```bash +inv toolchain.version +``` ## Rebuilding Toolchain To rebuild, there different options. The first is just rebuilding libc: -``` +```bash make clean-libc make ``` Another is rebuilding all the libs, i.e. libc, libcxx, libcxxabi and compiler-rt: -``` +```bash make clean-libs make ``` The final option is to rebuild EVERYTHING, including Clang. This takes ages and is only necessary if you need to change the underlying LLVM or Clang configuration (rare): -``` +```bash make clean-all make ``` @@ -76,18 +120,3 @@ You will need to set this target explicitly the relevant CMake/ Makefile (as the ## SIMD SIMD support is also in flux but possible to switch on with `-msimd128` and `-munimplemented-simd128`. - -## Toolchain Updates - -When updating the underlying LLVM version of the toolchain you'll need to create a -[new release](releases.md). The steps should be something like: - -- Bump up the Faasm version (as outlined in [release docs](releases.md)) -- Rebuild the toolchain itself (based on instructions above) -- Rebuild the basic sysroot libraries (`inv libs.libc libs.eigen libs.faasm`) -- Rebuild 3rd party libraries (Pyodide and Tensorflow, see relevant docs) -- Rebuild and upload _all_ wasm functions (all those under `funcs`) -- Set up the runtime root (see Python docs and Ansible `runtime_fs.yml` playbook) -- Make sure all the tests run -- Create a new [release](releases.md) -- Rebuild all Docker images for this release \ No newline at end of file diff --git a/func/errors/CMakeLists.txt b/func/errors/CMakeLists.txt index 66388eea1..89ee89cf0 100644 --- a/func/errors/CMakeLists.txt +++ b/func/errors/CMakeLists.txt @@ -1,13 +1,21 @@ set(FAASM_USER errors) -faasm_func(bad_malloc bad_malloc.cpp) -faasm_func(multi_poll multi_poll.cpp) -faasm_func(munmap munmap.cpp) -faasm_func(open_blocked open_blocked.cpp) -faasm_func(ret_one ret_one.cpp) -faasm_func(socket socket.cpp) -faasm_func(stdin_poll stdin_poll.cpp) +function(error_func exec_name dir_path) + faasm_func(${exec_name} ${dir_path}) + + set(ALL_ERROR_FUNCS ${ALL_ERROR_FUNCS} ${exec_name} PARENT_SCOPE) +endfunction(error_func) + +error_func(bad_malloc bad_malloc.cpp) +error_func(multi_poll multi_poll.cpp) +error_func(munmap munmap.cpp) +error_func(open_blocked open_blocked.cpp) +error_func(ret_one ret_one.cpp) +error_func(socket socket.cpp) +error_func(stdin_poll stdin_poll.cpp) if (FAASM_BUILD_TYPE STREQUAL "wasm") - faasm_func(stackoverflow stackoverflow.cpp) -endif() \ No newline at end of file + error_func(stackoverflow stackoverflow.cpp) +endif() + +add_custom_target(errors_all_funcs DEPENDS ${ALL_ERROR_FUNCS}) diff --git a/func/omp/CMakeLists.txt b/func/omp/CMakeLists.txt index dc256b845..452063ec3 100644 --- a/func/omp/CMakeLists.txt +++ b/func/omp/CMakeLists.txt @@ -29,28 +29,38 @@ function(omp_func exec_name dir_path) set(ALL_OMP_FUNCS ${ALL_OMP_FUNCS} ${exec_name} PARENT_SCOPE) endfunction(omp_func) -omp_func(custom_reduce custom_reduce.cpp) + omp_func(for_static_schedule for_static_schedule.cpp) omp_func(header_api_support header_api_support.cpp) omp_func(hellomp hellomp.cpp) omp_func(nested_levels_test nested_levels_test.cpp) -omp_func(nested_parallel nested_parallel.cpp) omp_func(omp_checks omp_checks.cpp) -omp_func(pi_calculation pi_calculation.cpp) -omp_func(reduction_average reduction_average.cpp) -omp_func(reduction_integral reduction_integral.cpp) -omp_func(setting_num_threads setting_num_threads.cpp) omp_func(simple_barrier simple_barrier.cpp) -omp_func(simple_critical simple_critical.cpp) omp_func(simple_flush simple_flush.cpp) omp_func(simple_for simple_for.cpp) omp_func(simple_master simple_master.cpp) -omp_func(simple_reduce simple_reduce.cpp) -# Intel OMP files -omp_func(intel_nstreams intel_nstreams.cpp) -omp_func(intel_synch_p2p intel_synch_p2p.cpp) -omp_func(intel_transpose intel_transpose.cpp) +# 26/04/2020 - the following functions cause an error in Clang when compiled with LLVM 10.0.0 +if (CMAKE_C_COMPILER_VERSION MATCHES "^10.*") + message(WARNING "Skipping several OMP functions for Clang ${CMAKE_C_COMPILER_VERSION}") +else () + omp_func(simple_reduce simple_reduce.cpp) + omp_func(nested_parallel nested_parallel.cpp) + omp_func(custom_reduce custom_reduce.cpp) + omp_func(pi_calculation pi_calculation.cpp) + omp_func(reduction_integral reduction_integral.cpp) + omp_func(setting_num_threads setting_num_threads.cpp) + omp_func(reduction_average reduction_average.cpp) + omp_func(simple_critical simple_critical.cpp) + + # Intel OMP files + omp_func(intel_nstreams intel_nstreams.cpp) + omp_func(intel_synch_p2p intel_synch_p2p.cpp) + omp_func(intel_transpose intel_transpose.cpp) +endif () + +# Target files +omp_func(target_integral target_integral.cpp) if (FAASM_BUILD_TYPE STREQUAL "wasm") omp_func(stack_debug stack_debug.cpp) diff --git a/func/omp/custom_reduce.cpp b/func/omp/custom_reduce.cpp index d13c6125d..787a65b61 100644 --- a/func/omp/custom_reduce.cpp +++ b/func/omp/custom_reduce.cpp @@ -2,6 +2,8 @@ #include #include +#define ITERATIONS 50 + struct Reducer { Reducer(int x = 0) : x(x) {} int x; @@ -14,15 +16,14 @@ struct Reducer { #pragma omp declare reduction(MyReducer: Reducer: omp_out += omp_in) FAASM_MAIN_FUNC() { - const int iterations = 50; Reducer sum(0); - Reducer a[iterations]; - for (int i = 0; i < iterations; i++) { + Reducer a[ITERATIONS]; + for (int i = 0; i < ITERATIONS; i++) { a[i].x = i; } #pragma omp parallel for num_threads(4) default(none) reduction(MyReducer:sum) shared(a) - for (int i = 0; i < iterations; i++) { + for (int i = 0; i < ITERATIONS; i++) { Reducer val(i * 2 + a[i].x); sum += val; } diff --git a/func/omp/for_static_schedule.cpp b/func/omp/for_static_schedule.cpp index 01af9a026..ff15f21bb 100644 --- a/func/omp/for_static_schedule.cpp +++ b/func/omp/for_static_schedule.cpp @@ -3,6 +3,7 @@ #include +#define ITERATIONS 10 bool compareArrays(const char *label, int *actual, int *expected) { for (size_t i = 0; i < 4; i++) { @@ -25,13 +26,11 @@ bool compareArrays(const char *label, int *actual, int *expected) { * Simple counting test for static and static chunk scheduling */ FAASM_MAIN_FUNC() { - const int iterations = 10; - int countsA[4] = {0, 0, 0, 0}; int expectedA[4] = {3, 3, 3, 1}; // Based on native behaviour #pragma omp parallel for schedule(static, 3) num_threads(4) default(none) shared(countsA) - for (int i = 0; i < iterations; i++) { + for (int i = 0; i < ITERATIONS; i++) { int threadNum = omp_get_thread_num(); countsA[threadNum]++; } @@ -44,7 +43,7 @@ FAASM_MAIN_FUNC() { int expectedB[4] = {3, 3, 2, 2}; // Based on native behaviour #pragma omp parallel for schedule(static) num_threads(4) default(none) shared(countsB) - for (int i = 0; i < iterations; i++) { + for (int i = 0; i < ITERATIONS; i++) { int threadNum = omp_get_thread_num(); countsB[threadNum]++; } diff --git a/func/omp/nested_levels_test.cpp b/func/omp/nested_levels_test.cpp index c0f4de26e..176f693ec 100644 --- a/func/omp/nested_levels_test.cpp +++ b/func/omp/nested_levels_test.cpp @@ -91,7 +91,7 @@ int level2() { bool checkAllRun[n] = {false, false}; - #pragma omp parallel for num_threads(n) default(none) shared(r, checkAllRun, n, level2_failed) + #pragma omp parallel for num_threads(n) default(none) shared(r, checkAllRun, n, level2_failed, nested) for (int i = 0; i < 2; i++) { if (nested != is_nested()) { diff --git a/func/omp/simple_for.cpp b/func/omp/simple_for.cpp index 1a6bf2abc..1a97c7267 100644 --- a/func/omp/simple_for.cpp +++ b/func/omp/simple_for.cpp @@ -2,18 +2,18 @@ #include #include +#define TOTAL 10 FAASM_MAIN_FUNC() { - const int total = 10; - auto results = new int[total]; + auto results = new int[TOTAL]; bool failed = false; #pragma omp parallel for num_threads(2) schedule(static, 5) default(none) shared(results) - for (int i = 0; i < total; i++) { + for (int i = 0; i < TOTAL; i++) { results[i] = i * (1 + omp_get_thread_num()); } - for (int i = 0; i < total; i++) { + for (int i = 0; i < TOTAL; i++) { int expected = i < 5 ? i : 2 * i; if (results[i] != expected) { printf("Element %i falsely set to %d, expected %d\n", i, results[i], expected); diff --git a/func/omp/target_integral.cpp b/func/omp/target_integral.cpp new file mode 100644 index 000000000..25f2ec123 --- /dev/null +++ b/func/omp/target_integral.cpp @@ -0,0 +1,40 @@ +#include +#include + +const long num_steps = 100000000; +const double pi = 3.1415; +const double epsilon = 0.0001; + +int main() { + double x, sum = 0.0; + double step = 1.0 / (double) num_steps; + int *threads = new int[omp_get_max_threads()]; + int run_once = 0; + + #pragma omp target map(sum) + #pragma omp teams distribute parallel for default(none) private(x) firstprivate(step, run_once) shared(threads) reduction(+:sum) + for (long i = 1; i <= num_steps; i++) { + if (run_once == 0) { // There are more idiomatic ways to do this + threads[omp_get_thread_num()] = omp_get_thread_num(); + run_once = 1; + } + x = (i - 0.5) * step; + sum += 4.0 / (1.0 + x * x); + } + + for (int i = 0; i < omp_get_max_threads(); i++) { + if (i != threads[i]) { + printf("Thread %d didn't take part in computation\n ", i); + delete[] threads; + return EXIT_FAILURE; + } + } + delete[] threads; + + double result = step * sum; + if (abs(result - pi) > epsilon) { + printf("Integral calculation failed. Expected %lf, got %lf\n ", pi, result); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} diff --git a/include/edge/FunctionEndpoint.h b/include/edge/FunctionEndpoint.h deleted file mode 100644 index e46876d86..000000000 --- a/include/edge/FunctionEndpoint.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - - -namespace edge { - class FunctionEndpoint : public endpoint::Endpoint { - public: - FunctionEndpoint(); - - std::string handleFunction(message::Message &msg); - - std::shared_ptr getHandler() override; - - private: - Pistache::Rest::Router router; - - void setupRoutes(); - - void handleFunctionWrapper(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - - void handleAsyncFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response); - - void handlePythonFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response); - - void handleAsyncPythonFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response); - - void handleTypescriptFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response); - - void handleAsyncTypescriptFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response); - - message::Message buildMessageFromRequest(const Pistache::Rest::Request &request); - }; -} \ No newline at end of file diff --git a/include/wasm/syscalls.h b/include/wasm/syscalls.h index 2b4bc42b5..b4c5bf231 100644 --- a/include/wasm/syscalls.h +++ b/include/wasm/syscalls.h @@ -324,4 +324,5 @@ namespace wasm { void ompLink(); void chainLink(); void faasmLink(); + void rustLink(); } \ No newline at end of file diff --git a/k8s/legacy/edge-service.yml b/k8s/legacy/edge-service.yml deleted file mode 100644 index 17599ba25..000000000 --- a/k8s/legacy/edge-service.yml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: edge - namespace: faasm -spec: - selector: - role: edge - type: LoadBalancer - externalIPs: - - 192.168.0.38 # Must match the master node - ports: - - port: 8001 - targetPort: 8001 diff --git a/k8s/legacy/edge.yml b/k8s/legacy/edge.yml deleted file mode 100644 index c4410f22d..000000000 --- a/k8s/legacy/edge.yml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: edge - namespace: faasm - labels: - app: faasm -spec: - replicas: 2 - selector: - matchLabels: - app: faasm - role: edge - template: - metadata: - labels: - app: faasm - role: edge - spec: - containers: - - name: edge - image: faasm/edge - imagePullPolicy: Always - ports: - - containerPort: 8001 - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: nodeRole - operator: In - values: - - worker - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: role - operator: In - values: - - worker - topologyKey: kubernetes.io/hostname diff --git a/k8s/legacy/worker.yml b/k8s/legacy/worker.yml deleted file mode 100644 index 55d282271..000000000 --- a/k8s/legacy/worker.yml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: worker - namespace: faasm - labels: - app: faasm -spec: - replicas: 3 - selector: - matchLabels: - app: faasm - role: worker - template: - metadata: - labels: - app: faasm - role: worker - spec: - containers: - - name: worker - image: faasm/worker - imagePullPolicy: Always - securityContext: - privileged: yes - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: nodeRole - operator: In - values: - - worker - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: role - operator: In - values: - - worker - topologyKey: kubernetes.io/hostname diff --git a/lib-cpp/CMakeLists.txt b/libs/cpp/CMakeLists.txt similarity index 94% rename from lib-cpp/CMakeLists.txt rename to libs/cpp/CMakeLists.txt index 8717b32fc..527df8fb9 100644 --- a/lib-cpp/CMakeLists.txt +++ b/libs/cpp/CMakeLists.txt @@ -5,11 +5,12 @@ project(libfaasm) set(CMAKE_CXX_STANDARD 17) -set(PROJ_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/../include) +set(PROJ_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/../../include) include_directories(${CMAKE_CURRENT_LIST_DIR} ${PROJ_INCLUDE}) set(PUBLIC_HEADERS ${PROJ_INCLUDE}/faasm/core.h + ${PROJ_INCLUDE}/faasm/host_interface.h faasm/array.h faasm/compare.h faasm/counter.h diff --git a/lib-cpp/README.md b/libs/cpp/README.md similarity index 100% rename from lib-cpp/README.md rename to libs/cpp/README.md diff --git a/lib-cpp/compare.cpp b/libs/cpp/compare.cpp similarity index 100% rename from lib-cpp/compare.cpp rename to libs/cpp/compare.cpp diff --git a/lib-cpp/core.cpp b/libs/cpp/core.cpp similarity index 100% rename from lib-cpp/core.cpp rename to libs/cpp/core.cpp diff --git a/lib-cpp/counter.cpp b/libs/cpp/counter.cpp similarity index 100% rename from lib-cpp/counter.cpp rename to libs/cpp/counter.cpp diff --git a/lib-cpp/faasm/array.h b/libs/cpp/faasm/array.h similarity index 100% rename from lib-cpp/faasm/array.h rename to libs/cpp/faasm/array.h diff --git a/lib-cpp/faasm/compare.h b/libs/cpp/faasm/compare.h similarity index 100% rename from lib-cpp/faasm/compare.h rename to libs/cpp/faasm/compare.h diff --git a/lib-cpp/faasm/counter.h b/libs/cpp/faasm/counter.h similarity index 100% rename from lib-cpp/faasm/counter.h rename to libs/cpp/faasm/counter.h diff --git a/lib-cpp/faasm/faasm.h b/libs/cpp/faasm/faasm.h similarity index 100% rename from lib-cpp/faasm/faasm.h rename to libs/cpp/faasm/faasm.h diff --git a/lib-cpp/faasm/files.h b/libs/cpp/faasm/files.h similarity index 100% rename from lib-cpp/faasm/files.h rename to libs/cpp/faasm/files.h diff --git a/lib-cpp/faasm/input.h b/libs/cpp/faasm/input.h similarity index 100% rename from lib-cpp/faasm/input.h rename to libs/cpp/faasm/input.h diff --git a/lib-cpp/faasm/matrix.h b/libs/cpp/faasm/matrix.h similarity index 100% rename from lib-cpp/faasm/matrix.h rename to libs/cpp/faasm/matrix.h diff --git a/lib-cpp/faasm/pool.h b/libs/cpp/faasm/pool.h similarity index 100% rename from lib-cpp/faasm/pool.h rename to libs/cpp/faasm/pool.h diff --git a/lib-cpp/faasm/print.h b/libs/cpp/faasm/print.h similarity index 100% rename from lib-cpp/faasm/print.h rename to libs/cpp/faasm/print.h diff --git a/lib-cpp/faasm/random.h b/libs/cpp/faasm/random.h similarity index 100% rename from lib-cpp/faasm/random.h rename to libs/cpp/faasm/random.h diff --git a/lib-cpp/faasm/sgd.h b/libs/cpp/faasm/sgd.h similarity index 100% rename from lib-cpp/faasm/sgd.h rename to libs/cpp/faasm/sgd.h diff --git a/lib-cpp/faasm/state.h b/libs/cpp/faasm/state.h similarity index 100% rename from lib-cpp/faasm/state.h rename to libs/cpp/faasm/state.h diff --git a/lib-cpp/faasm/time.h b/libs/cpp/faasm/time.h similarity index 100% rename from lib-cpp/faasm/time.h rename to libs/cpp/faasm/time.h diff --git a/lib-cpp/files.cpp b/libs/cpp/files.cpp similarity index 100% rename from lib-cpp/files.cpp rename to libs/cpp/files.cpp diff --git a/lib-cpp/input.cpp b/libs/cpp/input.cpp similarity index 100% rename from lib-cpp/input.cpp rename to libs/cpp/input.cpp diff --git a/lib-cpp/matrix.cpp b/libs/cpp/matrix.cpp similarity index 100% rename from lib-cpp/matrix.cpp rename to libs/cpp/matrix.cpp diff --git a/lib-cpp/pool.cpp b/libs/cpp/pool.cpp similarity index 100% rename from lib-cpp/pool.cpp rename to libs/cpp/pool.cpp diff --git a/lib-cpp/print.cpp b/libs/cpp/print.cpp similarity index 100% rename from lib-cpp/print.cpp rename to libs/cpp/print.cpp diff --git a/lib-cpp/random.cpp b/libs/cpp/random.cpp similarity index 100% rename from lib-cpp/random.cpp rename to libs/cpp/random.cpp diff --git a/lib-cpp/sgd.cpp b/libs/cpp/sgd.cpp similarity index 100% rename from lib-cpp/sgd.cpp rename to libs/cpp/sgd.cpp diff --git a/lib-cpp/state.cpp b/libs/cpp/state.cpp similarity index 100% rename from lib-cpp/state.cpp rename to libs/cpp/state.cpp diff --git a/lib-cpp/time.cpp b/libs/cpp/time.cpp similarity index 100% rename from lib-cpp/time.cpp rename to libs/cpp/time.cpp diff --git a/lib-cpp/zygote.cpp b/libs/cpp/zygote.cpp similarity index 100% rename from lib-cpp/zygote.cpp rename to libs/cpp/zygote.cpp diff --git a/lib-faasmp/CMakeLists.txt b/libs/faasmp/CMakeLists.txt similarity index 100% rename from lib-faasmp/CMakeLists.txt rename to libs/faasmp/CMakeLists.txt diff --git a/lib-faasmp/README.md b/libs/faasmp/README.md similarity index 100% rename from lib-faasmp/README.md rename to libs/faasmp/README.md diff --git a/lib-faasmp/faasmp.cpp b/libs/faasmp/faasmp.cpp similarity index 100% rename from lib-faasmp/faasmp.cpp rename to libs/faasmp/faasmp.cpp diff --git a/lib-faasmp/faasmp.imports b/libs/faasmp/faasmp.imports similarity index 78% rename from lib-faasmp/faasmp.imports rename to libs/faasmp/faasmp.imports index f65ab9231..5b92c9121 100644 --- a/lib-faasmp/faasmp.imports +++ b/libs/faasmp/faasmp.imports @@ -27,6 +27,15 @@ omp_set_num_threads omp_get_level omp_get_max_active_levels omp_set_max_active_levels +omp_get_wtime # Debug functions __faasmp_debug_copy + +# GPU stuff +__kmpc_push_target_tripcount +__kmpc_fork_teams +__tgt_target_teams +__tgt_bin_desc +__tgt_register_lib +__tgt_unregister_lib diff --git a/lib-faasmp/faasmp/faasmp.h b/libs/faasmp/faasmp/faasmp.h similarity index 100% rename from lib-faasmp/faasmp/faasmp.h rename to libs/faasmp/faasmp/faasmp.h diff --git a/lib-faasmp/omp.h b/libs/faasmp/omp.h similarity index 100% rename from lib-faasmp/omp.h rename to libs/faasmp/omp.h diff --git a/lib-faasmp/z_Linux_asm.S b/libs/faasmp/z_Linux_asm.S similarity index 73% rename from lib-faasmp/z_Linux_asm.S rename to libs/faasmp/z_Linux_asm.S index c069c7e77..22828416b 100644 --- a/lib-faasmp/z_Linux_asm.S +++ b/libs/faasmp/z_Linux_asm.S @@ -34,3 +34,22 @@ .gomp_critical_user_.var: .int64 42 # 0x2a .size .gomp_critical_user_.var, 8 + +// GPU stuff + .hidden .omp_offloading.entries_begin + .type .omp_offloading.entries_begin,@object + .section .data..omp_offloading.entries_begin,"",@ + .globl .omp_offloading.entries_begin + .p2align 4 +.omp_offloading.entries_begin: + .int64 42 # 0x2a + .size .omp_offloading.entries_begin, 8 + + .hidden .omp_offloading.entries_end + .type .omp_offloading.entries_end,@object + .section .data..omp_offloading.entries_end,"",@ + .globl .omp_offloading.entries_end + .p2align 4 +.omp_offloading.entries_end: + .int64 42 # 0x2a + .size .omp_offloading.entries_end, 8 diff --git a/lib-faasmpi/CMakeLists.txt b/libs/faasmpi/CMakeLists.txt similarity index 95% rename from lib-faasmpi/CMakeLists.txt rename to libs/faasmpi/CMakeLists.txt index 2f78c84e6..61b3e21fb 100644 --- a/lib-faasmpi/CMakeLists.txt +++ b/libs/faasmpi/CMakeLists.txt @@ -5,7 +5,7 @@ project(libfaasmpi) set(CMAKE_CXX_STANDARD 17) -set(PROJ_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/../include/faasmpi) +set(PROJ_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/../../include/faasmpi) include_directories(${CMAKE_CURRENT_LIST_DIR} ${PROJ_INCLUDE}) set(PUBLIC_HEADERS diff --git a/lib-faasmpi/README.md b/libs/faasmpi/README.md similarity index 100% rename from lib-faasmpi/README.md rename to libs/faasmpi/README.md diff --git a/lib-faasmpi/faasmpi.imports b/libs/faasmpi/faasmpi.imports similarity index 100% rename from lib-faasmpi/faasmpi.imports rename to libs/faasmpi/faasmpi.imports diff --git a/lib-faasmpi/faasmpi/faasmpi.h b/libs/faasmpi/faasmpi/faasmpi.h similarity index 100% rename from lib-faasmpi/faasmpi/faasmpi.h rename to libs/faasmpi/faasmpi/faasmpi.h diff --git a/lib-faasmpi/mpi.cpp b/libs/faasmpi/mpi.cpp similarity index 100% rename from lib-faasmpi/mpi.cpp rename to libs/faasmpi/mpi.cpp diff --git a/lib-pyinit/CMakeLists.txt b/libs/pyinit/CMakeLists.txt similarity index 100% rename from lib-pyinit/CMakeLists.txt rename to libs/pyinit/CMakeLists.txt diff --git a/lib-pyinit/README.md b/libs/pyinit/README.md similarity index 100% rename from lib-pyinit/README.md rename to libs/pyinit/README.md diff --git a/lib-pyinit/faasm/pyinit.h b/libs/pyinit/faasm/pyinit.h similarity index 100% rename from lib-pyinit/faasm/pyinit.h rename to libs/pyinit/faasm/pyinit.h diff --git a/lib-pyinit/pyinit.c b/libs/pyinit/pyinit.c similarity index 100% rename from lib-pyinit/pyinit.c rename to libs/pyinit/pyinit.c diff --git a/libs/rust/CMakeLists.txt b/libs/rust/CMakeLists.txt new file mode 100644 index 000000000..5b715de4b --- /dev/null +++ b/libs/rust/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.0) +project(librfaasm) + +# ------ Faasm Rust library ------ # + +set(TARGET rfaasm) + +set(CMAKE_CXX_STANDARD 17) + +set(PUBLIC_HEADERS + faasm/rfaasm.h + ) + +# Create fake target since rust uses lib-cpp's libfaasm +add_custom_target(${TARGET}) +set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") + +# Install public header manually since we used a fake target +if (FAASM_BUILD_TYPE STREQUAL "wasm") + install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_SYSROOT}/include/faasm) +else () + install(FILES ${PUBLIC_HEADER} DESTINATION include/faasm) +endif () diff --git a/libs/rust/README.md b/libs/rust/README.md new file mode 100644 index 000000000..52990467a --- /dev/null +++ b/libs/rust/README.md @@ -0,0 +1,5 @@ +# Faasm Rust Library + +This is a set of extra utilities to be used in [Rust functions](../docs/rust.md) along with the C++ toolchain. + +It augments the existing standard library with any Rust-specific tweaks. diff --git a/libs/rust/faasm/rfaasm.h b/libs/rust/faasm/rfaasm.h new file mode 100644 index 000000000..4051eb719 --- /dev/null +++ b/libs/rust/faasm/rfaasm.h @@ -0,0 +1,15 @@ +#ifndef RFAASM_H +#define RFAASM_H + + +#ifdef __cplusplus +extern "C" { +#endif + +void __println(const char *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/edge/CMakeLists.txt b/src/edge/CMakeLists.txt deleted file mode 100644 index e7603a36d..000000000 --- a/src/edge/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -include_directories(${FAASM_INCLUDE_DIR}/edge) - -set(LIB_FILES - FunctionEndpoint.cpp - ${FAASM_INCLUDE_DIR}/edge/FunctionEndpoint.h - ) - -faasm_private_lib(edge_lib "${LIB_FILES}") - -target_link_libraries(edge_lib - scheduler - endpoint - ) - -add_executable(edge edge_server.cpp) -target_link_libraries(edge edge_lib) diff --git a/src/edge/FunctionEndpoint.cpp b/src/edge/FunctionEndpoint.cpp deleted file mode 100644 index d2159669b..000000000 --- a/src/edge/FunctionEndpoint.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "FunctionEndpoint.h" - -#include - -#include -#include - -#include -#include - -namespace edge { - FunctionEndpoint::FunctionEndpoint() : - Endpoint(8001, 40) { - - setupRoutes(); - } - - std::shared_ptr FunctionEndpoint::getHandler() { - return router.handler(); - } - - void FunctionEndpoint::setupRoutes() { - // C/C++ - Pistache::Rest::Routes::Post(router, "/f/:user/:function", - Pistache::Rest::Routes::bind(&FunctionEndpoint::handleFunctionWrapper, this)); - Pistache::Rest::Routes::Post(router, "/fa/:user/:function", - Pistache::Rest::Routes::bind(&FunctionEndpoint::handleAsyncFunctionWrapper, this)); - - // Python - Pistache::Rest::Routes::Post(router, "/p/:user/:function", - Pistache::Rest::Routes::bind(&FunctionEndpoint::handlePythonFunctionWrapper, - this)); - Pistache::Rest::Routes::Post(router, "/pa/:user/:function", - Pistache::Rest::Routes::bind(&FunctionEndpoint::handleAsyncPythonFunctionWrapper, - this)); - - // Typescript - Pistache::Rest::Routes::Post(router, "/t/:user/:function", - Pistache::Rest::Routes::bind(&FunctionEndpoint::handleTypescriptFunctionWrapper, - this)); - Pistache::Rest::Routes::Post(router, "/ta/:user/:function", - Pistache::Rest::Routes::bind( - &FunctionEndpoint::handleAsyncTypescriptFunctionWrapper, - this)); - } - - void FunctionEndpoint::handleFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(false); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - void FunctionEndpoint::handleAsyncFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(true); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - void convertMessageToPython(message::Message &msg) { - msg.set_ispython(true); - msg.set_pythonfunction(msg.function()); - msg.set_pythonuser(msg.user()); - - msg.set_user(PYTHON_USER); - msg.set_function(PYTHON_FUNC); - } - - void FunctionEndpoint::handlePythonFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(false); - - convertMessageToPython(msg); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - void - FunctionEndpoint::handleAsyncPythonFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(true); - - convertMessageToPython(msg); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - void FunctionEndpoint::handleTypescriptFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(false); - msg.set_istypescript(true); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - void FunctionEndpoint::handleAsyncTypescriptFunctionWrapper(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter response) { - message::Message msg = this->buildMessageFromRequest(request); - msg.set_isasync(true); - msg.set_istypescript(true); - - const std::string result = this->handleFunction(msg); - response.send(Pistache::Http::Code::Ok, result); - } - - std::string FunctionEndpoint::handleFunction(message::Message &msg) { - const std::shared_ptr &logger = util::getLogger(); - - // Make the call - scheduler::GlobalMessageBus &globalBus = scheduler::getGlobalMessageBus(); - globalBus.enqueueMessage(msg); - - const std::string funcStr = util::funcToString(msg, true); - - if (msg.isasync()) { - logger->info("Async request {}", funcStr); - return util::buildAsyncResponse(msg); - } else { - util::SystemConfig &conf = util::getSystemConfig(); - logger->info("Sync request {}", funcStr); - message::Message result = globalBus.getFunctionResult(msg.id(), conf.globalMessageTimeout); - - logger->info("Finished request {}", funcStr); - - return result.outputdata() + "\n"; - } - } - - message::Message FunctionEndpoint::buildMessageFromRequest(const Pistache::Rest::Request &request) { - // Parse request params - auto user = request.param(":user").as(); - auto function = request.param(":function").as(); - - // Get the request body - const std::string requestData = request.body(); - - // Build message - message::Message msg = util::messageFactory(user, function); - msg.set_inputdata(requestData); - - return msg; - } -} - diff --git a/src/edge/edge_server.cpp b/src/edge/edge_server.cpp deleted file mode 100644 index 3a19d67ca..000000000 --- a/src/edge/edge_server.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include - -#include - -#if AWS_SUPPORT == 1 -#include -#endif - -int main() { - util::initLogging(); - -#if AWS_SUPPORT == 1 - awswrapper::initSDK(); -#endif - - edge::FunctionEndpoint endpoint; - endpoint.start(); - - return 0; -} \ No newline at end of file diff --git a/experiment/CMakeLists.txt b/src/experiment/CMakeLists.txt similarity index 100% rename from experiment/CMakeLists.txt rename to src/experiment/CMakeLists.txt diff --git a/experiment/max_mem_experiment.cpp b/src/experiment/max_mem_experiment.cpp similarity index 100% rename from experiment/max_mem_experiment.cpp rename to src/experiment/max_mem_experiment.cpp diff --git a/experiment/max_thread_experiment.cpp b/src/experiment/max_thread_experiment.cpp similarity index 100% rename from experiment/max_thread_experiment.cpp rename to src/experiment/max_thread_experiment.cpp diff --git a/experiment/rlimit_experiment.cpp b/src/experiment/rlimit_experiment.cpp similarity index 100% rename from experiment/rlimit_experiment.cpp rename to src/experiment/rlimit_experiment.cpp diff --git a/src/wasm/CMakeLists.txt b/src/wasm/CMakeLists.txt index bfd579852..a23104e3d 100644 --- a/src/wasm/CMakeLists.txt +++ b/src/wasm/CMakeLists.txt @@ -18,6 +18,7 @@ set(LIB_FILES mpi.cpp network.cpp openmp.cpp + rust.cpp syscalls.cpp threads.cpp typescript.cpp diff --git a/src/wasm/openmp.cpp b/src/wasm/openmp.cpp index 85883ce6f..d5ec242de 100644 --- a/src/wasm/openmp.cpp +++ b/src/wasm/openmp.cpp @@ -1,5 +1,7 @@ #include "WasmModule.h" +#include + #include #include @@ -105,6 +107,106 @@ namespace wasm { return getExecutingModule()->executeThread(threadArgs->spec); } + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__kmpc_push_target_tripcount", void, __kmpc_push_target_tripcount, I64 device_id, U64 loop_tripcount) { + util::getLogger()->debug("S - __kmpc_push_target_tripcount {} {}", device_id, loop_tripcount); + std::runtime_error("Unimplemented OMP function"); + } + + /** + * Experimental function to run GPU code. Fork team shouldn't create threads, and not worry about levels. + * Arguments similar to fork_call + */ + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__kmpc_fork_teams", void, __kmpc_fork_teams, I32 locPtr, I32 argc, I32 microtaskPtr, I32 argsPtr) { + util::getLogger()->warn("EXPERIMENTAL: S - __kmpc_fork_teams {} {} {} {}", locPtr, argc, microtaskPtr, argsPtr); + + WasmModule *parentModule = getExecutingModule(); + Runtime::Memory *memoryPtr = parentModule->defaultMemory; + message::Message *parentCall = getExecutingCall(); + + // Retrieve the microstask function from the table + Runtime::Function *func = Runtime::asFunction( + Runtime::getTableElement(getExecutingModule()->defaultTable, microtaskPtr)); + + int nextNumThreads = 1; // We only want one thread created + + std::vector threadArgs; + threadArgs.reserve(nextNumThreads); + + std::vector> microtaskArgs; + microtaskArgs.reserve(nextNumThreads); + + std::vector platformThreads; + platformThreads.reserve(nextNumThreads); + + for (int threadNum = 0; threadNum < nextNumThreads; threadNum++) { + microtaskArgs.push_back({threadNum, argc}); + if (argc > 0) { + // Get pointer to start of arguments in host memory + U32 *pointers = Runtime::memoryArrayPtr(memoryPtr, argsPtr, argc); + for (int argIdx = 0; argIdx < argc; argIdx++) { + microtaskArgs[threadNum].emplace_back(pointers[argIdx]); + } + } + threadArgs.push_back({ + .tid = threadNum, .newLevel = thisLevel, + .spec.contextRuntimeData = contextRuntimeData, + .spec.parentModule = parentModule, .spec.parentCall = parentCall, + .spec.func = func, .spec.funcArgs = microtaskArgs[threadNum].data(), + .spec.stackSize = OMP_STACK_SIZE + }); + } + + // Create the threads themselves + for (int threadNum = 0; threadNum < nextNumThreads; threadNum++) { + platformThreads.emplace_back(Platform::createThread( + 0, + ompThreadEntryFunc, + &threadArgs[threadNum] + )); + } + + // Await all threads + I64 numErrors = 0; + for (auto t: platformThreads) { + numErrors += Platform::joinThread(t); + } + + if (numErrors) { + throw std::runtime_error(fmt::format("{} OMP threads have exited with errors", numErrors)); + } + } + + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__tgt_target_teams", I32, __tgt_target_teams, I64 device_id, I32 host_ptr, + I32 arg_num, I32 args_base, I32 args, I64 arg_sizes, + I64 arg_types, I32 team_num, I32 thread_limit) { + util::getLogger()->debug("S - __tgt_target_teams {} {} {} .....", device_id, host_ptr, thread_limit); + std::runtime_error("Unimplemented OMP function"); + return 0; + } + + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__tgt_bin_desc ", void, __tgt_bin_desc, I32 desc) { + util::getLogger()->debug("S - __tgt_bin_desc {}", desc); + std::runtime_error("Unimplemented OMP function"); + } + + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__tgt_register_lib", void, __tgt_register_lib, I32 desc) { + util::getLogger()->debug("S - __tgt_register_lib {}", desc); + std::runtime_error("Unimplemented OMP function"); + } + + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__tgt_unregister_lib", void, __tgt_unregister_lib, I32 desc) { + util::getLogger()->debug("S - __tgt_unregister_lib {}", desc); + std::runtime_error("Unimplemented OMP function"); + } + + /** + * @return the current UNIX timestamp in seconds. + */ + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "omp_get_wtime", F64, omp_get_wtime) { + util::getLogger()->debug("S - omp_get_wtime"); + return time(NULL); + } + /** * @return the thread number, within its team, of the thread executing the function. */ diff --git a/src/wasm/rust.cpp b/src/wasm/rust.cpp new file mode 100644 index 000000000..33cc5ec23 --- /dev/null +++ b/src/wasm/rust.cpp @@ -0,0 +1,16 @@ +#include "WasmModule.h" + +#include +#include + +namespace wasm { + + WAVM_DEFINE_INTRINSIC_FUNCTION(env, "__println", void, __println, I32 strPtr) { + const std::string toPrint = getStringFromWasm(strPtr); + printf("%s\n", toPrint.c_str()); + } + + void rustLink() { + + } +} diff --git a/src/wasm/syscalls.cpp b/src/wasm/syscalls.cpp index 58ba55dbd..085dff5ea 100644 --- a/src/wasm/syscalls.cpp +++ b/src/wasm/syscalls.cpp @@ -198,5 +198,6 @@ namespace wasm { mathsLink(); mpiLink(); ompLink(); + rustLink(); } } \ No newline at end of file diff --git a/tasks/codegen.py b/tasks/codegen.py index 857d4df51..7a1404df7 100644 --- a/tasks/codegen.py +++ b/tasks/codegen.py @@ -41,6 +41,7 @@ def local(ctx): _do_codegen_user("errors") _do_codegen_user("omp") _do_codegen_user("mpi") + _do_codegen_user("rust") # Run these in parallel p = Pool(3) diff --git a/tasks/experiments.py b/tasks/experiments.py index 01bbd6857..25104c451 100644 --- a/tasks/experiments.py +++ b/tasks/experiments.py @@ -354,7 +354,7 @@ def execute_benchmark(self, native): return super().execute_benchmark(native) def get_wrk_script(self): - return join(PROJ_ROOT, "conf", "tflite_bench.lua") + return join(PROJ_ROOT, "deploy", "conf", "tflite_bench.lua") def get_result_folder_name(self, system): folder_name = "SYSTEM_{}_COLD_{}_THREADS_{}_CONNS_{}_DELAY_{}_logs".format( diff --git a/tasks/knative.py b/tasks/knative.py index bcb2d02ea..526ad4899 100644 --- a/tasks/knative.py +++ b/tasks/knative.py @@ -12,13 +12,12 @@ from tasks.util.endpoints import get_invoke_host_port from tasks.util.version import get_faasm_version -K8S_DIR = join(PROJ_ROOT, "k8s") +K8S_DIR = join(PROJ_ROOT, "deploy", "k8s") BARE_METAL_CONF = join(K8S_DIR, "bare-metal") BARE_METAL_REMOTE_CONF = join(K8S_DIR, "bare-metal-remote") LOCAL_CONF = join(K8S_DIR, "local") COMMON_CONF = join(K8S_DIR, "common") IBM_CONF = join(K8S_DIR, "ibm") -LEGACY_CONF = join(K8S_DIR, "legacy") KNATIVE_VERSION = "0.13.0" diff --git a/tasks/libs.py b/tasks/libs.py index 706d3c6e4..801813d6f 100644 --- a/tasks/libs.py +++ b/tasks/libs.py @@ -19,6 +19,20 @@ PRK_DIR = join(THIRD_PARTY_DIR, "ParResKernels") +@task +def toolchain(ctx, clean=False): + """ + Compile and install all libs crucial to the toolchain + """ + libc(ctx) + malloc(ctx, clean=clean) + faasm(ctx, clean=clean) + fake(ctx, clean=clean) + eigen(ctx) + zlib(ctx) + tflite(ctx, clean=clean) + + @task def libc(ctx): """ @@ -89,7 +103,7 @@ def native(ctx, clean=False): def _build_faasm_lib(dir_name, clean): - work_dir = join(PROJ_ROOT, dir_name) + work_dir = join(PROJ_ROOT, "libs", dir_name) build_dir = join(PROJ_ROOT, "build", dir_name) clean_dir(build_dir, clean) @@ -115,10 +129,11 @@ def faasm(ctx, clean=False): """ Compile and install all Faasm libraries """ - _build_faasm_lib("lib-cpp", clean) - _build_faasm_lib("lib-pyinit", clean) - _build_faasm_lib("lib-faasmp", clean) - _build_faasm_lib("lib-faasmpi", clean) + _build_faasm_lib("cpp", clean) + _build_faasm_lib("pyinit", clean) + _build_faasm_lib("faasmp", clean) + _build_faasm_lib("faasmpi", clean) + _build_faasm_lib("rust", clean) @task @@ -126,7 +141,7 @@ def faasmp(ctx, clean=False): """ Compile and install the Faasm OpenMP library """ - _build_faasm_lib("lib-faasmp", clean) + _build_faasm_lib("faasmp", clean) @task @@ -134,7 +149,15 @@ def faasmpi(ctx, clean=False): """ Compile and install the Faasm MPI library """ - _build_faasm_lib("lib-faasmpi", clean) + _build_faasm_lib("faasmpi", clean) + + +@task +def rust(ctx, clean=False): + """ + Install Rust library + """ + _build_faasm_lib("rust", clean) @task @@ -307,7 +330,7 @@ def png(ctx): @task -def zlib(ctx): +def zlib(ctx, clean=False): """ Compile and install zlib """ diff --git a/tasks/toolchain.py b/tasks/toolchain.py index a99163a01..87335cf91 100644 --- a/tasks/toolchain.py +++ b/tasks/toolchain.py @@ -2,7 +2,7 @@ from os import remove from os.path import exists, join from shutil import rmtree -from subprocess import check_output +from subprocess import check_output, call from invoke import task @@ -41,13 +41,13 @@ def download_sysroot(ctx): @task -def download_toolchain(ctx): +def download_toolchain(ctx, version=None): """ Download the Faasm toolchain """ url = get_toolchain_url() - tar_name = get_toolchain_tar_name() - tar_path = get_toolchain_tar_path() + tar_name = get_toolchain_tar_name(version=version) + tar_path = get_toolchain_tar_path(version=version) if exists(TOOLCHAIN_INSTALL): print("Deleting existing toolchain at {}".format(TOOLCHAIN_INSTALL)) @@ -88,3 +88,17 @@ def download_runtime(ctx, nocodegen=False): if not nocodegen: print("Running codegen") tasks.python.codegen(ctx) + + +@task +def version(ctx): + """ + Prints the version of various LLVM tools + """ + bin_dir = join(TOOLCHAIN_INSTALL, "bin") + + for exe in ["clang", "clang++", "llvm-ar", "wasm-ld"]: + bin_path = join(bin_dir, exe) + print("---- {} ----".format(exe)) + call("{} --version".format(bin_path), shell=True) + print("") diff --git a/tasks/util/release.py b/tasks/util/release.py index c49739da4..f32f66a06 100644 --- a/tasks/util/release.py +++ b/tasks/util/release.py @@ -33,8 +33,8 @@ def get_toolchain_tar_name(version=None): return "faasm-toolchain-{}.tar.gz".format(version) -def get_toolchain_tar_path(): - tar_name = get_toolchain_tar_name() +def get_toolchain_tar_path(version=None): + tar_name = get_toolchain_tar_name(version=version) return join(FAASM_LOCAL_DIR, tar_name) @@ -63,7 +63,7 @@ def tar_toolchain(): tar_path = get_toolchain_tar_path() print("Creating archive of Faasm toolchain") - check_output("tar -cf {} toolchain".format(tar_name), shell=True, cwd=FAASM_LOCAL_DIR) + check_output("tar -czf {} toolchain".format(tar_name), shell=True, cwd=FAASM_LOCAL_DIR) return tar_name, tar_path @@ -74,7 +74,7 @@ def tar_runtime_root(): # Compress print("Creating archive of Faasm runtime root") - check_output("tar -cf {} runtime_root".format(tar_path), shell=True, cwd=FAASM_LOCAL_DIR) + check_output("tar -czf {} runtime_root".format(tar_path), shell=True, cwd=FAASM_LOCAL_DIR) return tar_name, tar_path @@ -84,6 +84,6 @@ def tar_sysroot(): tar_path = get_sysroot_tar_path() print("Creating archive of Faasm sysroot") - check_output("tar -cf {} llvm-sysroot".format(tar_name), shell=True, cwd=FAASM_LOCAL_DIR) + check_output("tar -czf {} llvm-sysroot".format(tar_name), shell=True, cwd=FAASM_LOCAL_DIR) return tar_name, tar_path diff --git a/test/edge/test_edge.cpp b/test/edge/test_edge.cpp deleted file mode 100644 index bbcff05cc..000000000 --- a/test/edge/test_edge.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include - -#include "utils.h" -#include -#include - -using namespace Pistache; - -namespace tests { - TEST_CASE("Test invoking a function", "[edge]") { - cleanSystem(); - - std::string user; - std::string func; - std::string inputData; - - std::string expectedUser; - std::string expectedFunc; - std::string expectedInputData; - - SECTION("Normal function") { - user = expectedUser = "demo"; - func = expectedFunc = "echo"; - inputData = expectedInputData = "123"; - } - - SECTION("Python function") { - user = "python"; - func = "numpy_test"; - inputData = ""; - - expectedUser = PYTHON_USER; - expectedFunc = PYTHON_FUNC; - expectedInputData = "python/numpy_test/function.py"; - } - - // Note - must be async to avoid needing a result - message::Message call = util::messageFactory(user, func); - call.set_isasync(true); - call.set_inputdata(inputData); - - // Get global bus - scheduler::GlobalMessageBus &globalBus = scheduler::getGlobalMessageBus(); - - edge::FunctionEndpoint endpoint; - const std::string responseStr = endpoint.handleFunction(call); - - const message::Message actual = globalBus.nextMessage(); - - REQUIRE(actual.user() == user); - REQUIRE(actual.function() == func); - REQUIRE(actual.inputdata() == inputData); - REQUIRE(actual.id() == std::stoi(responseStr)); - } -} \ No newline at end of file diff --git a/test_aws/CMakeLists.txt b/tests/aws/CMakeLists.txt similarity index 86% rename from test_aws/CMakeLists.txt rename to tests/aws/CMakeLists.txt index 7050777dd..3f21b7dde 100644 --- a/test_aws/CMakeLists.txt +++ b/tests/aws/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE TEST_FILES ${CMAKE_CURRENT_LIST_DIR} test_*.cpp) include_directories( ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/../test_utils + ${CMAKE_CURRENT_LIST_DIR}/../utils ) add_executable( diff --git a/test_aws/aws/test_lambda.cpp b/tests/aws/aws/test_lambda.cpp similarity index 100% rename from test_aws/aws/test_lambda.cpp rename to tests/aws/aws/test_lambda.cpp diff --git a/test_aws/aws/test_s3.cpp b/tests/aws/aws/test_s3.cpp similarity index 100% rename from test_aws/aws/test_s3.cpp rename to tests/aws/aws/test_s3.cpp diff --git a/test_aws/aws/test_sqs.cpp b/tests/aws/aws/test_sqs.cpp similarity index 100% rename from test_aws/aws/test_sqs.cpp rename to tests/aws/aws/test_sqs.cpp diff --git a/test_aws/main.cpp b/tests/aws/main.cpp similarity index 100% rename from test_aws/main.cpp rename to tests/aws/main.cpp diff --git a/test_aws/scheduler/test_sqs_global_bus.cpp b/tests/aws/scheduler/test_sqs_global_bus.cpp similarity index 100% rename from test_aws/scheduler/test_sqs_global_bus.cpp rename to tests/aws/scheduler/test_sqs_global_bus.cpp diff --git a/test_ibm/CMakeLists.txt b/tests/ibm/CMakeLists.txt similarity index 88% rename from test_ibm/CMakeLists.txt rename to tests/ibm/CMakeLists.txt index b3ed26a0b..2e302e647 100644 --- a/test_ibm/CMakeLists.txt +++ b/tests/ibm/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE TEST_FILES ${CMAKE_CURRENT_LIST_DIR} test_*.cpp) include_directories( ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/../test_utils + ${CMAKE_CURRENT_LIST_DIR}/../utils ) add_executable( diff --git a/test_ibm/ibm/test_storage_wrapper.cpp b/tests/ibm/ibm/test_storage_wrapper.cpp similarity index 100% rename from test_ibm/ibm/test_storage_wrapper.cpp rename to tests/ibm/ibm/test_storage_wrapper.cpp diff --git a/test_ibm/main.cpp b/tests/ibm/main.cpp similarity index 100% rename from test_ibm/main.cpp rename to tests/ibm/main.cpp diff --git a/test_knative/CMakeLists.txt b/tests/knative/CMakeLists.txt similarity index 88% rename from test_knative/CMakeLists.txt rename to tests/knative/CMakeLists.txt index 8fcb96567..dd59c0172 100644 --- a/test_knative/CMakeLists.txt +++ b/tests/knative/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE TEST_FILES ${CMAKE_CURRENT_LIST_DIR} test_*.cpp) include_directories( ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/../test_utils + ${CMAKE_CURRENT_LIST_DIR}/../utils ) add_executable( diff --git a/test_knative/knative/test_invoke.cpp b/tests/knative/knative/test_invoke.cpp similarity index 100% rename from test_knative/knative/test_invoke.cpp rename to tests/knative/knative/test_invoke.cpp diff --git a/test_knative/main.cpp b/tests/knative/main.cpp similarity index 100% rename from test_knative/main.cpp rename to tests/knative/main.cpp diff --git a/test/CMakeLists.txt b/tests/test/CMakeLists.txt similarity index 72% rename from test/CMakeLists.txt rename to tests/test/CMakeLists.txt index 410d2b58b..9adf94cde 100644 --- a/test/CMakeLists.txt +++ b/tests/test/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE TEST_FILES ${CMAKE_CURRENT_LIST_DIR} test_*.cpp) include_directories( ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/../test_utils + ${CMAKE_CURRENT_LIST_DIR}/../utils ) add_executable( @@ -13,4 +13,4 @@ add_executable( target_link_libraries(tests test_utils) -add_test(NAME tests COMMAND "test/tests") +add_test(NAME tests COMMAND "tests/test/tests") diff --git a/test/data/test_matrix.cpp b/tests/test/data/test_matrix.cpp similarity index 100% rename from test/data/test_matrix.cpp rename to tests/test/data/test_matrix.cpp diff --git a/test/emulator/test_emulator.cpp b/tests/test/emulator/test_emulator.cpp similarity index 100% rename from test/emulator/test_emulator.cpp rename to tests/test/emulator/test_emulator.cpp diff --git a/test/ibm/test_ibm_handler.cpp b/tests/test/ibm/test_ibm_handler.cpp similarity index 100% rename from test/ibm/test_ibm_handler.cpp rename to tests/test/ibm/test_ibm_handler.cpp diff --git a/test/ir_cache/test_ir_registry.cpp b/tests/test/ir_cache/test_ir_registry.cpp similarity index 100% rename from test/ir_cache/test_ir_registry.cpp rename to tests/test/ir_cache/test_ir_registry.cpp diff --git a/test/knative/test_knative_handler.cpp b/tests/test/knative/test_knative_handler.cpp similarity index 100% rename from test/knative/test_knative_handler.cpp rename to tests/test/knative/test_knative_handler.cpp diff --git a/test/lib/test_array.cpp b/tests/test/lib/test_array.cpp similarity index 100% rename from test/lib/test_array.cpp rename to tests/test/lib/test_array.cpp diff --git a/test/lib/test_counter.cpp b/tests/test/lib/test_counter.cpp similarity index 100% rename from test/lib/test_counter.cpp rename to tests/test/lib/test_counter.cpp diff --git a/test/lib/test_files.cpp b/tests/test/lib/test_files.cpp similarity index 100% rename from test/lib/test_files.cpp rename to tests/test/lib/test_files.cpp diff --git a/test/lib/test_input.cpp b/tests/test/lib/test_input.cpp similarity index 100% rename from test/lib/test_input.cpp rename to tests/test/lib/test_input.cpp diff --git a/test/lib/test_matrix.cpp b/tests/test/lib/test_matrix.cpp similarity index 100% rename from test/lib/test_matrix.cpp rename to tests/test/lib/test_matrix.cpp diff --git a/test/lib/test_random.cpp b/tests/test/lib/test_random.cpp similarity index 100% rename from test/lib/test_random.cpp rename to tests/test/lib/test_random.cpp diff --git a/test/lib/test_sgd.cpp b/tests/test/lib/test_sgd.cpp similarity index 100% rename from test/lib/test_sgd.cpp rename to tests/test/lib/test_sgd.cpp diff --git a/test/lib/test_state.cpp b/tests/test/lib/test_state.cpp similarity index 100% rename from test/lib/test_state.cpp rename to tests/test/lib/test_state.cpp diff --git a/test/lib/test_time.cpp b/tests/test/lib/test_time.cpp similarity index 100% rename from test/lib/test_time.cpp rename to tests/test/lib/test_time.cpp diff --git a/test/main.cpp b/tests/test/main.cpp similarity index 100% rename from test/main.cpp rename to tests/test/main.cpp diff --git a/test/module_cache/test_module_cache.cpp b/tests/test/module_cache/test_module_cache.cpp similarity index 100% rename from test/module_cache/test_module_cache.cpp rename to tests/test/module_cache/test_module_cache.cpp diff --git a/test/mpi/test_mpi_context.cpp b/tests/test/mpi/test_mpi_context.cpp similarity index 100% rename from test/mpi/test_mpi_context.cpp rename to tests/test/mpi/test_mpi_context.cpp diff --git a/test/mpi/test_mpi_world.cpp b/tests/test/mpi/test_mpi_world.cpp similarity index 100% rename from test/mpi/test_mpi_world.cpp rename to tests/test/mpi/test_mpi_world.cpp diff --git a/test/proto/test_proto.cpp b/tests/test/proto/test_proto.cpp similarity index 100% rename from test/proto/test_proto.cpp rename to tests/test/proto/test_proto.cpp diff --git a/test/redis/test_redis.cpp b/tests/test/redis/test_redis.cpp similarity index 100% rename from test/redis/test_redis.cpp rename to tests/test/redis/test_redis.cpp diff --git a/test/scheduler/test_redis_global_bus.cpp b/tests/test/scheduler/test_redis_global_bus.cpp similarity index 100% rename from test/scheduler/test_redis_global_bus.cpp rename to tests/test/scheduler/test_redis_global_bus.cpp diff --git a/test/scheduler/test_scheduler.cpp b/tests/test/scheduler/test_scheduler.cpp similarity index 100% rename from test/scheduler/test_scheduler.cpp rename to tests/test/scheduler/test_scheduler.cpp diff --git a/test/scheduler/test_sharing_bus.cpp b/tests/test/scheduler/test_sharing_bus.cpp similarity index 100% rename from test/scheduler/test_sharing_bus.cpp rename to tests/test/scheduler/test_sharing_bus.cpp diff --git a/test/state/test_state.cpp b/tests/test/state/test_state.cpp similarity index 100% rename from test/state/test_state.cpp rename to tests/test/state/test_state.cpp diff --git a/test/storage/test_local_file_loader.cpp b/tests/test/storage/test_local_file_loader.cpp similarity index 100% rename from test/storage/test_local_file_loader.cpp rename to tests/test/storage/test_local_file_loader.cpp diff --git a/test/storage/test_shared_files_manager.cpp b/tests/test/storage/test_shared_files_manager.cpp similarity index 100% rename from test/storage/test_shared_files_manager.cpp rename to tests/test/storage/test_shared_files_manager.cpp diff --git a/test/system/test_cgroup.cpp b/tests/test/system/test_cgroup.cpp similarity index 100% rename from test/system/test_cgroup.cpp rename to tests/test/system/test_cgroup.cpp diff --git a/test/system/test_network.cpp b/tests/test/system/test_network.cpp similarity index 100% rename from test/system/test_network.cpp rename to tests/test/system/test_network.cpp diff --git a/test/upload/dummy.py b/tests/test/upload/dummy.py similarity index 100% rename from test/upload/dummy.py rename to tests/test/upload/dummy.py diff --git a/test/upload/dummy.wasm b/tests/test/upload/dummy.wasm similarity index 100% rename from test/upload/dummy.wasm rename to tests/test/upload/dummy.wasm diff --git a/test/upload/dummy_file.txt b/tests/test/upload/dummy_file.txt similarity index 100% rename from test/upload/dummy_file.txt rename to tests/test/upload/dummy_file.txt diff --git a/test/upload/test_upload.cpp b/tests/test/upload/test_upload.cpp similarity index 98% rename from test/upload/test_upload.cpp rename to tests/test/upload/test_upload.cpp index 3ce85db44..ec2d9e372 100644 --- a/test/upload/test_upload.cpp +++ b/tests/test/upload/test_upload.cpp @@ -132,7 +132,7 @@ namespace tests { // Load some valid dummy wasm bytes // TODO - hard-coded file path is a bad idea - std::vector wasmBytes = util::readFileToBytes("/usr/local/code/faasm/test/upload/dummy.wasm"); + std::vector wasmBytes = util::readFileToBytes("/usr/local/code/faasm/tests/test/upload/dummy.wasm"); // Check putting the file std::string url = "/f/gamma/delta"; @@ -154,7 +154,7 @@ namespace tests { } SECTION("Test uploading shared file") { - const char *realPath = "/usr/local/code/faasm/test/upload/dummy_file.txt"; + const char *realPath = "/usr/local/code/faasm/tests/test/upload/dummy_file.txt"; std::vector fileBytes = util::readFileToBytes(realPath); // Clear out any existing diff --git a/test/util/test_barrier.cpp b/tests/test/util/test_barrier.cpp similarity index 100% rename from test/util/test_barrier.cpp rename to tests/test/util/test_barrier.cpp diff --git a/test/util/test_base64.cpp b/tests/test/util/test_base64.cpp similarity index 100% rename from test/util/test_base64.cpp rename to tests/test/util/test_base64.cpp diff --git a/test/util/test_bytes.cpp b/tests/test/util/test_bytes.cpp similarity index 100% rename from test/util/test_bytes.cpp rename to tests/test/util/test_bytes.cpp diff --git a/test/util/test_config.cpp b/tests/test/util/test_config.cpp similarity index 100% rename from test/util/test_config.cpp rename to tests/test/util/test_config.cpp diff --git a/test/util/test_environment.cpp b/tests/test/util/test_environment.cpp similarity index 100% rename from test/util/test_environment.cpp rename to tests/test/util/test_environment.cpp diff --git a/test/util/test_files.cpp b/tests/test/util/test_files.cpp similarity index 100% rename from test/util/test_files.cpp rename to tests/test/util/test_files.cpp diff --git a/test/util/test_func.cpp b/tests/test/util/test_func.cpp similarity index 100% rename from test/util/test_func.cpp rename to tests/test/util/test_func.cpp diff --git a/test/util/test_gids.cpp b/tests/test/util/test_gids.cpp similarity index 100% rename from test/util/test_gids.cpp rename to tests/test/util/test_gids.cpp diff --git a/test/util/test_hash.cpp b/tests/test/util/test_hash.cpp similarity index 100% rename from test/util/test_hash.cpp rename to tests/test/util/test_hash.cpp diff --git a/test/util/test_json.cpp b/tests/test/util/test_json.cpp similarity index 100% rename from test/util/test_json.cpp rename to tests/test/util/test_json.cpp diff --git a/test/util/test_memory.cpp b/tests/test/util/test_memory.cpp similarity index 100% rename from test/util/test_memory.cpp rename to tests/test/util/test_memory.cpp diff --git a/test/util/test_queue.cpp b/tests/test/util/test_queue.cpp similarity index 100% rename from test/util/test_queue.cpp rename to tests/test/util/test_queue.cpp diff --git a/test/util/test_random.cpp b/tests/test/util/test_random.cpp similarity index 100% rename from test/util/test_random.cpp rename to tests/test/util/test_random.cpp diff --git a/test/util/test_state.cpp b/tests/test/util/test_state.cpp similarity index 100% rename from test/util/test_state.cpp rename to tests/test/util/test_state.cpp diff --git a/test/util/test_strings.cpp b/tests/test/util/test_strings.cpp similarity index 100% rename from test/util/test_strings.cpp rename to tests/test/util/test_strings.cpp diff --git a/test/util/test_tokens.cpp b/tests/test/util/test_tokens.cpp similarity index 100% rename from test/util/test_tokens.cpp rename to tests/test/util/test_tokens.cpp diff --git a/test/wasm/test_cloning.cpp b/tests/test/wasm/test_cloning.cpp similarity index 100% rename from test/wasm/test_cloning.cpp rename to tests/test/wasm/test_cloning.cpp diff --git a/test/wasm/test_dynamic_modules.cpp b/tests/test/wasm/test_dynamic_modules.cpp similarity index 99% rename from test/wasm/test_dynamic_modules.cpp rename to tests/test/wasm/test_dynamic_modules.cpp index 9c121ec78..f22a36ea5 100644 --- a/test/wasm/test_dynamic_modules.cpp +++ b/tests/test/wasm/test_dynamic_modules.cpp @@ -43,7 +43,7 @@ namespace tests { std::string mainData = "PyBool_Type"; std::string dataA = "PyArray_API"; std::string dataB = "PyUFunc_API"; - int mainDataOffset = 6438704; + int mainDataOffset = 6354224; int dataAOffset = 42049184; int dataBOffset = 73334784; diff --git a/test/wasm/test_func_ptr.cpp b/tests/test/wasm/test_func_ptr.cpp similarity index 100% rename from test/wasm/test_func_ptr.cpp rename to tests/test/wasm/test_func_ptr.cpp diff --git a/test/wasm/test_function_loader.cpp b/tests/test/wasm/test_function_loader.cpp similarity index 100% rename from test/wasm/test_function_loader.cpp rename to tests/test/wasm/test_function_loader.cpp diff --git a/test/wasm/test_memory.cpp b/tests/test/wasm/test_memory.cpp similarity index 100% rename from test/wasm/test_memory.cpp rename to tests/test/wasm/test_memory.cpp diff --git a/test/wasm/test_openmp.cpp b/tests/test/wasm/test_openmp.cpp similarity index 100% rename from test/wasm/test_openmp.cpp rename to tests/test/wasm/test_openmp.cpp diff --git a/test/wasm/test_serialization.cpp b/tests/test/wasm/test_serialization.cpp similarity index 100% rename from test/wasm/test_serialization.cpp rename to tests/test/wasm/test_serialization.cpp diff --git a/test/wasm/test_tflite.cpp b/tests/test/wasm/test_tflite.cpp similarity index 100% rename from test/wasm/test_tflite.cpp rename to tests/test/wasm/test_tflite.cpp diff --git a/test/wasm/test_typescript.cpp b/tests/test/wasm/test_typescript.cpp similarity index 100% rename from test/wasm/test_typescript.cpp rename to tests/test/wasm/test_typescript.cpp diff --git a/test/wasm/test_wasm.cpp b/tests/test/wasm/test_wasm.cpp similarity index 100% rename from test/wasm/test_wasm.cpp rename to tests/test/wasm/test_wasm.cpp diff --git a/test/wasm/test_wasm_state.cpp b/tests/test/wasm/test_wasm_state.cpp similarity index 100% rename from test/wasm/test_wasm_state.cpp rename to tests/test/wasm/test_wasm_state.cpp diff --git a/test/worker/test_dynamic_linking.cpp b/tests/test/worker/test_dynamic_linking.cpp similarity index 100% rename from test/worker/test_dynamic_linking.cpp rename to tests/test/worker/test_dynamic_linking.cpp diff --git a/test/worker/test_env.cpp b/tests/test/worker/test_env.cpp similarity index 100% rename from test/worker/test_env.cpp rename to tests/test/worker/test_env.cpp diff --git a/test/worker/test_errors.cpp b/tests/test/worker/test_errors.cpp similarity index 100% rename from test/worker/test_errors.cpp rename to tests/test/worker/test_errors.cpp diff --git a/test/worker/test_filesystem.cpp b/tests/test/worker/test_filesystem.cpp similarity index 100% rename from test/worker/test_filesystem.cpp rename to tests/test/worker/test_filesystem.cpp diff --git a/test/worker/test_flushing.cpp b/tests/test/worker/test_flushing.cpp similarity index 100% rename from test/worker/test_flushing.cpp rename to tests/test/worker/test_flushing.cpp diff --git a/test/worker/test_io.cpp b/tests/test/worker/test_io.cpp similarity index 100% rename from test/worker/test_io.cpp rename to tests/test/worker/test_io.cpp diff --git a/test/worker/test_lang.cpp b/tests/test/worker/test_lang.cpp similarity index 100% rename from test/worker/test_lang.cpp rename to tests/test/worker/test_lang.cpp diff --git a/test/worker/test_memory.cpp b/tests/test/worker/test_memory.cpp similarity index 100% rename from test/worker/test_memory.cpp rename to tests/test/worker/test_memory.cpp diff --git a/test/worker/test_mpi.cpp b/tests/test/worker/test_mpi.cpp similarity index 100% rename from test/worker/test_mpi.cpp rename to tests/test/worker/test_mpi.cpp diff --git a/test/worker/test_pool.cpp b/tests/test/worker/test_pool.cpp similarity index 100% rename from test/worker/test_pool.cpp rename to tests/test/worker/test_pool.cpp diff --git a/test/worker/test_python.cpp b/tests/test/worker/test_python.cpp similarity index 100% rename from test/worker/test_python.cpp rename to tests/test/worker/test_python.cpp diff --git a/tests/test/worker/test_rust.cpp b/tests/test/worker/test_rust.cpp new file mode 100644 index 000000000..32a0b2a4c --- /dev/null +++ b/tests/test/worker/test_rust.cpp @@ -0,0 +1,14 @@ +#include + +#include +#include +#include + +namespace tests { + TEST_CASE("Test rust function works", "[worker]") { + cleanSystem(); + + message::Message call = util::messageFactory("rust", "hello"); + execFunction(call); + } +} \ No newline at end of file diff --git a/test/worker/test_shared_files.cpp b/tests/test/worker/test_shared_files.cpp similarity index 100% rename from test/worker/test_shared_files.cpp rename to tests/test/worker/test_shared_files.cpp diff --git a/test/worker/test_threads.cpp b/tests/test/worker/test_threads.cpp similarity index 100% rename from test/worker/test_threads.cpp rename to tests/test/worker/test_threads.cpp diff --git a/test/worker/test_time.cpp b/tests/test/worker/test_time.cpp similarity index 100% rename from test/worker/test_time.cpp rename to tests/test/worker/test_time.cpp diff --git a/test/worker/test_vectorization.cpp b/tests/test/worker/test_vectorization.cpp similarity index 100% rename from test/worker/test_vectorization.cpp rename to tests/test/worker/test_vectorization.cpp diff --git a/test/worker/test_zygote.cpp b/tests/test/worker/test_zygote.cpp similarity index 100% rename from test/worker/test_zygote.cpp rename to tests/test/worker/test_zygote.cpp diff --git a/test_utils/CMakeLists.txt b/tests/utils/CMakeLists.txt similarity index 96% rename from test_utils/CMakeLists.txt rename to tests/utils/CMakeLists.txt index ee4befb9f..acb5c25fe 100644 --- a/test_utils/CMakeLists.txt +++ b/tests/utils/CMakeLists.txt @@ -13,7 +13,6 @@ faasm_private_lib(test_utils "${LIB_FILES}") target_link_libraries(test_utils catch faasm - edge_lib upload_lib worker_lib emulator diff --git a/test_utils/matrix_utils.cpp b/tests/utils/matrix_utils.cpp similarity index 100% rename from test_utils/matrix_utils.cpp rename to tests/utils/matrix_utils.cpp diff --git a/test_utils/message_utils.cpp b/tests/utils/message_utils.cpp similarity index 100% rename from test_utils/message_utils.cpp rename to tests/utils/message_utils.cpp diff --git a/test_utils/system_utils.cpp b/tests/utils/system_utils.cpp similarity index 100% rename from test_utils/system_utils.cpp rename to tests/utils/system_utils.cpp diff --git a/test_utils/utils.h b/tests/utils/utils.h similarity index 100% rename from test_utils/utils.h rename to tests/utils/utils.h diff --git a/test_utils/worker_utils.cpp b/tests/utils/worker_utils.cpp similarity index 100% rename from test_utils/worker_utils.cpp rename to tests/utils/worker_utils.cpp diff --git a/third-party/ParResKernels b/third-party/ParResKernels index 1b8c33714..0a32eb097 160000 --- a/third-party/ParResKernels +++ b/third-party/ParResKernels @@ -1 +1 @@ -Subproject commit 1b8c337142fc59c934fd0f87cb76cba4e4cc5369 +Subproject commit 0a32eb097bf6cd46277fa37f8d9f55214965d4cc diff --git a/third-party/llvm-project b/third-party/llvm-project index c1a0a2133..d32170dbd 160000 --- a/third-party/llvm-project +++ b/third-party/llvm-project @@ -1 +1 @@ -Subproject commit c1a0a213378a458fbea1a5c77b315c7dce08fd05 +Subproject commit d32170dbd5b0d54436537b6b75beaf44324e0c28 diff --git a/toolchain/Makefile b/toolchain/Makefile index e31d80a62..f751e819f 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -9,7 +9,8 @@ FAASM_LOCAL_DIR=/usr/local/faasm PREFIX=$(FAASM_LOCAL_DIR)/toolchain FAASM_SYSROOT=/usr/local/faasm/llvm-sysroot -CLANG_VERSION=9.0.1 +# NOTE - upgrading LLVM itself is done by updating the submodule in this project +CLANG_VERSION=10.0.0 BUILD_DIR=$(LLVM_PROJ_DIR)/build LLVM_CONFIG=$(BUILD_DIR)/llvm/bin/llvm-config diff --git a/wasm/.gitignore b/wasm/.gitignore index 3da0e99d9..19aa748c0 100644 --- a/wasm/.gitignore +++ b/wasm/.gitignore @@ -12,6 +12,7 @@ bench.csv !omp/**/function.wasm !prk/**/function.wasm !python/**/function.wasm +!rust/**/function.wasm !sgd/**/function.wasm !tf/**/function.wasm !ts/**/function.wasm diff --git a/wasm/demo/abort/function.wasm b/wasm/demo/abort/function.wasm old mode 100644 new mode 100755 index 3bc670dc3..73eeed6ae Binary files a/wasm/demo/abort/function.wasm and b/wasm/demo/abort/function.wasm differ diff --git a/wasm/demo/argc_argv/function.wasm b/wasm/demo/argc_argv/function.wasm old mode 100644 new mode 100755 index 848489bcf..3473d56a0 Binary files a/wasm/demo/argc_argv/function.wasm and b/wasm/demo/argc_argv/function.wasm differ diff --git a/wasm/demo/argc_argv_test/function.wasm b/wasm/demo/argc_argv_test/function.wasm old mode 100644 new mode 100755 index 8e0ee8940..bb5a25116 Binary files a/wasm/demo/argc_argv_test/function.wasm and b/wasm/demo/argc_argv_test/function.wasm differ diff --git a/wasm/demo/brk/function.wasm b/wasm/demo/brk/function.wasm old mode 100644 new mode 100755 index b540b1a2a..302a587f8 Binary files a/wasm/demo/brk/function.wasm and b/wasm/demo/brk/function.wasm differ diff --git a/wasm/demo/calloc/function.wasm b/wasm/demo/calloc/function.wasm old mode 100644 new mode 100755 index 0f855a7cf..8e529ccc4 Binary files a/wasm/demo/calloc/function.wasm and b/wasm/demo/calloc/function.wasm differ diff --git a/wasm/demo/chain/function.wasm b/wasm/demo/chain/function.wasm old mode 100644 new mode 100755 index 55a3f1a7b..f791b4ec6 Binary files a/wasm/demo/chain/function.wasm and b/wasm/demo/chain/function.wasm differ diff --git a/wasm/demo/chain_named_a/function.wasm b/wasm/demo/chain_named_a/function.wasm old mode 100644 new mode 100755 index 3fe279fe4..3c7aa13ca Binary files a/wasm/demo/chain_named_a/function.wasm and b/wasm/demo/chain_named_a/function.wasm differ diff --git a/wasm/demo/chain_named_b/function.wasm b/wasm/demo/chain_named_b/function.wasm old mode 100644 new mode 100755 index fd2048306..b287e25af Binary files a/wasm/demo/chain_named_b/function.wasm and b/wasm/demo/chain_named_b/function.wasm differ diff --git a/wasm/demo/chain_named_c/function.wasm b/wasm/demo/chain_named_c/function.wasm old mode 100644 new mode 100755 index 422a8c8c8..838d9def6 Binary files a/wasm/demo/chain_named_c/function.wasm and b/wasm/demo/chain_named_c/function.wasm differ diff --git a/wasm/demo/chain_simple/function.wasm b/wasm/demo/chain_simple/function.wasm old mode 100644 new mode 100755 index 745b93e48..fcd30e985 Binary files a/wasm/demo/chain_simple/function.wasm and b/wasm/demo/chain_simple/function.wasm differ diff --git a/wasm/demo/check_input/function.wasm b/wasm/demo/check_input/function.wasm old mode 100644 new mode 100755 index bb2bf2917..f16f5317c Binary files a/wasm/demo/check_input/function.wasm and b/wasm/demo/check_input/function.wasm differ diff --git a/wasm/demo/conf_flags/function.wasm b/wasm/demo/conf_flags/function.wasm old mode 100644 new mode 100755 index d7f906ca2..ee1cbfa87 Binary files a/wasm/demo/conf_flags/function.wasm and b/wasm/demo/conf_flags/function.wasm differ diff --git a/wasm/demo/cpp_example/function.wasm b/wasm/demo/cpp_example/function.wasm old mode 100644 new mode 100755 index 9712f6a18..757607f72 Binary files a/wasm/demo/cpp_example/function.wasm and b/wasm/demo/cpp_example/function.wasm differ diff --git a/wasm/demo/dummy/function.wasm b/wasm/demo/dummy/function.wasm old mode 100644 new mode 100755 index 0fa100784..d9a2427f8 Binary files a/wasm/demo/dummy/function.wasm and b/wasm/demo/dummy/function.wasm differ diff --git a/wasm/demo/echo/function.wasm b/wasm/demo/echo/function.wasm index b4dcb6dbf..1aa47f9bb 100755 Binary files a/wasm/demo/echo/function.wasm and b/wasm/demo/echo/function.wasm differ diff --git a/wasm/demo/eigen_vec/function.wasm b/wasm/demo/eigen_vec/function.wasm old mode 100644 new mode 100755 index ab7079eec..6bf2451cf Binary files a/wasm/demo/eigen_vec/function.wasm and b/wasm/demo/eigen_vec/function.wasm differ diff --git a/wasm/demo/errno/function.wasm b/wasm/demo/errno/function.wasm old mode 100644 new mode 100755 index 46d0baa09..477eac7cb Binary files a/wasm/demo/errno/function.wasm and b/wasm/demo/errno/function.wasm differ diff --git a/wasm/demo/exit/function.wasm b/wasm/demo/exit/function.wasm old mode 100644 new mode 100755 index 103f1ea28..33d137e5e Binary files a/wasm/demo/exit/function.wasm and b/wasm/demo/exit/function.wasm differ diff --git a/wasm/demo/fcntl/function.wasm b/wasm/demo/fcntl/function.wasm old mode 100644 new mode 100755 index 73a9ff353..39075ed1a Binary files a/wasm/demo/fcntl/function.wasm and b/wasm/demo/fcntl/function.wasm differ diff --git a/wasm/demo/fibonacci/function.wasm b/wasm/demo/fibonacci/function.wasm old mode 100644 new mode 100755 index 2fe80fa75..8241d48f8 Binary files a/wasm/demo/fibonacci/function.wasm and b/wasm/demo/fibonacci/function.wasm differ diff --git a/wasm/demo/fprintf/function.wasm b/wasm/demo/fprintf/function.wasm old mode 100644 new mode 100755 index bf0cdc338..86a3db95f Binary files a/wasm/demo/fprintf/function.wasm and b/wasm/demo/fprintf/function.wasm differ diff --git a/wasm/demo/fread/function.wasm b/wasm/demo/fread/function.wasm old mode 100644 new mode 100755 index 39820be96..0e96cf7e1 Binary files a/wasm/demo/fread/function.wasm and b/wasm/demo/fread/function.wasm differ diff --git a/wasm/demo/fstat/function.wasm b/wasm/demo/fstat/function.wasm old mode 100644 new mode 100755 index ab1d2bd69..86b2466cf Binary files a/wasm/demo/fstat/function.wasm and b/wasm/demo/fstat/function.wasm differ diff --git a/wasm/demo/getdents/function.wasm b/wasm/demo/getdents/function.wasm old mode 100644 new mode 100755 index d6ab7a044..ea00d8a0f Binary files a/wasm/demo/getdents/function.wasm and b/wasm/demo/getdents/function.wasm differ diff --git a/wasm/demo/getenv/function.wasm b/wasm/demo/getenv/function.wasm old mode 100644 new mode 100755 index 5980fad9c..ad6a7132d Binary files a/wasm/demo/getenv/function.wasm and b/wasm/demo/getenv/function.wasm differ diff --git a/wasm/demo/getpwuid/function.wasm b/wasm/demo/getpwuid/function.wasm old mode 100644 new mode 100755 index d0ae745ea..8842d68cd Binary files a/wasm/demo/getpwuid/function.wasm and b/wasm/demo/getpwuid/function.wasm differ diff --git a/wasm/demo/gettime/function.wasm b/wasm/demo/gettime/function.wasm old mode 100644 new mode 100755 index c74176918..b8320c0a4 Binary files a/wasm/demo/gettime/function.wasm and b/wasm/demo/gettime/function.wasm differ diff --git a/wasm/demo/heap/function.wasm b/wasm/demo/heap/function.wasm old mode 100644 new mode 100755 index 07a20d580..792a7e4e9 Binary files a/wasm/demo/heap/function.wasm and b/wasm/demo/heap/function.wasm differ diff --git a/wasm/demo/hello/function.wasm b/wasm/demo/hello/function.wasm index 7f84edcd0..3dd315d3e 100755 Binary files a/wasm/demo/hello/function.wasm and b/wasm/demo/hello/function.wasm differ diff --git a/wasm/demo/ibm_test/function.wasm b/wasm/demo/ibm_test/function.wasm old mode 100644 new mode 100755 index 161a0bb52..014ce7098 Binary files a/wasm/demo/ibm_test/function.wasm and b/wasm/demo/ibm_test/function.wasm differ diff --git a/wasm/demo/increment/function.wasm b/wasm/demo/increment/function.wasm old mode 100644 new mode 100755 index 5972a9433..7a8611e0a Binary files a/wasm/demo/increment/function.wasm and b/wasm/demo/increment/function.wasm differ diff --git a/wasm/demo/isatty/function.wasm b/wasm/demo/isatty/function.wasm index 4991c2959..5cde1a179 100755 Binary files a/wasm/demo/isatty/function.wasm and b/wasm/demo/isatty/function.wasm differ diff --git a/wasm/demo/listdir/function.wasm b/wasm/demo/listdir/function.wasm old mode 100644 new mode 100755 index b61793a8a..8a6eefe08 Binary files a/wasm/demo/listdir/function.wasm and b/wasm/demo/listdir/function.wasm differ diff --git a/wasm/demo/lock/function.wasm b/wasm/demo/lock/function.wasm old mode 100644 new mode 100755 index 01ef4ff0a..3da00f3e0 Binary files a/wasm/demo/lock/function.wasm and b/wasm/demo/lock/function.wasm differ diff --git a/wasm/demo/malloc/function.wasm b/wasm/demo/malloc/function.wasm old mode 100644 new mode 100755 index 461dc0d54..1959b5272 Binary files a/wasm/demo/malloc/function.wasm and b/wasm/demo/malloc/function.wasm differ diff --git a/wasm/demo/matrix/function.wasm b/wasm/demo/matrix/function.wasm old mode 100644 new mode 100755 index 999f3599e..23302baae Binary files a/wasm/demo/matrix/function.wasm and b/wasm/demo/matrix/function.wasm differ diff --git a/wasm/demo/memcpy/function.wasm b/wasm/demo/memcpy/function.wasm old mode 100644 new mode 100755 index 124c91615..22a36cf75 Binary files a/wasm/demo/memcpy/function.wasm and b/wasm/demo/memcpy/function.wasm differ diff --git a/wasm/demo/memmove/function.wasm b/wasm/demo/memmove/function.wasm old mode 100644 new mode 100755 index b3dfceaf9..01e6915c9 Binary files a/wasm/demo/memmove/function.wasm and b/wasm/demo/memmove/function.wasm differ diff --git a/wasm/demo/mmap/function.wasm b/wasm/demo/mmap/function.wasm old mode 100644 new mode 100755 index 3b46397c4..680a28ca2 Binary files a/wasm/demo/mmap/function.wasm and b/wasm/demo/mmap/function.wasm differ diff --git a/wasm/demo/mmap_big/function.wasm b/wasm/demo/mmap_big/function.wasm old mode 100644 new mode 100755 index eec808c23..3e842ee97 Binary files a/wasm/demo/mmap_big/function.wasm and b/wasm/demo/mmap_big/function.wasm differ diff --git a/wasm/demo/mmap_file/function.wasm b/wasm/demo/mmap_file/function.wasm old mode 100644 new mode 100755 index 9130c5de2..722c1b995 Binary files a/wasm/demo/mmap_file/function.wasm and b/wasm/demo/mmap_file/function.wasm differ diff --git a/wasm/demo/net/function.wasm b/wasm/demo/net/function.wasm old mode 100644 new mode 100755 index c0dfb20c6..9b3169b8c Binary files a/wasm/demo/net/function.wasm and b/wasm/demo/net/function.wasm differ diff --git a/wasm/demo/new_obj/function.wasm b/wasm/demo/new_obj/function.wasm old mode 100644 new mode 100755 index 0a71d22ef..33035ff99 Binary files a/wasm/demo/new_obj/function.wasm and b/wasm/demo/new_obj/function.wasm differ diff --git a/wasm/demo/noop/function.wasm b/wasm/demo/noop/function.wasm old mode 100644 new mode 100755 index c33c5f9ec..f21e35a45 Binary files a/wasm/demo/noop/function.wasm and b/wasm/demo/noop/function.wasm differ diff --git a/wasm/demo/optarg/function.wasm b/wasm/demo/optarg/function.wasm old mode 100644 new mode 100755 index 2912aefb6..a7cd879ce Binary files a/wasm/demo/optarg/function.wasm and b/wasm/demo/optarg/function.wasm differ diff --git a/wasm/demo/pi/function.wasm b/wasm/demo/pi/function.wasm old mode 100644 new mode 100755 index d65987e1d..c42f33164 Binary files a/wasm/demo/pi/function.wasm and b/wasm/demo/pi/function.wasm differ diff --git a/wasm/demo/print/function.wasm b/wasm/demo/print/function.wasm old mode 100644 new mode 100755 index 8fe221614..e35294d6d Binary files a/wasm/demo/print/function.wasm and b/wasm/demo/print/function.wasm differ diff --git a/wasm/demo/ptr_ptr/function.wasm b/wasm/demo/ptr_ptr/function.wasm old mode 100644 new mode 100755 index 97631f993..44c3b6e95 Binary files a/wasm/demo/ptr_ptr/function.wasm and b/wasm/demo/ptr_ptr/function.wasm differ diff --git a/wasm/demo/random/function.wasm b/wasm/demo/random/function.wasm old mode 100644 new mode 100755 index e52f64feb..ebcd7cdc2 Binary files a/wasm/demo/random/function.wasm and b/wasm/demo/random/function.wasm differ diff --git a/wasm/demo/shared_file/function.wasm b/wasm/demo/shared_file/function.wasm old mode 100644 new mode 100755 index fb3c7d25e..46a9458ae Binary files a/wasm/demo/shared_file/function.wasm and b/wasm/demo/shared_file/function.wasm differ diff --git a/wasm/demo/simd/function.wasm b/wasm/demo/simd/function.wasm old mode 100644 new mode 100755 index 27c5d5465..2f45e3f84 Binary files a/wasm/demo/simd/function.wasm and b/wasm/demo/simd/function.wasm differ diff --git a/wasm/demo/simple/function.wasm b/wasm/demo/simple/function.wasm old mode 100644 new mode 100755 index c32e6618f..3cf08210a Binary files a/wasm/demo/simple/function.wasm and b/wasm/demo/simple/function.wasm differ diff --git a/wasm/demo/sizes/function.wasm b/wasm/demo/sizes/function.wasm old mode 100644 new mode 100755 index 6f553484c..b3fa3ff9b Binary files a/wasm/demo/sizes/function.wasm and b/wasm/demo/sizes/function.wasm differ diff --git a/wasm/demo/sleep_long/function.wasm b/wasm/demo/sleep_long/function.wasm old mode 100644 new mode 100755 index 0e42a39b2..b557659b8 Binary files a/wasm/demo/sleep_long/function.wasm and b/wasm/demo/sleep_long/function.wasm differ diff --git a/wasm/demo/sleep_short/function.wasm b/wasm/demo/sleep_short/function.wasm old mode 100644 new mode 100755 index 9640075e2..45f77027e Binary files a/wasm/demo/sleep_short/function.wasm and b/wasm/demo/sleep_short/function.wasm differ diff --git a/wasm/demo/stackheap/function.wasm b/wasm/demo/stackheap/function.wasm old mode 100644 new mode 100755 index ebe05e280..1badcec5a Binary files a/wasm/demo/stackheap/function.wasm and b/wasm/demo/stackheap/function.wasm differ diff --git a/wasm/demo/stat/function.wasm b/wasm/demo/stat/function.wasm old mode 100644 new mode 100755 index c8565ab44..6063825f3 Binary files a/wasm/demo/stat/function.wasm and b/wasm/demo/stat/function.wasm differ diff --git a/wasm/demo/state_append/function.wasm b/wasm/demo/state_append/function.wasm old mode 100644 new mode 100755 index c94654c55..2fa34d5c5 Binary files a/wasm/demo/state_append/function.wasm and b/wasm/demo/state_append/function.wasm differ diff --git a/wasm/demo/state_async/function.wasm b/wasm/demo/state_async/function.wasm old mode 100644 new mode 100755 index b94943cf6..6d510cc2c Binary files a/wasm/demo/state_async/function.wasm and b/wasm/demo/state_async/function.wasm differ diff --git a/wasm/demo/state_file/function.wasm b/wasm/demo/state_file/function.wasm old mode 100644 new mode 100755 index 512748e7b..cb78318f0 Binary files a/wasm/demo/state_file/function.wasm and b/wasm/demo/state_file/function.wasm differ diff --git a/wasm/demo/state_offset/function.wasm b/wasm/demo/state_offset/function.wasm old mode 100644 new mode 100755 index 7edfc523a..f0fb09527 Binary files a/wasm/demo/state_offset/function.wasm and b/wasm/demo/state_offset/function.wasm differ diff --git a/wasm/demo/state_shared_read/function.wasm b/wasm/demo/state_shared_read/function.wasm old mode 100644 new mode 100755 index e9142ccaf..9db1ab978 Binary files a/wasm/demo/state_shared_read/function.wasm and b/wasm/demo/state_shared_read/function.wasm differ diff --git a/wasm/demo/state_shared_read_offset/function.wasm b/wasm/demo/state_shared_read_offset/function.wasm old mode 100644 new mode 100755 index 0c8479006..379013297 Binary files a/wasm/demo/state_shared_read_offset/function.wasm and b/wasm/demo/state_shared_read_offset/function.wasm differ diff --git a/wasm/demo/state_shared_write/function.wasm b/wasm/demo/state_shared_write/function.wasm old mode 100644 new mode 100755 index eb2b6f51e..6604ceee8 Binary files a/wasm/demo/state_shared_write/function.wasm and b/wasm/demo/state_shared_write/function.wasm differ diff --git a/wasm/demo/state_shared_write_offset/function.wasm b/wasm/demo/state_shared_write_offset/function.wasm old mode 100644 new mode 100755 index 256298f36..a3c9ec261 Binary files a/wasm/demo/state_shared_write_offset/function.wasm and b/wasm/demo/state_shared_write_offset/function.wasm differ diff --git a/wasm/demo/stateop/function.wasm b/wasm/demo/stateop/function.wasm old mode 100644 new mode 100755 index 33fc184d9..d122ea029 Binary files a/wasm/demo/stateop/function.wasm and b/wasm/demo/stateop/function.wasm differ diff --git a/wasm/demo/stderr/function.wasm b/wasm/demo/stderr/function.wasm old mode 100644 new mode 100755 index 8b03e76a5..01651a571 Binary files a/wasm/demo/stderr/function.wasm and b/wasm/demo/stderr/function.wasm differ diff --git a/wasm/demo/stdout/function.wasm b/wasm/demo/stdout/function.wasm index a64a4f67a..14c80a81a 100755 Binary files a/wasm/demo/stdout/function.wasm and b/wasm/demo/stdout/function.wasm differ diff --git a/wasm/demo/string/function.wasm b/wasm/demo/string/function.wasm old mode 100644 new mode 100755 index c20870eb6..59caedbc7 Binary files a/wasm/demo/string/function.wasm and b/wasm/demo/string/function.wasm differ diff --git a/wasm/demo/sysconf/function.wasm b/wasm/demo/sysconf/function.wasm old mode 100644 new mode 100755 index e42470796..9f9dd12ac Binary files a/wasm/demo/sysconf/function.wasm and b/wasm/demo/sysconf/function.wasm differ diff --git a/wasm/demo/threads_check/function.wasm b/wasm/demo/threads_check/function.wasm index 67a591c1f..7f8c97b17 100755 Binary files a/wasm/demo/threads_check/function.wasm and b/wasm/demo/threads_check/function.wasm differ diff --git a/wasm/demo/threads_dist/function.wasm b/wasm/demo/threads_dist/function.wasm index 5c32ce953..4c200e542 100755 Binary files a/wasm/demo/threads_dist/function.wasm and b/wasm/demo/threads_dist/function.wasm differ diff --git a/wasm/demo/threads_local/function.wasm b/wasm/demo/threads_local/function.wasm index 9ec032dee..cf228afaa 100755 Binary files a/wasm/demo/threads_local/function.wasm and b/wasm/demo/threads_local/function.wasm differ diff --git a/wasm/demo/time/function.wasm b/wasm/demo/time/function.wasm old mode 100644 new mode 100755 index 86c4b112e..fe49c1ad4 Binary files a/wasm/demo/time/function.wasm and b/wasm/demo/time/function.wasm differ diff --git a/wasm/demo/time_of_day/function.wasm b/wasm/demo/time_of_day/function.wasm old mode 100644 new mode 100755 index 89a8ea7f2..e4f536928 Binary files a/wasm/demo/time_of_day/function.wasm and b/wasm/demo/time_of_day/function.wasm differ diff --git a/wasm/demo/uname/function.wasm b/wasm/demo/uname/function.wasm old mode 100644 new mode 100755 index eb7e7cfc7..b5dee4b92 Binary files a/wasm/demo/uname/function.wasm and b/wasm/demo/uname/function.wasm differ diff --git a/wasm/demo/x2/function.wasm b/wasm/demo/x2/function.wasm old mode 100644 new mode 100755 index 617fb1294..7b9bb26c2 Binary files a/wasm/demo/x2/function.wasm and b/wasm/demo/x2/function.wasm differ diff --git a/wasm/demo/zygote_check/function.wasm b/wasm/demo/zygote_check/function.wasm old mode 100644 new mode 100755 index 89fde46d6..1954e539e Binary files a/wasm/demo/zygote_check/function.wasm and b/wasm/demo/zygote_check/function.wasm differ diff --git a/wasm/errors/bad_malloc/function.wasm b/wasm/errors/bad_malloc/function.wasm old mode 100644 new mode 100755 index 47a33ac45..2f7a96387 Binary files a/wasm/errors/bad_malloc/function.wasm and b/wasm/errors/bad_malloc/function.wasm differ diff --git a/wasm/errors/multi_poll/function.wasm b/wasm/errors/multi_poll/function.wasm old mode 100644 new mode 100755 index 44ff33752..754380a24 Binary files a/wasm/errors/multi_poll/function.wasm and b/wasm/errors/multi_poll/function.wasm differ diff --git a/wasm/errors/munmap/function.wasm b/wasm/errors/munmap/function.wasm old mode 100644 new mode 100755 index 3cd5e45a6..9a1b787a3 Binary files a/wasm/errors/munmap/function.wasm and b/wasm/errors/munmap/function.wasm differ diff --git a/wasm/errors/open_blocked/function.wasm b/wasm/errors/open_blocked/function.wasm old mode 100644 new mode 100755 index 18660d41b..47b438664 Binary files a/wasm/errors/open_blocked/function.wasm and b/wasm/errors/open_blocked/function.wasm differ diff --git a/wasm/errors/ret_one/function.wasm b/wasm/errors/ret_one/function.wasm index 6e979e898..459e205cd 100755 Binary files a/wasm/errors/ret_one/function.wasm and b/wasm/errors/ret_one/function.wasm differ diff --git a/wasm/errors/socket/function.wasm b/wasm/errors/socket/function.wasm old mode 100644 new mode 100755 index db594b986..5cbce3c7e Binary files a/wasm/errors/socket/function.wasm and b/wasm/errors/socket/function.wasm differ diff --git a/wasm/errors/stackoverflow/function.wasm b/wasm/errors/stackoverflow/function.wasm old mode 100644 new mode 100755 index dfcc012a9..e20bbaf5b Binary files a/wasm/errors/stackoverflow/function.wasm and b/wasm/errors/stackoverflow/function.wasm differ diff --git a/wasm/errors/stdin_poll/function.wasm b/wasm/errors/stdin_poll/function.wasm old mode 100644 new mode 100755 index 4f507c323..265f04938 Binary files a/wasm/errors/stdin_poll/function.wasm and b/wasm/errors/stdin_poll/function.wasm differ diff --git a/wasm/mpi/hellompi/function.wasm b/wasm/mpi/hellompi/function.wasm old mode 100644 new mode 100755 index 14f37c1d5..5ef47ca45 Binary files a/wasm/mpi/hellompi/function.wasm and b/wasm/mpi/hellompi/function.wasm differ diff --git a/wasm/mpi/mpi_allgather/function.wasm b/wasm/mpi/mpi_allgather/function.wasm old mode 100644 new mode 100755 index ef68ace95..448e4a5f5 Binary files a/wasm/mpi/mpi_allgather/function.wasm and b/wasm/mpi/mpi_allgather/function.wasm differ diff --git a/wasm/mpi/mpi_allreduce/function.wasm b/wasm/mpi/mpi_allreduce/function.wasm old mode 100644 new mode 100755 index 981d9de53..ccd2832cd Binary files a/wasm/mpi/mpi_allreduce/function.wasm and b/wasm/mpi/mpi_allreduce/function.wasm differ diff --git a/wasm/mpi/mpi_alltoall/function.wasm b/wasm/mpi/mpi_alltoall/function.wasm old mode 100644 new mode 100755 index b1fd64c24..5aeac829e Binary files a/wasm/mpi/mpi_alltoall/function.wasm and b/wasm/mpi/mpi_alltoall/function.wasm differ diff --git a/wasm/mpi/mpi_barrier/function.wasm b/wasm/mpi/mpi_barrier/function.wasm old mode 100644 new mode 100755 index 8ae96bf76..3be0a18a8 Binary files a/wasm/mpi/mpi_barrier/function.wasm and b/wasm/mpi/mpi_barrier/function.wasm differ diff --git a/wasm/mpi/mpi_bcast/function.wasm b/wasm/mpi/mpi_bcast/function.wasm old mode 100644 new mode 100755 index 8353357fa..5c27e5868 Binary files a/wasm/mpi/mpi_bcast/function.wasm and b/wasm/mpi/mpi_bcast/function.wasm differ diff --git a/wasm/mpi/mpi_checks/function.wasm b/wasm/mpi/mpi_checks/function.wasm old mode 100644 new mode 100755 index 2809cad81..1a0af21d7 Binary files a/wasm/mpi/mpi_checks/function.wasm and b/wasm/mpi/mpi_checks/function.wasm differ diff --git a/wasm/mpi/mpi_gather/function.wasm b/wasm/mpi/mpi_gather/function.wasm old mode 100644 new mode 100755 index f1186cb84..99ed89a73 Binary files a/wasm/mpi/mpi_gather/function.wasm and b/wasm/mpi/mpi_gather/function.wasm differ diff --git a/wasm/mpi/mpi_isendrecv/function.wasm b/wasm/mpi/mpi_isendrecv/function.wasm index a9248a78d..761dab077 100755 Binary files a/wasm/mpi/mpi_isendrecv/function.wasm and b/wasm/mpi/mpi_isendrecv/function.wasm differ diff --git a/wasm/mpi/mpi_onesided/function.wasm b/wasm/mpi/mpi_onesided/function.wasm old mode 100644 new mode 100755 index 909c56890..4f1b18562 Binary files a/wasm/mpi/mpi_onesided/function.wasm and b/wasm/mpi/mpi_onesided/function.wasm differ diff --git a/wasm/mpi/mpi_order/function.wasm b/wasm/mpi/mpi_order/function.wasm old mode 100644 new mode 100755 index bcc038412..a383830bd Binary files a/wasm/mpi/mpi_order/function.wasm and b/wasm/mpi/mpi_order/function.wasm differ diff --git a/wasm/mpi/mpi_probe/function.wasm b/wasm/mpi/mpi_probe/function.wasm old mode 100644 new mode 100755 index 5b74c78dd..d0e3ae6d4 Binary files a/wasm/mpi/mpi_probe/function.wasm and b/wasm/mpi/mpi_probe/function.wasm differ diff --git a/wasm/mpi/mpi_put/function.wasm b/wasm/mpi/mpi_put/function.wasm old mode 100644 new mode 100755 index aeac4f63d..880895f43 Binary files a/wasm/mpi/mpi_put/function.wasm and b/wasm/mpi/mpi_put/function.wasm differ diff --git a/wasm/mpi/mpi_reduce/function.wasm b/wasm/mpi/mpi_reduce/function.wasm index 13067939d..bc77d419a 100755 Binary files a/wasm/mpi/mpi_reduce/function.wasm and b/wasm/mpi/mpi_reduce/function.wasm differ diff --git a/wasm/mpi/mpi_reduce_dbl/function.wasm b/wasm/mpi/mpi_reduce_dbl/function.wasm old mode 100644 new mode 100755 index 9e7e8a39c..1ee557534 Binary files a/wasm/mpi/mpi_reduce_dbl/function.wasm and b/wasm/mpi/mpi_reduce_dbl/function.wasm differ diff --git a/wasm/mpi/mpi_scatter/function.wasm b/wasm/mpi/mpi_scatter/function.wasm old mode 100644 new mode 100755 index 0bb5f57e8..25abc0a28 Binary files a/wasm/mpi/mpi_scatter/function.wasm and b/wasm/mpi/mpi_scatter/function.wasm differ diff --git a/wasm/mpi/mpi_status/function.wasm b/wasm/mpi/mpi_status/function.wasm old mode 100644 new mode 100755 index 6ed2a6e67..2619d7d49 Binary files a/wasm/mpi/mpi_status/function.wasm and b/wasm/mpi/mpi_status/function.wasm differ diff --git a/wasm/mpi/mpi_typesize/function.wasm b/wasm/mpi/mpi_typesize/function.wasm old mode 100644 new mode 100755 index af0fbf5f2..c13642011 Binary files a/wasm/mpi/mpi_typesize/function.wasm and b/wasm/mpi/mpi_typesize/function.wasm differ diff --git a/wasm/mpi/mpi_wincreate/function.wasm b/wasm/mpi/mpi_wincreate/function.wasm old mode 100644 new mode 100755 index 43e7895ae..e3f8dce65 Binary files a/wasm/mpi/mpi_wincreate/function.wasm and b/wasm/mpi/mpi_wincreate/function.wasm differ diff --git a/wasm/omp/for_static_schedule/function.wasm b/wasm/omp/for_static_schedule/function.wasm index e91a64c05..166bff948 100755 Binary files a/wasm/omp/for_static_schedule/function.wasm and b/wasm/omp/for_static_schedule/function.wasm differ diff --git a/wasm/omp/header_api_support/function.wasm b/wasm/omp/header_api_support/function.wasm index b00ffd53e..bded532c6 100755 Binary files a/wasm/omp/header_api_support/function.wasm and b/wasm/omp/header_api_support/function.wasm differ diff --git a/wasm/omp/hellomp/function.wasm b/wasm/omp/hellomp/function.wasm old mode 100644 new mode 100755 index 49fe6af36..60baa37e8 Binary files a/wasm/omp/hellomp/function.wasm and b/wasm/omp/hellomp/function.wasm differ diff --git a/wasm/omp/nested_levels_test/function.wasm b/wasm/omp/nested_levels_test/function.wasm index 8179b77dd..c9c04e286 100755 Binary files a/wasm/omp/nested_levels_test/function.wasm and b/wasm/omp/nested_levels_test/function.wasm differ diff --git a/wasm/omp/omp_checks/function.wasm b/wasm/omp/omp_checks/function.wasm old mode 100644 new mode 100755 index 61b5340e0..870e9aadf Binary files a/wasm/omp/omp_checks/function.wasm and b/wasm/omp/omp_checks/function.wasm differ diff --git a/wasm/omp/setting_num_threads/function.wasm b/wasm/omp/setting_num_threads/function.wasm index ad341ab75..929ed5e3f 100755 Binary files a/wasm/omp/setting_num_threads/function.wasm and b/wasm/omp/setting_num_threads/function.wasm differ diff --git a/wasm/omp/simple_barrier/function.wasm b/wasm/omp/simple_barrier/function.wasm index df0c6411e..716982f51 100755 Binary files a/wasm/omp/simple_barrier/function.wasm and b/wasm/omp/simple_barrier/function.wasm differ diff --git a/wasm/omp/simple_flush/function.wasm b/wasm/omp/simple_flush/function.wasm index dce0224b1..5a7fd0688 100755 Binary files a/wasm/omp/simple_flush/function.wasm and b/wasm/omp/simple_flush/function.wasm differ diff --git a/wasm/omp/simple_for/function.wasm b/wasm/omp/simple_for/function.wasm index ca1eb2ead..96bdc97bb 100755 Binary files a/wasm/omp/simple_for/function.wasm and b/wasm/omp/simple_for/function.wasm differ diff --git a/wasm/omp/simple_master/function.wasm b/wasm/omp/simple_master/function.wasm index 083d7a891..d7d3a75db 100755 Binary files a/wasm/omp/simple_master/function.wasm and b/wasm/omp/simple_master/function.wasm differ diff --git a/wasm/omp/stack_debug/function.wasm b/wasm/omp/stack_debug/function.wasm old mode 100644 new mode 100755 index 434950768..095b8041e Binary files a/wasm/omp/stack_debug/function.wasm and b/wasm/omp/stack_debug/function.wasm differ diff --git a/wasm/omp/target_integral/function.wasm b/wasm/omp/target_integral/function.wasm new file mode 100755 index 000000000..6203527f1 Binary files /dev/null and b/wasm/omp/target_integral/function.wasm differ diff --git a/wasm/prk/dgemm/function.wasm b/wasm/prk/dgemm/function.wasm index 21cd5dd7d..4e46402af 100755 Binary files a/wasm/prk/dgemm/function.wasm and b/wasm/prk/dgemm/function.wasm differ diff --git a/wasm/prk/global/function.wasm b/wasm/prk/global/function.wasm index 24c686e68..ce7cb55c9 100755 Binary files a/wasm/prk/global/function.wasm and b/wasm/prk/global/function.wasm differ diff --git a/wasm/prk/nstream/function.wasm b/wasm/prk/nstream/function.wasm index a1b3b30ab..e122130c4 100755 Binary files a/wasm/prk/nstream/function.wasm and b/wasm/prk/nstream/function.wasm differ diff --git a/wasm/prk/p2p/function.wasm b/wasm/prk/p2p/function.wasm index 58aa5e694..d9a366a08 100755 Binary files a/wasm/prk/p2p/function.wasm and b/wasm/prk/p2p/function.wasm differ diff --git a/wasm/prk/random/function.wasm b/wasm/prk/random/function.wasm index c5788c82b..e1a3e1ce4 100755 Binary files a/wasm/prk/random/function.wasm and b/wasm/prk/random/function.wasm differ diff --git a/wasm/prk/reduce/function.wasm b/wasm/prk/reduce/function.wasm index dc0523326..1247bda34 100755 Binary files a/wasm/prk/reduce/function.wasm and b/wasm/prk/reduce/function.wasm differ diff --git a/wasm/prk/sparse/function.wasm b/wasm/prk/sparse/function.wasm index 39be14d29..5b316d8f7 100755 Binary files a/wasm/prk/sparse/function.wasm and b/wasm/prk/sparse/function.wasm differ diff --git a/wasm/prk/stencil/function.wasm b/wasm/prk/stencil/function.wasm index a7682989a..588c9d8de 100755 Binary files a/wasm/prk/stencil/function.wasm and b/wasm/prk/stencil/function.wasm differ diff --git a/wasm/prk/transpose/function.wasm b/wasm/prk/transpose/function.wasm index c4b85c370..ed7301ce8 100755 Binary files a/wasm/prk/transpose/function.wasm and b/wasm/prk/transpose/function.wasm differ diff --git a/wasm/python/py_func/function.wasm b/wasm/python/py_func/function.wasm index eb9db9686..283c93939 100755 Binary files a/wasm/python/py_func/function.wasm and b/wasm/python/py_func/function.wasm differ diff --git a/wasm/rust/hello/function.wasm b/wasm/rust/hello/function.wasm new file mode 100644 index 000000000..472a98f11 Binary files /dev/null and b/wasm/rust/hello/function.wasm differ diff --git a/wasm/tf/image/function.wasm b/wasm/tf/image/function.wasm index fe26e83fd..e54ab7ac1 100755 Binary files a/wasm/tf/image/function.wasm and b/wasm/tf/image/function.wasm differ