Correct instructions for Sobol Sampling script


(Aymericvie) #1

Hello everyone,

I am trying to code a Sobol Sampling on OpenMole but I am not able to make it work properly. The inputs (including the variables harshness and redNoise) and outputs are defined, but there seems to be a problem with my sampling instructions:

val my_sobol_sampling =
SobolSampling(
1000, // Number of points
harshness in (5.0, 95.0),
redNoise in (0.0, 30.0),
)

val myExploration = DirectSampling(
evaluation = netlogo ,
sampling = my_sobol_sampling
)

myExploration

This generates just one task that runs forever without writing down results. What did I miss?

I would like also to run the script on val env = EGIEnvironment(“vo.complex-systems.eu”) but likewise I do not know where to include it in the code.

Thank you very much in advance for your help.
Best,
Aymeric


#2

You can do:

val myExploration = DirectSampling(
  evaluation = netlogo on env,
  sampling = my_sobol_sampling
)

If you model is fast (less than 5 minutes to run), you must use grouping: http://openmole.org/Scale.html#Grouping


(Aymericvie) #3

Thanks a lot. It’s currently running and submitting, I will be waiting for the results to appear to see what it does.
Many thanks.
Aymeric


(Aymericvie) #4

Hello,
Do you think I can add a command like

myExploration hook SavePopulationHook(myExploration, workDirectory / “results”, frequency = 100) on env

to ask OpenMole to write down the results on a csv file?

Or does the grouping procedure already take care of that? Current scripts are running but not giving any output.

Thank you in advance.
Best,
Aymeric


#5

SavePopulationHook is for evolutionary algorithms only you would need a classical CSVHook:

https://next.openmole.org/Hooks.html#Copyfile


(Aymericvie) #6

Thank you for the suggestion. Sorry to bother you, I struggle in finding out which argument to input in the instruction. Can I place it within the myExploration definition? And what would be the correct argument to store in the CSV file the results of the sobol sampling?

val myExploration = DirectSampling(
evaluation = netlogo on env by 5 hook ToStringHook(),
sampling = my_sobol_sampling,
CSVHook(“workDirectory/results/test_sobol_sampling_1$(evaluation).csv”)
)

Thank you very much for your kind help.
Best,
Aymeric


#7

I guess something like:

val myExploration = DirectSampling(
  evaluation = netlogo on env by 5 hook CSVHook(workDirectory / "results/test_sobol_sampling.csv",
  sampling = my_sobol_sampling,
)

(Aymericvie) #8

Thanks a lot. It’s currently running, I hope it works fine now!
Thanks again.
Best,
Aymeric


(Aymericvie) #9

Hello,
Since our last messages, I have not been able to connect to my OpenMole instance. Is there any issue going on?
I encounter always a “Connexion Refused” and “unavailable website” error.

Before I could not access, my running scripts were having hundred of errors such as:

  • 500 internal servor error
  • can’t connect to grid
  • execution failed on remote environment

Is there any way I can fix that? I tried to clear the cache and access through private navigator but it did not change anything.
Best,
Aymeric


(Aymericvie) #10

Hello,

OpenMole was back online and I could run the script. Sadly after 120h of computation I still have no job showed as finished, nor anything stored in a csv file.

I encountered a lot of errors “Job execution failed”
org.openmole.core.exception.InternalProcessingError: Job status is FAILED
at org.openmole.plugin.environment.batch.refresh.RefreshActor$.$anonfun$receive$1(RefreshActor.scala:46)
at org.openmole.plugin.environment.batch.refresh.RefreshActor$.$anonfun$receive$1$adapted(RefreshActor.scala:32)
at org.openmole.plugin.environment.batch.environment.UsageControl$.tryWithToken(UsageControl.scala:16)
at org.openmole.plugin.environment.batch.refresh.RefreshActor$.receive(RefreshActor.scala:32)
at org.openmole.plugin.environment.batch.refresh.JobManager$DispatcherActor$.receive(JobManager.scala:53)
at org.openmole.plugin.environment.batch.refresh.JobManager$.$anonfun$dispatch$1(JobManager.scala:62)
at org.openmole.core.threadprovider.ThreadProvider$RunClosure.run(ThreadProvider.scala:24)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)

And a lot of errors “Job failed on remote environment”

Could Something be wrong with the code again?

Here is the script after the definition of inputs, outputs and imported model (called netlogo)

val my_sobol_sampling =
SobolSampling(
100, // Number of points
harshness in (5.0, 95.0),
redNoise in (0.0, 30.0),
)

val env = EGIEnvironment(“vo.complex-systems.eu”)

val myExploration = DirectSampling(
evaluation = netlogo on env by 5 hook CSVHook (workDirectory/“results/test_sobol_sampling.csv”
),
sampling = my_sobol_sampling
)

