-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ExtremeVars
- Loading branch information
Showing
426 changed files
with
98,566 additions
and
1,170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
project(adios2-config-dummy C CXX) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# ADIOS2 Examples | ||
|
||
This directory contains examples of how to use ADIOS2 in different scenarios. | ||
The examples are written mostly in C++, but also C, Fortran, Python, and Julia. | ||
|
||
They can be found in the following subdirectories, and they should be explored in the order that they are listed: | ||
|
||
1. [hello](hello): The _hello_ examples are meant to introduce you to ADIOS2's IO capabilities and engines. | ||
2. [basics](basics): The _basics_ examples are meant to introduce you to basic concepts of ADIOS2, such as | ||
global/joined/local arrays, values, and variables shapes. | ||
3. [useCases](useCases): The _useCases_ examples are meant to demonstrate how to use ADIOS2 in different scenarios, | ||
such as in situ visualization, and fides schema. | ||
4. [plugins](plugins): The _plugins_ examples are meant to introduce you to the plugin capabilities of ADIOS2, such as | ||
how to develop your own engine or operators. | ||
5. [simulations](simulations): The _simulations_ examples are meant to demonstrate how to integrate ADIOS2 within your | ||
simulation code to read, write and/or stream your simulation data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## ADIOS2 basics examples | ||
|
||
The _basics_ examples are meant to introduce you to basic concepts of ADIOS2, such as | ||
global/joined/local arrays, values, and variables shapes. | ||
|
||
They can be found in the following subdirectories, and they should be explored in the order that they are listed: | ||
|
||
1. [globalArray1D](globalArray1D): The _globalArray1D_ example demonstrates how to read and write an | ||
1-D global array with constant dimensions over time from multiple processors using ADIOS2's BP engine. | ||
* Languages: C, Fortran | ||
2. [globalArrayND](globalArrayND): The _globalArrayND_ example demonstrates how to write an N-D global array with | ||
constant dimensions over time from multiple processors using ADIOS2's BP engine. | ||
* Languages: C++ | ||
3. [localArray](localArray): The _localArray_ example demonstrates how to write and read a local array per processor | ||
with the same name from multiple processors using ADIOS2's BP engine. | ||
* Languages: C++ | ||
4. [joinedArray](joinedArray): The _joinedArray_ example demonstrates how to write local array that is different only in | ||
one dimension so that it can be joined into a global array with the same name from multiple processors at read time | ||
using ADIOS2's ADIOS2's BP engine. | ||
* Languages: C++ | ||
5. [values](values): The _values_ example demonstrates how to write and read a multiple types of variables with a single | ||
value, such as global constant, global value, local constant, and local value using ADIOS2's BP engine. | ||
* Languages: C++, Fortran | ||
6. [variablesShapes](variablesShapes): The _variablesShapes_ example demonstrates how to write supported variables | ||
shapes using stepping and ADIOS2's BP engine. | ||
* Languages: C++, C++ using high-level API | ||
7. [queryWorker](queryWorker): The _queryWorker_ example demonstrates how to read variables using ADIOS2's BP engine | ||
and perform queries on the read data and streams the results. | ||
* Languages: C++ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#------------------------------------------------------------------------------# | ||
# Distributed under the OSI-approved Apache License, Version 2.0. See | ||
# accompanying file Copyright.txt for details. | ||
#------------------------------------------------------------------------------# | ||
|
||
cmake_minimum_required(VERSION 3.12) | ||
project(ADIOS2BasicsGlobalArray1DExample) | ||
|
||
if(NOT TARGET adios2_core) | ||
set(_components C) | ||
|
||
include(CheckLanguage) | ||
check_language(Fortran) | ||
if(CMAKE_Fortran_COMPILER) | ||
enable_language(Fortran) | ||
endif() | ||
if(CMAKE_Fortran_COMPILER_LOADED) | ||
list(APPEND _components Fortran) | ||
endif() | ||
|
||
find_package(MPI COMPONENTS ${_components}) | ||
if(MPI_FOUND) | ||
# Workaround for various MPI implementations forcing the link of C++ bindings | ||
add_definitions(-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX) | ||
|
||
list(APPEND _components MPI) | ||
endif() | ||
|
||
find_package(ADIOS2 REQUIRED COMPONENTS ${_components}) | ||
endif() | ||
|
||
if(ADIOS2_HAVE_MPI) | ||
add_library(adios2_basics_globalArray1D_mpivars_c OBJECT mpivars.c) | ||
target_link_libraries(adios2_basics_globalArray1D_mpivars_c MPI::MPI_C) | ||
install(TARGETS adios2_basics_globalArray1D_mpivars_c RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_library(adios2_basics_globalArray1D_decomp_c OBJECT decomp.c) | ||
target_link_libraries(adios2_basics_globalArray1D_decomp_c | ||
adios2_basics_globalArray1D_mpivars_c MPI::MPI_C) | ||
install(TARGETS adios2_basics_globalArray1D_decomp_c RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_executable(adios2_basics_globalArray1DWrite_c globalArray1DWrite.c) | ||
target_link_libraries(adios2_basics_globalArray1DWrite_c | ||
adios2_basics_globalArray1D_mpivars_c | ||
adios2_basics_globalArray1D_decomp_c | ||
adios2::c_mpi MPI::MPI_C) | ||
install(TARGETS adios2_basics_globalArray1DWrite_c RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_executable(adios2_basics_globalArray1DRead_c globalArray1DRead.c) | ||
target_link_libraries(adios2_basics_globalArray1DRead_c | ||
adios2_basics_globalArray1D_mpivars_c | ||
adios2_basics_globalArray1D_decomp_c | ||
adios2::c_mpi MPI::MPI_C) | ||
install(TARGETS adios2_basics_globalArray1DRead_c RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
if(ADIOS2_HAVE_Fortran) | ||
add_library(adios2_basics_globalArray1D_mpivars_f OBJECT mpivars.F90) | ||
target_link_libraries(adios2_basics_globalArray1D_mpivars_f MPI::MPI_Fortran) | ||
install(TARGETS adios2_basics_globalArray1D_mpivars_f RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_library(adios2_basics_globalArray1D_decomp_f OBJECT decomp.F90) | ||
target_link_libraries(adios2_basics_globalArray1D_decomp_f | ||
adios2_basics_globalArray1D_mpivars_f MPI::MPI_Fortran) | ||
install(TARGETS adios2_basics_globalArray1D_decomp_f RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_executable(adios2_basics_globalArray1DWrite_f globalArray1DWrite.F90) | ||
target_link_libraries(adios2_basics_globalArray1DWrite_f | ||
adios2_basics_globalArray1D_mpivars_f | ||
adios2_basics_globalArray1D_decomp_f | ||
adios2::fortran_mpi MPI::MPI_Fortran) | ||
install(TARGETS adios2_basics_globalArray1DWrite_f RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
add_executable(adios2_basics_globalArray1DRead_f globalArray1DRead.F90) | ||
target_link_libraries(adios2_basics_globalArray1DRead_f | ||
adios2_basics_globalArray1D_mpivars_f | ||
adios2_basics_globalArray1D_decomp_f | ||
adios2::fortran_mpi MPI::MPI_Fortran) | ||
install(TARGETS adios2_basics_globalArray1DRead_f RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
! Helper functions for all examples | ||
module decomp | ||
contains | ||
|
||
! random integer from {minv, minv+1, ..., maxv} | ||
! including minv and maxv | ||
function get_random(minv, maxv) result(n) | ||
implicit none | ||
integer, intent(in) :: minv, maxv | ||
real :: r | ||
integer :: n | ||
call random_number(r) | ||
n = minv + FLOOR((maxv+1-minv)*r) | ||
end function get_random | ||
|
||
! gather the local sizes of arrays and sum them up | ||
! so that each process knows the global shape | ||
! and its own offset in the global space | ||
subroutine gather_decomp_1d(mysize, myshape, myoffset) | ||
use mpivars | ||
implicit none | ||
integer*8, intent(in) :: mysize | ||
integer*8, intent(out) :: myshape, myoffset | ||
integer*8, dimension(:), allocatable :: sizes | ||
|
||
allocate(sizes(nproc)) | ||
call MPI_Allgather( mysize, 1, MPI_LONG_LONG, & | ||
sizes, 1, MPI_LONG_LONG, & | ||
app_comm, ierr) | ||
myshape = sum(sizes) | ||
myoffset = sum(sizes(1:rank)) | ||
deallocate(sizes) | ||
end subroutine gather_decomp_1d | ||
|
||
subroutine decompose_1d(globalsize, myoffset, mysize) | ||
use mpivars | ||
implicit none | ||
integer*8, intent(in) :: globalsize | ||
integer*8, intent(out) :: myoffset, mysize | ||
integer*8 :: rem | ||
|
||
mysize = globalsize/nproc | ||
rem = globalsize-(nproc*mysize) | ||
if (rank < rem) then | ||
mysize = mysize + 1 | ||
myoffset = rank*mysize | ||
else | ||
myoffset = rank*mysize + rem | ||
endif | ||
end subroutine decompose_1d | ||
|
||
end module decomp | ||
|
Oops, something went wrong.