Skip to content

Commit

Permalink
impose TMPDIR=/tmp/perrozzi
Browse files Browse the repository at this point in the history
  • Loading branch information
perrozzi committed Dec 11, 2017
1 parent d5a2e16 commit 7c73816
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,18 @@ void zerr(int ret)
/* compress or decompress from stdin to stdout */
int Unzip(std::string infile, std::string outfile)
{
std::string tmpdir = getenv("TMPDIR");
if (tmpdir.size() > 50 ){
std::string command = "ln -s $PWD "+tmpdir+"/tmp;";
system(command.c_str());
command = tmpdir+"/tmp";
setenv("TMPDIR",command.c_str(), true);
}
/////////////////////////////////////////////
/////////////// BUG FIX FOR MPI /////////////
/////////////////////////////////////////////
std::string user = getenv("USER");
std::string tmpdir = "/tmp/"+user;
std::string command = "mkdir -p "+tmpdir;
system(command.c_str());
setenv("TMPDIR",tmpdir.c_str(), true);
tmpdir = getenv("TMPDIR");
/////////////////////////////////////////////
/////////////////////////////////////////////
/////////////////////////////////////////////
int ret;
FILE *in = fopen(infile.c_str(),"r");
if (!in) return -1;
Expand Down

0 comments on commit 7c73816

Please sign in to comment.