- Notifications
You must be signed in to change notification settings - Fork148
Define pre-proc vars for FORMTMP and FORMTMPSORT.#433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Sometimes these paths can be useful in a form script, for use with #system, for example.
jodavies commentedMar 6, 2023
This causes a valgrind read error in vorm tests, I am unable to tell so far if that is my fault or of it simply uncovers something else. If I understand correctly, adding new pre-proc vars really is this simple, right? |
tueda commentedMar 6, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think the paths Edit: Never mind. I was wrong. |
jodavies commentedMar 6, 2023
I can reproduce this in my machine if I copy the code of the failing test. However if I modify it by, say, defining two more pre-proc variables in the form script which don't do anything, valgrind is again happy. |
tueda commentedMar 6, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OK, this is not your fault. Actually, the following code gives a Valgrind error with the master branch: Something wrong seems to occur for Edit: deferred substitution is not needed to reproduce the Valgrind error: |
tueda commentedMar 7, 2023
The memory error was fixed in741861a. I am not sure about the use case of these variables with |
jodavies commentedMar 7, 2023
I would like to do something like Personally I have FORMTMP defined in my environment, but this doesn't work if a user has defined their temp dir with the |
tueda commentedMar 7, 2023
On the one hand I'm still not so convinced why I would merge this pull request, but before that, does anyone else have any other opinions? |
jodavies commentedMar 7, 2023
In the environment variable case you need to have called form as |
tueda commentedMar 7, 2023
Well, yes, if I assume the environment variable To me, In general, |
jodavies commentedMar 7, 2023
I didn't actually know that the preprocessor will search for variables in the environment if they are not defined in the script or as an argument, thanks. For my purposes, what would actually be even cleaner is if FORM were to compress the expression data inside the save files by itself. Usually I see something like a 10x compression ratio here, which saves quite some disk space and network bandwidth. This is much more difficult to implement, however. |
vermaseren commentedMar 7, 2023 via email
I think the better solution may be that .sav files have the option to be gzipped by Form when they are written.That is more programming work, but it would have more value in the long run.And there are examples of the use of gzip in the Form sources.Of course one should not gzip the whole file as one stream, but each expression seperately. In that caseone has to have an index that is not compressed which tells which expressions there are and where in thefile. Such an index is there already. Hence that part should not be compressed. … On 7 Mar 2023, at 13:38, Takahiro Ueda ***@***.***> wrote: In the environment variable case you need to have called form as form -d TMPDIR=$FORMTMP anyway don't you? Well, yes, if TMPDIR must have the same value as FORMTMP and so you want to overwrite the default TMPDIR with FORMTMP. I assume the environment variable TMPDIR is defined on Unix or at least on Linux, so it is available for the preprocessor. For Windows or other special environments, #ifdef is needed to check if TMPDIR is given by the system. I think Windows provides TMP and TEMP instead of TMPDIR, so a generic way would be: #if (isdefined(TMPDIR)) #define mytempdir "`TMPDIR'" #elseif (isdefined(TMP)) #define mytempdir "`TMP'" #elseif (isdefined(TEMP)) #define mytempdir "`TEMP'" #else #define mytempdir "." #endif #message `mytempdir'/large.sav .end To me, TMPDIR sounds more or less for temporary files in general, and FORMTMP is for temporary files that FORM automatically creates (I admit that you may argue that FORMTMP could be for any temporary files during a FORM run, though). In general, TMPDIR may differ from FORMTMP (though you may set export FORMTMP=$TMPDIR on your shell). Whether it is better to make temporary files in TMPDIR or FORMTMP (speed/storage size) depends on where FORM is running. In this sense, the script needs to know the environment and has no way to determine where is the best place for temporary files. The script needs some assumption for it or the user who invokes FORM needs to specify this information in some way (which may be by the -t option as you mentioned). — Reply to this email directly, view it on GitHub <#433 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCEUTURT4EPOSH2DG2WTW24T37ANCNFSM6AAAAAAVQ2E62A>. You are receiving this because you are subscribed to this thread. |
tueda commentedMar 8, 2023
Probably, saving files with gzip-compressed expressions would be discussed as a separate issue. I have created it:#436. |
Sometimes these paths can be useful in a form script, for use with #system, for example.