Changeset 24699


Ignore:
Timestamp:
2011-09-30T14:31:25+13:00 (13 years ago)
Author:
jmt12
Message:

Write the manifest files to the collection's tmp directory so we can play with IO and RAMDisks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/src/mpiimport-src/mpiimport.cpp

    r24589 r24699  
    66// 1 July 2010
    77
    8 // 2011MAR - added a bunch of commands to aid [my] understanding. jmt12
    9 //         - made site argument optional to support GS2. jmt12
     8// 2011MAR - added a bunch of commands to aid (my) understanding.
     9//         - made site argument optional to support GS2.
    1010//         - moving manifest writing code into the rank=0 thread. This will
    1111//           remove the artificial limit on epoc size caused by size of
    12 //           message buffer between controller and child threads. jmt12
     12//           message buffer between controller and child threads. [jmt12]
     13// 2011SEP - changing where the manifest files are written so I have the
     14//           ability to set up the location as a RAMDisk. [jmt12]
    1315
    1416#include "mpi.h"
     
    1921#include <fstream>
    2022#include <iostream>
     23#include <sstream>
    2124#include <string>
    2225#include <vector>
     
    8790
    8891    // scan through contents of file listing
     92    int manifest_file_count = 1;
    8993    while (!infile.eof ())
    9094    {
     
    115119
    116120        // construct manifest filename
    117         char manifestfile_buffer[128];
    118         sprintf (manifestfile_buffer, "%u.manifest.xml", rank);
    119         char* manifestfilename = tempnam(NULL,manifestfile_buffer);
     121    stringstream manifestfilename_strstr;
     122    manifestfilename_strstr << gsdlhomedir << "/collect/" << collection << "/tmp/manifest." << manifest_file_count << ".xml";
     123    string manifestfilename_str = manifestfilename_strstr.str();
     124    char *manifestfilename = new char [manifestfilename_str.size() + 1];
     125    strcpy(manifestfilename, manifestfilename_str.c_str());
    120126        ofstream manifestfile;
    121127        if (manifestfilename != NULL)
     
    169175          actualTasks = dest;
    170176        }
     177    // increase number of manifest files processed
     178    manifest_file_count++;
    171179      }
    172180    }
Note: See TracChangeset for help on using the changeset viewer.