Ticket #100 (closed task: fixed)

Opened 10 years ago

Last modified 10 years ago

xuvtools: running the stitcher on windows creates spurious directories

Reported by: ne704 [niko@… Owned by: ne704
Priority: major Milestone:
Component: xuvtools Version:
Keywords: xuvtools, fftw Cc: niko@…, aaron@…, mario@…

Description

Running the stitcher (actual stitching, not just starting the GUI) on windows (32 and 64 bit) creates a spurious directory in the root-directory of that drive where the executable resides with the name ".fftw"

For example, xuvtools_gui.exe is located in "P:\XuvTools\" here. After doing a stitcher-run, there is a new directory "P:\.fftw\" containing one file named after the scheme "<HOSTNAME>.wisdom.fftwf". This is annoying, cumbersome and irritating for the user.

IF this is required, this directory should be created somewhere inside "%USERPROFILE%" to make sure the actual user running the stitcher has write-permissions on that dir/file and to prevent messing up the filesystem.

Change History

Changed 10 years ago by emmenlau

The file "<HOSTNAME>.wisdom.fftwf" is intentionally created, to store the wisdom from the fftw on the hard disk. wisdom is the terminology for the hardware inspection of the fftw, and helps execute FFTs a lot faster. Creating good wisdom takes long (its based on trial and error). wisdom is created whenever the stitcher is run for the first time for a certain stack size with a certain quality setting.

The file should be created in the users home directory. I guess the logic for finding this directory only works on the platforms where we tested it (some variants of Windows do work. This seems to change between Windows versions and setups). AFAIK it is based on environment variables that point to the users homedir.

What exact version of Windows is that happening on? If you know, is there a variable defined that points to the users homedir (or better, can you post all defined variables from the environment)?

On a side note: If somebody would suggest a better place to store wisdom so it can be shared between users of a single machine, I would happily improve on the current policy. Not that is should never be shared between different machines (so no network profile).

Changed 10 years ago by ne704 [niko@…

  • cc niko@… added

why the heck is the reporter of a bug not included in the CC-list automatically?!?

Ok, to your questions: as initally stated, the path to a user's profile directory (which is the appropriate place to store user-relevant data on a multiuser windows installation) is stored in the environment variable called %USERPROFILE% which points to "C:\Dokumente und Einstellungen\ne704" in my case.

There are two more environment vars that can be used to construct an absolute path to a users homedir: "%HOMEDRIVE%%HOMEPATH%" (which result in the same path as above in my case).

This holds for Windows XP Professional, 32 and 64 bit, latest service packs and hotfixes as of today.

The appropriate paths to share such information between different users on the same machine would be

C:\Documents and Settings\All Users\Documents
C:\Dokumente und Einstellungen\All Users\Dokumente

which are unfortunately not resolvable via any environment variables (actually the prefix is, but the "Documents/Dokumente?" is not). In addition, there is a major drawback on using that folder, since all files will belong to the user who created them, giving others only read permissions, not write.

Changed 10 years ago by aaron@…

I think %HOMEPATH% is dangerous, since it might results in an UNC path (like at the FMI: \\argon\aponti) which can give all sort of problems (try for instance to run svn from console when the current directory is a network path). One ENV variable I usually use is %APPDATA%, which points to the Application Data folder under %USERPROFILE%.

Changed 10 years ago by emmenlau

Off topic: (This version of) Trac is really bad in some regards!

On topic: Here is a pointer to the current implementation:

grep -rn "getenv" XuvTools/trunk/libBlitzFFTW/src/
XuvTools/trunk/libBlitzFFTW/src/BlitzFFTW.cc:69:  char* ptr = getenv("HOME");
XuvTools/trunk/libBlitzFFTW/src/BlitzFFTW.cc:100:    ptr = getenv("USERPROFILE");
XuvTools/trunk/libBlitzFFTW/src/BlitzFFTW.cc:105:      ptr = getenv("HOMEPATH");
XuvTools/trunk/libBlitzFFTW/src/BlitzFFTW.cc:110:        ptr = getenv("HOMEDRIVE");

Changed 10 years ago by emmenlau

In the above code snipet, you can see we are already using %USERPROFILE%. There are two reasons why this might not work for you:

  • the variable(s) are not defined
  • string encoding: for expanding of the variables, there is a separate implementation between Unicode and non-Unicode. I guess only one of these two has been thoroughly tested.

Changed 10 years ago by emmenlau

  • status changed from new to closed
  • resolution set to worksforme

I will close this bug as worksforme, because there has been no progress in a while and the implementation seems correct:-(

Please open the bug again if you can still reproduce it, and provide more details.

Changed 10 years ago by ne704 [niko@…

  • status changed from closed to reopened
  • resolution worksforme deleted

I still was able to reproduce this with the latest stitcher-versions.

Anyway, using the filesystem-root for placing the ".fftw" directory is IMHO not the best idea, since under windows those files follow the creator-owner mechanism, and thus it is very likely that updating the wisdom will fail if a different user on the same machine runs a previously "unwisdomed" combination of stack size/quality setting.

I'll try to investigate this further in the next days, but I'm not happy with the current situation and thus re-opening the bug ;)

Changed 10 years ago by ne704 [niko@…

  • owner changed from emmenlau to ne704
  • status changed from reopened to new

(reassigned the bug to me)

Changed 10 years ago by emmenlau

  • priority changed from minor to major

I absolutely agree that the directories should only be created in the users home directory!

A good way to debug this, is to go in the mainwindow.cpp and call Reporter::messageCallback(0, std::string(getenv("USERPROFILE"))+"\n");

and the same for the other variables. Then you should find the result in your logfile (and probably in the GUI console). Good luck!

Changed 10 years ago by ne704 [niko@…

  • status changed from new to assigned

Just a short update, I was still able to reproduce this with the latest version (r3129). Haven't had a chance yet to play with the code, sorry :-|

Changed 10 years ago by emmenlau

  • status changed from assigned to closed
  • resolution set to fixed

Could be fixed in r3135. When you find time, could you please try again? Please re-open if bug still exists.

Changed 10 years ago by ne704 [niko@…

Seems to be fine now, the ".fftw" directory is created in %USERPROFILE%. Should work as well when using the so-called "roaming profiles" since the machine's name is part of the wisdom file (though I can't test it since we don't have roaming profiles here).

Note: See TracTickets for help on using tickets.