myExploration

Each run of the simulation lasts approximately 55 minutes on my own machine (2 core 4 threads, intel i5 7th gen, 8 Go RAM). Maybe the hook by 5 is a bit too much/less ?

Is there anything I can do to solve the issues met with the script?
Thank you very much in advance.
Best,
Aymeric Vie


(Jianliang Gao) #11

Hi Aymeric,

Are you using the latest OpenMOLE?

Did you manage to run any other jobs successfully? For example, any of the tutorial jobs.

Or did you try with 1 hook?

Best wishes,
Jianliang


#12

Hi Aymeric,

what is you model, how much memory does it take at peak ?

Romain


(Aymericvie) #13

Hello,

Thanks for the auick answer. The OpenMole instance is the latest as far as I know. I am currently running an alternative script with hook 1 to see what happens.

@reuillon How can I know the peak memory used? It is a Netlogo model.

Best,
Aymeric


(Aymericvie) #14

Small update on the script for Hook by 1:
So far I encountered a large number of errors, the majority on the type

HTTP error: java.io.IOException: https://grid05.lal.in2p3.fr:443/dpm/lal.in2p3.fr/home/vo.complex-systems.eu//openmole-e7abafa9-084e-4617-a101-3eb6e11a77f4/tmp/1536769897993/c507c65c-22ec-48cd-abe6-af08c2015213 responded with an error: 403 Forbidden

A few “Job status is failed” as well.

Hope it can help. Thank you in advance!
Best,
Aymeric


(Aymericvie) #15

Hello,

Nothing improved since our last discussion, I checked the platform a few days ago and the script had not written any results, with 1 hook or 5 hook. Maybe the architecture of the code is not correct, I don’t know. As far as I understand, the Sobol Sampling procedure aims to create a sample of points (written in a csv), sample that another program may be able to use as input. I currently deal with a 2D sample. The code compiles and runs but does not seem able to return anything. I struggle in understanding why it is not working after such a long time, and I’d very much appreciate your views on that.

Here is the script after the definition of inputs, outputs and imported model (called netlogo)

val my_sobol_sampling =
SobolSampling(
100, // Number of points
harshness in (5.0, 95.0),
redNoise in (0.0, 30.0),
)

val env = EGIEnvironment(“vo.complex-systems.eu”)

val myExploration = DirectSampling(
evaluation = netlogo on env by 5 hook CSVHook (workDirectory/“results/test_sobol_sampling.csv”
),
sampling = my_sobol_sampling
)
myExploration

More importantly, it is currently impossible to get access to my the OpenMole session. The navigator says “inaccessible website”. Is the platform somewhat down?

Thank you in advance for your kind help.
Best,
Aymeric


(Aymericvie) #16

Hello @reuillon !

Thanks for putting the platform back on track!

I encounter the following error trying to get the model run on the EGI environment vo.complex-systems.eu.

HTTP error: java.io.IOException: https://grid05.lal.in2p3.fr:443/dpm/lal.in2p3.fr/home/vo.complex-systems.eu//openmole-f6e61be2-4020-4720-b669-e74ff467c02b/persistent/1530714977601_5a7a5b69-75bf-4333-8f5d-12d2cff795f1.rep responded with an error: 404 Not Found

My (end of) script reads:
val env = EGIEnvironment(“vo.complex-systems.eu”)
val myExploration = DirectSampling(
evaluation = netlogo on env by 5 hook CSVHook (workDirectory/“results/test_sobol_sampling.csv”
),
sampling = my_sobol_sampling
)
myExploration

Maybe the link has changed? It used to work in the past. Normally our certificate is correct.
Cheers!
Best,
Aymeric


#17

Hello Aymeric,

I just updated you openmole instance, could you try again ?

Romain


(Aymericvie) #18

Thank you very much! It works now, the scripts run fine and generate results.
Oddly, the sample generate seems to generates them from the variables indicated as outputs in the model importation. For instance:

val netlogo = NetLogo6Task(workDirectory / "NetlogoSimulation.nlogo", launch, embedWorkspace = false, seed=seed) set(
inputs += (seed),
inputs += redNoise mapped "red-noise",
inputs += harshness mapped "harshness-%",
(among others inputs)
outputs += meandev mapped "mean-dev",

val my_sobol_sampling =
SobolSampling(
  10, // Number of points
  harshness in (5.0, 95.0),
  redNoise in (0.0, 30.0),
)

The sample generated only deals with the variable (output) meandev.

When no output is specified, the generated sample is empty.

Is there something I may have not well specified?

Best,

Aymeric

Le jeu. 25 oct. 2018 à 11:54, reuillon noreply@iscpif.fr a écrit :


#19

Can you provide a full example which reproduce this behaviour with a toy model or with your model, so I could run it and understand the pb ?