Commit a3eaf604 authored by cdelbe's avatar cdelbe
Browse files

PICKED FROM TRUNK 14986

Fix SCHEDULING-521
Add a way to put DataSpace scratch dir in debug mode : not removed after execution

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/proactive/scheduling/branches/Scheduling_2.0.x@15004 28e8926c-6b08-0410-baaa-805c5e19b8d6
parent a28c8d65
......@@ -14,6 +14,8 @@ log4j.additivity.proactive.scheduler.dev.admin=true
# avoid displaying additivity of the inherit loggers
log4j.additivity.proactive.resourceManager=false
#log4j.logger.proactive.scheduler.dev.dataspace=DEBUG
# CONSOLE uses PatternLayout
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
......
......@@ -17,7 +17,11 @@ log4j.logger.proactive.scheduler.dev.admin.consol=INFO,CONSOLE
#log4j.logger.proactive.scheduler.dev.core=DEBUG
#log4j.logger.proactive.scheduler.dev.admin.core=DEBUG
#log4j.logger.proactive.scheduler.dev.database=DEBUG
#log4j.logger.proactive.scheduler.dev.core.schedule=DEBUG
#log4j.logger.proactive.scheduler.dev.admin.core.schedule=DEBUG
#log4j.logger.proactive.scheduler.dev.dataspace=DEBUG
#log4j.logger.proactive.scheduler.dev.admin.dataspace=DEBUG
#log4j.logger.proactive.scheduler.dev.database=DEBUG
#log4j.logger.proactive.scheduler.dev.admin.database=DEBUG
#log4j.logger.proactive.scheduler.dev.util=DEBUG
#log4j.logger.proactive.scheduler.dev.admin.util=DEBUG
......
......@@ -98,6 +98,8 @@ import org.ow2.proactive.scripting.ScriptResult;
public abstract class TaskLauncher implements InitActive {
public static final Logger logger_dev = ProActiveLogger.getLogger(SchedulerDevLoggers.LAUNCHER);
public static final Logger logger_dev_dataspace = ProActiveLogger
.getLogger(SchedulerDevLoggers.DATASPACE);
public static final String EXECUTION_SUCCEED_BINDING_NAME = "success";
protected DataSpacesFileObject SCRATCH = null;
......@@ -527,8 +529,8 @@ public abstract class TaskLauncher implements InitActive {
INPUT = PADataSpaces.resolveDefaultInput();
OUTPUT = PADataSpaces.resolveDefaultOutput();
} catch (Throwable t) {
logger_dev.warn("There was a problem while initializing dataSpaces, they won't be activated",
t);
logger_dev_dataspace.warn(
"There was a problem while initializing dataSpaces, they won't be activated", t);
//print for user task
System.err
.println("There was a problem while initializing dataSpaces, they won't be activated : " +
......@@ -540,8 +542,11 @@ public abstract class TaskLauncher implements InitActive {
protected void terminateDataSpace() {
if (isDataspaceAware()) {
try {
DataSpacesNodes.tryCloseNodeApplicationConfig(PAActiveObject
.getActiveObjectNode(PAActiveObject.getStubOnThis()));
//in dataspace debug mode, scratch directory are not cleaned after task execution
if (!logger_dev_dataspace.isDebugEnabled()) {
DataSpacesNodes.tryCloseNodeApplicationConfig(PAActiveObject
.getActiveObjectNode(PAActiveObject.getStubOnThis()));
}
} catch (Exception e) {
//dwooooo !
}
......@@ -551,12 +556,12 @@ public abstract class TaskLauncher implements InitActive {
protected void copyInputDataToScratch() throws FileSystemException {
if (isDataspaceAware()) {
if (inputFiles == null) {
logger_dev.debug("Input selector is empty, no file to copy");
logger_dev_dataspace.debug("Input selector is empty, no file to copy");
return;
}
//check first the OUTPUT and then the INPUT, take care if not set
if (INPUT == null && OUTPUT == null) {
logger_dev.debug("Job INPUT/OUTPUT spaces are not defined, cannot copy file.");
logger_dev_dataspace.debug("Job INPUT/OUTPUT spaces are not defined, cannot copy file.");
return;
}
......@@ -575,7 +580,7 @@ public abstract class TaskLauncher implements InitActive {
if (INPUT.getType().hasChildren()) {
Selector.findFiles(INPUT, ant, true, results);
} else {
logger_dev
logger_dev_dataspace
.debug("Cannot list files for this INPUT, switch to non-pattern mode and try again");
for (String incl : is.getInputFiles().getIncludes()) {
try {
......@@ -584,13 +589,13 @@ public abstract class TaskLauncher implements InitActive {
results.add(dsfo);
}
} catch (FileSystemException fse2) {
logger_dev.debug("Cannot read file " + incl, fse2);
logger_dev_dataspace.debug("Cannot read file " + incl, fse2);
toBeThrown = new FileSystemException("Cannot read file " + incl);
}
}
}
} catch (FileSystemException fse) {
logger_dev.info("", fse);
logger_dev_dataspace.info("", fse);
toBeThrown = new FileSystemException(
"Could not contact INPUT space. Check that INPUT space is still reachable !");
} catch (NullPointerException npe) {
......@@ -602,7 +607,7 @@ public abstract class TaskLauncher implements InitActive {
try {
Selector.findFiles(OUTPUT, ant, true, results);
} catch (FileSystemException fse) {
logger_dev.info("", fse);
logger_dev_dataspace.info("", fse);
toBeThrown = new FileSystemException(
"Could not contact OUTPUT space. Check that OUTPUT space is still reachable !");
;
......@@ -651,13 +656,13 @@ public abstract class TaskLauncher implements InitActive {
protected void copyScratchDataToOutput() throws FileSystemException {
if (isDataspaceAware()) {
if (outputFiles == null) {
logger_dev.debug("Output selector is empty, no file to copy");
logger_dev_dataspace.debug("Output selector is empty, no file to copy");
return;
}
//check first the OUTPUT and then the INPUT, take care if not set
if (OUTPUT == null) {
logger_dev.debug("Job OUTPUT space is not defined, cannot copy file.");
logger_dev_dataspace.debug("Job OUTPUT space is not defined, cannot copy file.");
return;
}
......@@ -683,12 +688,12 @@ public abstract class TaskLauncher implements InitActive {
dsfo,
org.objectweb.proactive.extensions.dataspaces.api.FileSelector.SELECT_SELF);
} catch (FileSystemException fse) {
logger_dev.warn("", fse);
logger_dev_dataspace.warn("", fse);
toBeThrown = fse;
}
}
} catch (FileSystemException fse) {
logger_dev.warn("", fse);
logger_dev_dataspace.warn("", fse);
toBeThrown = fse;
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment