Fix smpi_execute_benched.
int workersCount = Integer.parseInt(args[3]);
- Msg.info("Hello! Got "+ workersCount + " workers and "+tasksCount+" tasks to process");
+ Msg.info("Hello! My PID is "+getPID()+". Got "+ workersCount + " workers and "+tasksCount+" tasks to process");
for (int i = 0; i < tasksCount; i++) {
Task task = new Task("Task_" + i, taskComputeSize, taskCommunicateSize);
if ("finalize".equals(task.getName())) {
break;
}
- Msg.info("Received \"" + task.getName() + "\". Processing it.");
+ Msg.info("Received \"" + task.getName() + "\". Processing it (my pid is "+getPID()+").");
try {
task.execute();
} catch (TaskCancelledException e) {
$ java -classpath ${classpath:=.} app/masterworker/Main ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/app/masterworker/masterworker.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Using regular java threads.
-> [ 0.000000] (1:app.masterworker.Master@Jacquelin) Hello! Got 7 workers and 5 tasks to process
-> [ 0.860026] (2:app.masterworker.Worker@Tremblay) Received "Task_0". Processing it.
-> [ 1.752187] (3:app.masterworker.Worker@Fafard) Received "Task_1". Processing it.
-> [ 1.757531] (4:app.masterworker.Worker@Bourassa) Received "Task_2". Processing it.
-> [ 2.806417] (5:app.masterworker.Worker@Boivin) Received "Task_3". Processing it.
-> [ 2.811761] (6:app.masterworker.Worker@Ginette) Received "Task_4". Processing it.
+> [ 0.000000] (1:app.masterworker.Master@Jacquelin) Hello! My PID is 1. Got 7 workers and 5 tasks to process
+> [ 0.860026] (2:app.masterworker.Worker@Tremblay) Received "Task_0". Processing it (my pid is 2).
+> [ 1.752187] (3:app.masterworker.Worker@Fafard) Received "Task_1". Processing it (my pid is 3).
+> [ 1.757531] (4:app.masterworker.Worker@Bourassa) Received "Task_2". Processing it (my pid is 4).
+> [ 2.806417] (5:app.masterworker.Worker@Boivin) Received "Task_3". Processing it (my pid is 5).
+> [ 2.811761] (6:app.masterworker.Worker@Ginette) Received "Task_4". Processing it (my pid is 6).
> [ 2.811761] (1:app.masterworker.Master@Jacquelin) All tasks have been dispatched. Let's tell everybody the computation is over.
> [ 3.671783] (2:app.masterworker.Worker@Tremblay) Received Finalize. I'm done. See you!
> [ 4.563940] (3:app.masterworker.Worker@Fafard) Received Finalize. I'm done. See you!
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::string("message"));
+ /* Sleep a while before starting the example */
simgrid::s4u::this_actor::sleep_for(10);
/* - Send the task to the @ref worker */
# This file is used to scan the project for issues automatically
-# Browse the result here: https://sonarqube.com/dashboard?id=simgrid
+# Browse the result here: https://sonarcloud.io/dashboard/?id=simgrid
sonar.projectKey=simgrid
sonar.projectName=SimGrid
return jprocess;
}
+JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_nativeGetPID(JNIEnv* env, jobject jprocess)
+{
+ msg_process_t process = jprocess_to_native(jprocess, env);
+ return MSG_process_get_PID(process);
+}
+
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname) {
msg_process_t process = jprocess_to_native(jprocess, env);
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess);
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass cls, jint jresetPID);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv* env, jclass cls, jint pid);
+JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_nativeGetPID(JNIEnv* env, jobject jprocess);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv* env, jobject jprocess, jobject jname);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess(JNIEnv* env, jclass cls);
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv* env, jobject jprocess);
*
*/
public int getPID() {
+ if (pid == -1) // Don't traverse the JNI barrier if you already have the answer
+ pid = nativeGetPID();
return pid;
}
+ // This should not be used: the PID is supposed to be initialized from the C directly when the actor is created,
+ // but this sometimes fail, so let's play nasty but safe here.
+ private native int nativeGetPID();
/**
* This method returns the PID of the parent of a process.
*
export SONAR_SCANNER_OPTS="-server"
}
installBuildWrapper() {
- curl -LsS https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip > build-wrapper-linux-x86.zip
+ curl -LsS https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip > build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
}
installSonarQubeScanner
# See https://docs.travis-ci.com/user/sonarqube/ for more info on tokens
# don't show the token in the logs
set +x
-sonar-scanner -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN 2>&1 \
+sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN 2>&1 \
| grep -v 'INFO: Parsing /home/travis/build/simgrid/simgrid/Testing/CoverageInfo' \
| grep -v 'WARN: File not analysed by Sonar, so ignoring coverage: /usr/include/'