43 void read_file(
const char *fname,
const string &wname,
double alpha) {
44 char *lastdot=strrchr( const_cast<char *>(fname),
'.');
50 std::cout <<
"Reading file " << fname <<
"..." << std::endl;
57 if ( strcmp( lastdot,
".hdf")==0)
63 std::string bufwin(
"bufwin");
95 std::cout <<
"Recovering t = 0 positions." << std::endl;
103 std::vector<int> pane_id;
105 pane_id.resize(npanes);
106 for(
int i = 0;
i < npanes;
i++)
107 pane_id[
i] = srcpane_ids[
i];
111 for(
int p = 0;p < npanes;p++){
115 void *src_ptr = NULL;
118 void *trg_ptr = NULL;
121 COM_get_array((wname+
".nc_t0").c_str(),pane_id[p],&src_ptr,&src_std,&src_cap);
122 COM_get_array((wname+
".nc").c_str(),pane_id[p],&trg_ptr,&trg_std,&trg_cap);
123 if(src_ptr && trg_ptr && (trg_std*trg_cap == src_std*src_cap) && src_std > 1 && src_cap > 1)
124 memcpy(trg_ptr,src_ptr,
sizeof(
double)*src_std*src_cap);
127 std::cout <<
"Warning: Not copying nc_t0 for Pane(" << pane_id[p]
128 <<
") src_ptr(" << src_ptr <<
") src_std(" << src_std
129 <<
") src_cap(" << src_cap <<
") trg_ptr(" << trg_ptr
130 <<
") trg_std(" << trg_std <<
") trg_cap(" << trg_cap
137 std::string rankstr(
"0");
139 std::ostringstream Ostr;
140 Ostr <<
"surf0_" << setw(5) << setfill(
'0') << rank+1;
145 string controlfilename(Ostr.str() +
"_in.txt");
146 Ouf.open(controlfilename.c_str());
147 Ouf <<
"@Proc: " << rank << endl
148 <<
"@Files: " <<
"surf0_" << setw(5)
149 << setfill(
'0') << rank+1 <<
".hdf" << endl;
152 std::vector<int>::iterator pii = pane_id.begin();
153 while(pii != pane_id.end())
154 Ouf << *pii++ <<
" ";
162 int main(
int argc,
char *argv[]) {
163 MPI_Init(&argc,&argv);
167 std::cerr <<
"Usage: " << argv[0]
168 <<
" <HDF|RocinControlFile1> " << std::endl
169 <<
"\t<HDF|RocinControl File1> specifies the file(s) from which to extract the time 0 mesh.\n"
176 string fname(argv[1]);
179 string::size_type n0 = fname.find_last_of(
"/");
181 if (n0 != std::string::npos)
182 fname = fname.substr( n0+1, fname.size());
184 string::size_type
ni;
185 ni = fname.find_first_of(
".:_-*[]?\\\"\'0123456789");
188 if ( ni == std::string::npos) {
190 fname.append(
".hdf");
193 if ( fname[ni] ==
'_' && (fname[ni+1] ==
's' || fname[ni+1] ==
'f'))
195 wname = fname.substr( 0, ni);
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
void COM_delete_window(const char *wname)
void read_file(const char *fname, const string &wname, double alpha)
#define COM_assertion_msg(EX, msg)
This file contains the prototypes for Roccom API.
void COM_get_array(const char *wa_str, int pane_id, void **addr, int *strd, int *cap)
Get the address for an attribute on a specific pane.
int COM_get_attribute_handle(const char *waname)
#define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_clone_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Clone the subset of panes of another window of which the given pane attribute has value val...
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
void int int REAL REAL REAL *z blockDim dim * ni
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
void COM_free_buffer(int **buf)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)