Commit Graph

119 Commits

Author SHA1 Message Date
jpekkila
f6040f89dc Added acPrintMeshInfo for printing all mesh parameters 2019-08-21 16:24:48 +03:00
jpekkila
0208d55e4e Moved STENCIL_ORDER and NGHOST out of user-defined parameter as these are actually internal defines used to configure the built-in functions. Additionally, renamed all explicitly declared uniforms from dsx -> AC_dsx in the DSL in preparation for having clear connection between DSL uniforms and the library parameter handles created by the user (AcRealParam etc) 2019-08-19 16:40:47 +03:00
jpekkila
787363226b Added functions for loading int, int3, scalar and vector constants to the device layer (acDeviceLoad...Constant) 2019-08-19 15:28:16 +03:00
jpekkila
598799d7c3 Added a new function to the device interface: acDeviceLoadMeshInfo 2019-08-19 15:14:00 +03:00
jpekkila
3369d8efec Added a missing include 2019-08-12 11:44:27 +03:00
jpekkila
bba9ec7c3b Implemented acNodeQueryDeviceConfiguration 2019-08-12 11:40:38 +03:00
jpekkila
b5daf22c26 Added interface function acSynchronizeMesh 2019-08-12 10:25:05 +03:00
jpekkila
fdadd463b7 Included the user-defined header after the definition of AcReal to make it available if needed. 2019-08-09 17:11:21 +03:00
jpekkila
5397495496 Added acLoadWithOffset 2019-08-08 20:43:01 +03:00
jpekkila
e79e1207f2 Added a function for checking whether CUDA-capable devices are available 2019-08-08 20:35:02 +03:00
jpekkila
8a9099d75e Added missing functions to fix backwards compatibility with the version interfaced with Pencil Code 2019-08-08 19:49:57 +03:00
jpekkila
322cdce52c Added some new comments + some helpful old comments from a time before the interface revision 2019-08-07 20:05:54 +03:00
jpekkila
3726847683 Made globalGridN and d_multigpu_offsets built-in parameters. Note the renaming from globalGrid.n to globalGridN. 2019-08-06 16:39:15 +03:00
jpekkila
b73c2675e8 Added the optimized implementation of acNodeIntegrate where boundconds are done before integration instead of after 2019-08-05 20:10:13 +03:00
jpekkila
5232d987c1 Added acStoreWithOffset to the revised interface 2019-08-05 16:18:22 +03:00
jpekkila
5f2378e91b Now compiles (does not work though) 2019-08-02 15:15:18 +03:00
jpekkila
567ad61465 Multinode MPI implementation should be done later in its own branch. The focus of this branch is to revise the node and device layers. Commented out references to the Grid layer. 2019-08-02 13:54:54 +03:00
jpekkila
2b6bf10ae6 Dummy implementation of the Grid interface 2019-08-01 18:37:36 +03:00
jpekkila
328b809efe Added the revised node interface 2019-08-01 14:04:11 +03:00
jpekkila
fb0610c1ba Intermediate changes to the revised node interface 2019-07-31 20:04:39 +03:00
jpekkila
49026bd26b Revised device interface done 2019-07-31 18:46:41 +03:00
jpekkila
5be775dbff Various intermediate changes 2019-07-31 17:48:48 +03:00
jpekkila
efd9d54fef Stashing WIP changes (interface revision) s.t. I can continue work on a different machine 2019-07-30 14:34:44 +03:00
jpekkila
1ceb6739ae Merge branch 'master' into node_device_interface_revision_07-23 2019-07-30 14:31:33 +03:00
jpekkila
69deef66fe Added sum reduction. NOTE: Scalar sum does not pass the automated test but vector sum does. I couldn't see anything wrong with the code itself and I strongly suspect that the failures are caused by loss of precision due to summing a huge amount of numbers of different magnitudes. However I'm not yet completely sure. Something like the Kahan summation algorithm might be useful if the errors are really caused by fp arithmetic. 2019-07-30 14:28:18 +03:00
jpekkila
f322bc8b37 Rewrote all CMakeLists. Now much cleaner and there's a clear separation during compilation between the core and standalone modules. 2019-07-23 20:50:37 +03:00
jpekkila
b65454d523 Stashed some testing files used to make sure that the library can also be used from pure C projects (better compatibility). These changes will never go to master as-is. 2019-07-23 18:24:47 +03:00
jpekkila
0282f45077 Forgot extern C 2019-07-23 16:11:17 +03:00
jpekkila
e5172e2a9a Moved more stuff out of astaroth.h to astaroth_defines.h. I'm not particularly sure what's the best way to arrange the include files. These changes are just for readability so it's very safe to move things around though. 2019-07-23 16:06:54 +03:00
jpekkila
c98e730397 Added extern C to the include headers 2019-07-23 15:02:54 +03:00
jpekkila
c0774bc3b8 Added overloads for getting and setting various parameters. However, the compiler mangles the names which is not good for a cross-platform library so the functions are commented out for now. Sadly _Generic, which would solve everything, from C11 is not available in C++. 2019-07-23 14:56:41 +03:00
jpekkila
97d5b2e04a Formatting 2019-07-23 14:39:36 +03:00
jpekkila
323d4e3b31 Replaced all calls to AC_VTXBUF_IDX to acVertexBufferIdx etc in all files 2019-07-23 14:37:28 +03:00
jpekkila
27f4d1e4ff Added actual functions for getting size of the vertex buffers etc. The previously used macros are now deprecated. Type safety is the major benefit of using functions instead of definitions. 2019-07-23 13:44:43 +03:00
jpekkila
f74df5339f Cleaned up the include directory: removed all unnecessary stuff and moved common definitions to a separate file 2019-07-22 19:46:45 +03:00
jpekkila
78aba6428e Updated the copyright years throughout the project 2019-07-16 14:28:32 +03:00
jpekkila
93fc121f5c Introduced versions of the asynchronous functions which take a stream as a parameter 2019-07-10 15:49:21 +03:00
jpekkila
866ec8a192 Removed some old hack I used for benchmarking a while back 2019-07-10 14:34:05 +03:00
jpekkila
0bda016e17 Reviewed the Astaroth interface. Now there's a clear distinction between synchronous and asynchronous functions. For basic usage, we provide a set of functions that are always safe to call (acIntegrate, acLoad, etc), but because of this, must be quite restricted in the sense that f.ex. the whole mesh must be loaded at once and computations cannot be executed concurrently on multiple GPUs. For more advanced users we provide asynchronous functions (such as acLoadWithOffset). Since we cannot know how the asynchronous functions are called (for example, when the integration step has been fully completed and the halos of neighboring subgrids can be safely communicated between GPUs), the responsibility of synchronization must be left to the user. In the existing implementations we currently use only the basic "safe" set of functions (except in renderer.cc), so the existing functionality has not been changed with these latests commits. Autotests also pass. 2019-07-09 18:42:00 +03:00
jpekkila
10a98b01a9 Experimental change: now the integration function is automatically optimized during acInit 2019-07-09 14:46:24 +03:00
jpekkila
0884c4bf38 Moved the definition of acForcingVec to host_forcing.cc since it depends on user parameters that may not be defined in all projects 2019-07-04 15:28:18 +03:00
jpekkila
7abb959828 Overhaul to the user-defined parameters done: All logical switches, parameters and vertex buffer handles are now defined in a single header file (the default location is acc/mhd_solver/stencil_defines.h). This header is used when preprocessing the DSL sources and is linked to the include/ directory when calling scripts/compile_acc.sh. astaroth.h is now used for configuring internal stuff only and should not be modified by users 2019-07-03 19:01:16 +03:00
jpekkila
acc53e1c2b Merged master to acc_parameter_overhaul 2019-07-03 17:37:37 +03:00
jpekkila
08e9a32cb1 Added a comment about acForcingVec 2019-07-03 16:37:16 +03:00
jpekkila
d4d2680f40 Added a new generic function to the interface (astaroth.h) for loading arbitrary device constants. Also (unintended) autoformatting. 2019-07-03 16:19:25 +03:00
Miikka Vaisala
334ff868d9 Forcing disabled from autotest and from defaults.
It is not suitable function of the autotest tool. If there in really a
mandatory need to add it. I will need special help from Johannes.
2019-07-02 18:46:04 +08:00
Miikka Vaisala
03689709df Merge branch 'master' into forcing 2019-07-02 16:43:10 +08:00
Miikka Vaisala
d0eb308f17 Better interface to forcing. 2019-07-02 16:35:14 +08:00
jpekkila
75f74526f4 Fixed incorrect logic with ifdefs: LMAGNETIC etc are toggle switches and are always defined 2019-07-01 18:43:04 +03:00
jpekkila
b8869bb848 Linked the defines used by the DSL and astaroth.h. Now f.ex. LENTROPY has to be set only once in acc/mhd_solver/stencil_defines.h and it is propagated throughout the whole project. The name for stencil_defines.h is not final and may change if I come up with a better name. In any case, there is now a standard header associated with each DSL solver where the user can set defines, and declare arrays (VTXBUF_LNRHO) and device constants (uniforms). 2019-07-01 18:37:56 +03:00