jpekkila
|
8c1e603a98
|
On second thought, let's revert the changes in mhd_solver and use the file I already modified instead of doing the same changes twice
|
2019-10-07 17:29:53 +03:00 |
|
jpekkila
|
16c8b1e748
|
Autoformatting
|
2019-10-07 17:17:58 +03:00 |
|
jpekkila
|
c8e0586b60
|
Renamed the old .sas and .sdh files to regular headers and added #pragma once.
|
2019-10-07 17:17:26 +03:00 |
|
jpekkila
|
48c6174319
|
Added error checks to stdderiv.h
|
2019-10-07 16:59:58 +03:00 |
|
jpekkila
|
0e1d1b9fb4
|
Some optimizations for DSL compilation. Also a new feature: Inplace addition and subtraction += and -= are now allowed
|
2019-10-07 16:33:24 +03:00 |
|
jpekkila
|
d97f5b59ba
|
Rewrote the Astaroth DSL compiler. More information and cleanup in the next commits.
|
2019-10-07 15:43:20 +03:00 |
|
jpekkila
|
6665d30983
|
Merge branch 'acc_rewrite_20191002' of https://bitbucket.org/jpekkila/astaroth into acc_rewrite_20191002
|
2019-10-03 02:36:04 +03:00 |
|
jpekkila
|
a651420e8d
|
WIP changes
|
2019-10-03 02:35:48 +03:00 |
|
jpekkila
|
a02fa349ce
|
Commented out a grammar rule that was ambiguous
|
2019-10-03 01:52:56 +03:00 |
|
jpekkila
|
b0162bdea0
|
Added DSL versions of the basic derivative operations (placeholder)
|
2019-10-02 21:09:36 +03:00 |
|
jpekkila
|
cc3c2eb926
|
Added WIP stuff for the Astaroth DSL compiler rewrite. Once this branch is finished only a single source file will be needed (file ending .ac). This revision is needed to decouple absolutely all implementation-specific stuff (f.ex. AC_dsx) from the core library and make life easier for everyone. The plan is to provide a standard library header written in the DSL containing the derivative operations instead of hardcoding them in the CUDA implementation.
|
2019-10-02 21:03:59 +03:00 |
|
Miikka Vaisala
|
f8e82d41af
|
Can now set the endtime for simulation, instead of step number.
|
2019-10-02 15:09:26 +08:00 |
|
Miikka Vaisala
|
1b0e9803b0
|
Compiles and runs again.
Now to actual testing. Can we read and cotinue from and old file?
|
2019-10-02 13:52:38 +08:00 |
|
jpekkila
|
7d76250f70
|
Updated stencil_process.sps with the revised syntax for real literals
|
2019-10-01 21:20:28 +03:00 |
|
jpekkila
|
a0037d1a44
|
Modified the syntax of writing real-valued literals with the DSL. Casts are not needed any more: f.ex. 1.0 is implicitly cast to AcReal. The syntax is now more consistent: reals must be explicitly written as a.b, where a and b are some integers. IMPORTANT: Previously the shorthands a. and .b were allowed, not anymore. Using those shorthands will result in a compilation error
|
2019-10-01 21:14:33 +03:00 |
|
jpekkila
|
b4a6ddb074
|
Preprocessing writes the intermediate output to *.preprocessed files. This makes debugging various DSL syntax errors much easier since the line number in the error corresponds to the line numbers in these files.
|
2019-10-01 21:08:38 +03:00 |
|
jpekkila
|
19b16eecc8
|
Added an example for creating arbitrary projects, see acc/test_solver and src/exampleproject. Note: make sure that dt is calculated adequately and that all parameters are defined properly (see src/exampleproject/simulation.cc)
|
2019-10-01 15:33:26 +03:00 |
|
jpekkila
|
2c8c49ee24
|
Removed or updated some old .gitignore files
|
2019-09-24 17:50:41 +03:00 |
|
jpekkila
|
62fa95ca0d
|
The issue on Puhti was that it was missing a static flex library which would have provided the function yywrap. Fixed by removing the static library dependency and adding option noyywrap to the lexer generator file
|
2019-09-24 17:19:19 +03:00 |
|
jpekkila
|
72af2cf31d
|
acc is now built with cmake instead of the old build script. This was mainly done to fix compilation on Puhti where I had problems linking flex even though it is available. As an added bonus the code is now safer to build since all dependencies are now rigorously tracked by cmake and make, and f.ex. change in the compiler now forces also the whole library to be rebuilt (which is the behaviour we want)
|
2019-09-24 16:57:19 +03:00 |
|
jpekkila
|
a91da8388c
|
Better code style in some of the acc source files
|
2019-09-24 15:50:20 +03:00 |
|
jpekkila
|
3bb6ca1712
|
The Astaroth Code Compiler (acc) is now built with cmake. Additionally, make is now used to generate the CUDA headers from DSL sources. The headers are also properly regenerated whenever a DSL file has been changed. With this commit, the DSL is now seamlessly integrated to the library and we no longer need complicated scripts to figure out the correct files. The current workflow for using custom DSL sources is to pass the DSL module directory to cmake, f.ex. cmake -DDSL_MODULE_DIR=/acc/mhd_solver. Note that the path must be absolute or then given relative to the CMakeLists.txt directory. f.ex cd build && cmake -DDSL_MODULE_DIR=../acc/mhd_solver does not work. CMake then takes all DSL files in that directory and handles the rest.
|
2019-09-18 17:28:29 +03:00 |
|
Miikka Vaisala
|
f5733e5144
|
Turnin LSINK off by default to prepare for merge to master.
|
2019-09-16 11:15:44 +08:00 |
|
Miikka Vaisala
|
42f92c7d49
|
Merge branch 'master' into sink_20190723
|
2019-09-16 10:57:15 +08:00 |
|
Miikka Vaisala
|
bd55c42fe5
|
Hann-windowing for the sink
|
2019-09-03 16:38:16 +08:00 |
|
Miikka Vaisala
|
dac509241f
|
Cleanup, comments and a new template.
|
2019-09-03 15:24:58 +08:00 |
|
Miikka Vaisala
|
b3ed0937fe
|
Changes according to JP's comments in the Issue #8.
|
2019-09-03 10:19:22 +08:00 |
|
jpekkila
|
cdb504e772
|
Added a proof-of-concept helical forcing which uses the newly introduced ScalarArrays for reading profiles. Not extensively tested.
|
2019-09-02 21:29:07 +03:00 |
|
jpekkila
|
9e57aba9b7
|
New feature: ScalarArray. ScalarArrays are read-only 1D arrays containing max(mx, max(my, mz)) elements. ScalarArray is a new type of uniform and can be used for storing f.ex. forcing profiles. The DSL now also supports complex numbers and some basic arithmetic (exp, multiplication)
|
2019-09-02 21:26:57 +03:00 |
|
Miikka Vaisala
|
ac92123842
|
Made a note about a bug in 083ff59 , just to remember that code is now more correct.
|
2019-09-02 18:40:38 +08:00 |
|
Miikka Vaisala
|
f3a36ec276
|
Moved definition location of AC_nx_min etc. Otherwide DSL does not compile the code correctly!!!
|
2019-09-02 18:29:16 +08:00 |
|
Miikka Vaisala
|
b4cd92da0c
|
Now compiles and runs.
PLEASE NOTE THAT FLAGS NEED TO BE SET SEPARATELY IN simulation.cc and renderer.cc FOR LSINK and LFORCING!
|
2019-09-02 14:47:58 +08:00 |
|
Miikka Vaisala
|
02ac6c956f
|
Desperately trying to port the new changes of DSL.
Still work to do.
|
2019-09-02 14:04:27 +08:00 |
|
Miikka Vaisala
|
6eeb225924
|
Merge branch 'master' into sink_20190723
Hopefully the merge isssues were resolved.
|
2019-09-02 11:58:48 +08:00 |
|
jpekkila
|
6ea02fa28e
|
DSL now 'feature complete' with respect to what I had in mind before the summer. Users can now create multiple kernels and the library functions are generated automatically for them. The generated library functions are of the form acDeviceKernel_<name> and acNodeKernel_<name>. More features are needed though. The next features to be added at some point are 1D and 2D device constant arrays in order to support profiles for f.ex. forcing.
|
2019-08-27 18:19:20 +03:00 |
|
jpekkila
|
20138263f4
|
The previous attempt (dsl_feature_completeness_2019-08-23) to enable arbitrary kernel functions was a failure: we get significant performance loss (25-100%) if step_number is not passed as a template parameter to the integration kernel. Apparently the CUDA compiler cannot perform some optimizations if there is a if/else construct in a performance-critical part which cannot be evaluated at compile time. This branch keeps step_number as a template parameter but takes rest of the user parameters as uniforms (dt is no longer passed as a function parameter but as an uniform with the DSL instead).
|
2019-08-27 17:36:33 +03:00 |
|
Miikka Vaisala
|
1410e57866
|
Preparing isothermal collapse.
|
2019-08-22 18:18:30 +08:00 |
|
Miikka Vaisala
|
a81bc22fb6
|
Write now sink infor to time series. Also a bug cerrection for sink switch.
|
2019-08-22 11:52:02 +08:00 |
|
jpekkila
|
5d2b658fb0
|
Autoformatted the DSL files
|
2019-08-20 18:41:26 +03:00 |
|
JackHsu
|
5b686bc659
|
Fixed on/off switch for forcing and accretion, now forcing only happens for first 1000 steps (currently hard-coded), and accretion only happen after 1000 steps.
|
2019-08-20 23:12:42 +08:00 |
|
jpekkila
|
5b7408eb55
|
User config param overhaul complete, works. If I haven't missed anything, all fields and user parameters, and everything related to simulation can now be declared with the DSL. The only thing that you need to do is to fill the declared symbols with data, like with OpenGL and GLSL.
|
2019-08-19 18:43:16 +03:00 |
|
jpekkila
|
51cf1f1068
|
The C header is now generated from the DSL, stashing the changes just to be sure since I might overwrite something when updating the compilation scripts to work with this new scheme
|
2019-08-19 18:19:28 +03:00 |
|
jpekkila
|
bcdd827a4f
|
Added a proper declarations for all user-specified uniform. Note: built-in uniforms are not correctly translated into CUDA
|
2019-08-19 17:05:56 +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
|
c98b74563c
|
Added a comment
|
2019-08-19 16:18:24 +03:00 |
|
jpekkila
|
b316e51267
|
Added preliminary code for generating C headers with the DSL
|
2019-08-19 16:16:26 +03:00 |
|
Miikka Vaisala
|
5d93d743c7
|
Improved sink particle stability vie Truelove criterion.
|
2019-08-19 14:38:36 +08:00 |
|
Miikka Vaisala
|
1bfb0390ad
|
Seemingly reasonable sink for both density and velocity.
|
2019-08-16 13:29:34 +08:00 |
|
Miikka Vaisala
|
f921840505
|
Changed to step function
|
2019-08-16 11:44:41 +08:00 |
|
Miikka Vaisala
|
a8fbced89d
|
Error correction.
|
2019-08-16 11:36:39 +08:00 |
|