New Feature: check remote directory for .ncdf file before uploading mesh file (and adjust slurm script)
Step 1 Refactor current job-submit logic
Starts in qtNewtJobSubmitter::submitAnalysisJob()
. First thing it calls qtNewtJobSubmitter::Internal::init()
. The main series of slots are then:
createJobDirectory()
clearResultsDirectory()
==> NEW PROTECTED METHOD AND CORRESPONDING SLOT : queryMeshFile() and onQueryMeshFileFinished()
uploadJobFiles()
submitJob()
-
In qtNewtJobSubmitter::Internal::init()
comment out the logic for adding the meshfile to the m_uploadFileList (looks like lines 207-232). -
In qtNewtJobSubmitter::createJobDirectory()
comment out the logic for generating the slurm script (lines 520-526). -
Insert new queryMeshFile()
method andonQueryMeshFileFinished()
slot into the cascade. -
Move the commented-out logic from the above 2 places into the onQueryMeshFileFinished()
slot, and call the slot directory form the newqueryMeshFile()
.
Step 2 Add the logic to query for the mesh
-
In queryMeshFile()
, request file list for the remote job directory, which is the Internal::m_remoteJobDirectory. The call isqtNewtInterface::requestDirectoryList()
. Follow similar logic as inqtNewtFileBrowserWidget::gotoPath()
-
In onQueryMeshFileFinished()
, copy the logic for checking for errors. If none, then parse the returned data looking for the remote mesh file. Follow similar logic as in qtNewtFileBrowserWidget::onListFolderReply()`. -
some where in the slot, get the remote mesh filename from the jobs manifest generator. Use JobsManifestGenerator::get()
method to return annlohmann::json
object. This might work:
//std::string meshFilename = generator.data().at("runtime_mesh_filename").get<std::string>()
auto iter = generator.data().find("runtime_mesh_filename");
if (iter == generator.data().end())
{
// some warning message
return
}
std::string meshFilename = iter->get<std::string>();
- The when iterating over the file "name" items, compare with the meshfilename
Edited by John Tourtellott