diff --git a/GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc b/GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc index 097bb7874e85d..4140a817d25ff 100644 --- a/GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc +++ b/GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc @@ -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;