Commit Graph

57 Commits

Author SHA1 Message Date
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
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
9b45716186 Modified user.h such that astaroth compiles with Pencil Code. Note that this is a temporary fix: we should ultimately set the default parameters for all the logical switches in astaroth.h and let the user redefine them at will, either with the DSL or with user.h 2019-06-27 18:12:14 +03: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