mumax / 3

GPU-accelerated micromagnetic simulator
Other
450 stars 150 forks source link

TEMP path #206

Closed kkingstoun closed 5 years ago

kkingstoun commented 5 years ago

Hi,

this function allows to detect os, and set the correct path to the temp directory. This code will help mainly windows users.

Kking

godsic commented 5 years ago

Could you please rebase against master?

JeroenMulkers commented 5 years ago

A few nitpicks:

I think we can solve the issue of the tmp dir (also mentioned several times on the mailing list) simply by changing the default value of the cache flag from \tmp to 'Os.TempDir()'. @godsic Do you thing this is a safe solution?

kkingstoun commented 5 years ago

@JeroenMulkers I wanted to publish only this file but I had a few problems with Github ... I have to learn more about git :)

GetTmpPath looks better?

It works fine for Windows and Ubuntu, but I did not have time to check on different distributions on linux.

Edit:

Flag_cachedir = flag.String("cache", os.TempDir(), "Kernel cache directory (empty disables caching)")

this works also for Ubuntu, and Scientific Linux CERN 6.7.

Kking

JeroenMulkers commented 5 years ago

@kkingstoun , thank you for your suggestion to use the os.TempDir(). The issues with the cache directory are resolved in 3e5122d.