GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: src/RenderBackend/backend_scp.cpp Lines: 0 12 0.0 %
Date: 2023-10-11 10:52:07 Branches: 0 104 0.0 %

Line Branch Exec Source
1
/***************************************
2
	Auteur : Pierre Aubert
3
	Mail : pierre.aubert@lapp.in2p3.fr
4
	Licence : CeCILL-C
5
****************************************/
6
7
#include "string_utils.h"
8
#include "backend_rsync.h"
9
#include "backend_scp.h"
10
11
///Synchronise file from host to computing center
12
/**	@param project : RenderProject to be synchronised from Host to Computing Center
13
 * 	@return true on success, false otherwise
14
*/
15
bool backend_scpHostToComputingCenter(const RenderProject & project, const Scene & scene){
16
	if(!backend_checkRemoteConnection(project)){return true;}	//There is no Synchronisation to do, so everithing is fine
17
	std::string computingCenterProject(project.getComputingCenter().getRemoteWorkingDirectory());
18
	std::string sceneDir(scene.getWorkingDirectory());
19
	std::string command(project.getScpExecutable() + " -r " + sceneDir + " " + project.getComputingCenter().getComputingCenterConnection() + ":" + computingCenterProject + "/" + getFileName(project.getSourceProjectDir()) + "/" + sceneDir);
20
	return phoenix_popen("scene_"+scene.getName()+"_scpHostToComputingCenter.log", command, true);
21
}
22
23
///Synchronise file from computing center to host
24
/**	@param project : RenderProject to be synchronised from Computing Center to Host
25
 * 	@return true on success, false otherwise
26
*/
27
bool backend_scpComputingCenterToHost(const RenderProject & project, const Scene & scene){
28
	if(!backend_checkRemoteConnection(project)){return true;}	//There is no Synchronisation to do, so everithing is fine
29
	std::string computingCenterProject(project.getComputingCenter().getRemoteWorkingDirectory());
30
	std::string sceneDir(scene.getWorkingDirectory());
31
	std::string command(project.getScpExecutable() + " -r " + project.getComputingCenter().getComputingCenterConnection() + ":" + computingCenterProject + "/" + getFileName(project.getSourceProjectDir()) + "/" + sceneDir + " "+ sceneDir);
32
	return phoenix_popen("scene_"+scene.getName()+"_scpComputingCenterToHost.log", command, true);
33
}
34
35