Commit Graph

54 Commits

Author SHA1 Message Date
jpekkila
17c935ce19 Added padding to param name buffers to make them have NUM_*_PARAMS+1 elements. This should satisfy some strict compilation checks. 2020-01-28 18:53:09 +02:00
jpekkila
0ccd4e3dbc Major improvement: uniforms can now be set to default values. The syntax is the same as for setting any other values, f.ex. 'uniform Scalar a = 1; uniform Scalar b = 0.5 * a;'. Undefined uniforms are still allowed, but in this case the user should load a proper value into it during runtime. Default uniform values can be overwritten by calling any of the uniform loader funcions (like acDeviceLoadScalarUniform). Improved also error checking. Now there are explicit warnings if the user tries to load an invalid value into a device constant. 2020-01-28 18:17:31 +02:00
jpekkila
7215e842fc Simplified the include directory. Everything is now in only two headers: astaroth.h and astaroth_utils.h. Removed old and unused stuff. user.h is unused in standalone but might be used with Pencil Code, so left that intact. 2020-01-23 19:59:44 +02:00
jpekkila
5e1500fe97 Happy new year! :) 2020-01-13 21:38:07 +02:00
jpekkila
794e4393c3 Added a new function for the legacy Astaroth layer: acGetNode(). This functions returns a Node, which can be used to access acNode layer functions 2020-01-13 11:33:15 +02:00
jpekkila
0865f0499b Various improvements to the MPI-GPU implementation, but linking MPI libraries with both the host C-project and the core library seems to be a major pain. Currently the communication is done via gpu->cpu->cpu->gpu. 2019-10-15 19:32:16 +03:00
jpekkila
b5daf22c26 Added interface function acSynchronizeMesh 2019-08-12 10:25:05 +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
5232d987c1 Added acStoreWithOffset to the revised interface 2019-08-05 16:18:22 +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
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
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
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
jpekkila
d9be66f65f NOTE: Renamed LINDUCTION to LMAGNETIC throughout the project. 2019-07-01 13:40:24 +03:00
Miikka Vaisala
9f0be0d9ff Solved the forcing function boundary problem. 2019-07-01 11:06:42 +08:00
jpekkila
b694702cf8 Removed an old comment 2019-06-27 17:11:21 +03:00
jpekkila
30c21ff420 Formatting: defines stay indented if clang-format is turned off temporarily 2019-06-27 13:31:50 +03:00
jpekkila
8ca09668c1 Added an advance notice about LINDUCTION to be renamed to LMAGNETIC in the near future throughout the project. LMAGNETIC would be better name since he define is used to enable the magnetic field. 2019-06-27 13:28:52 +03:00
jpekkila
fc96283c37 Reordered logical flags in a more logical order, density -> hydro -> induction -> entropy -> others 2019-06-27 13:22:14 +03:00
jpekkila
75fb756ad4 Autoformatted with clang-format. Clang-format does not support indented defines as far as I know, so this will have to do. The alternative would be not to use autoformatting at all (or some other tool). 2019-06-27 13:16:41 +03:00
Miikka Vaisala
d30b866a21 Merge branch 'master' into forcing
Now I need to test what works...

Conflicts:
	acc/mhd_solver/stencil_process.sps
2019-06-27 11:22:31 +08:00
jpekkila
65c8a39cb9 Removed old comments and renamed USER_PROVIDED to USER_PROVIDED_DEFINES to be more explicit 2019-06-26 18:56:40 +03:00
jpekkila
cda17c9b08 VERBOSE_PRINTING flag is now globally used in the whole program and should be used to suppress development/debugging-related printing. Also added comments to the new interface function acCheckDeviceAvailability and made it free from side effects. 2019-06-26 18:50:15 +03:00
Matthias Rheinhardt
0bc8b7e827 MR: VTXBUF_DENSITY -> VTXBUF_LNRHO, minor 2019-06-26 17:14:24 +03:00
Matthias Rheinhardt
57a39fd848 MR: USER_PROVIDED 2019-06-26 17:10:51 +03:00
Miikka Vaisala
be0e46c814 Can move forcing vector information now from the host to device.
next step in to generate random waves in the CPU with a chosen degree of helicity etc.
2019-06-26 17:41:39 +08:00