3 /* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "xbt/sysdep.h"
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gos, msg,
12 "Logging specific to MSG (gos)");
14 /** \defgroup msg_gos_functions MSG Operating System Functions
15 * \brief This section describes the functions that can be used
16 * by an agent for handling some task.
19 static MSG_error_t __MSG_task_get_with_time_out_from_host(m_task_t * task,
24 m_process_t process = MSG_process_self();
27 simdata_task_t t_simdata = NULL;
28 simdata_host_t h_simdata = NULL;
30 e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
31 xbt_fifo_item_t item = NULL;
34 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
36 xbt_assert0(task,"Null pointer for the task\n");
39 CRITICAL0("MSG_task_get() was asked to write in a non empty task struct.");
43 h_simdata = h->simdata;
45 DEBUG2("Waiting for a task on channel %d (%s)", channel,h->name);
48 if(xbt_fifo_size(h_simdata->mbox[channel])>0) {
50 t = xbt_fifo_shift(h_simdata->mbox[channel]);
53 xbt_fifo_foreach(h->simdata->mbox[channel],item,t,m_task_t) {
54 if(t->simdata->source==host) break;
57 xbt_fifo_remove_item(h->simdata->mbox[channel],item);
68 xbt_assert2(!(h_simdata->sleeping[channel]),
69 "A process (%s(%d)) is already blocked on this channel",
70 h_simdata->sleeping[channel]->name,
71 h_simdata->sleeping[channel]->simdata->PID);
72 h_simdata->sleeping[channel] = process; /* I'm waiting. Wake me up when you're ready */
74 __MSG_process_block(max_duration);
76 __MSG_process_block(-1);
78 h_simdata->sleeping[channel] = NULL;
80 if(surf_workstation_resource->extension_public->get_state(h_simdata->host)
82 MSG_RETURN(MSG_HOST_FAILURE);
83 /* OK, we should both be ready now. Are you there ? */
86 DEBUG1("OK, got a task (%s)", t->name);
88 t_simdata = t->simdata;
89 /* *task = __MSG_task_copy(t); */
95 while(MSG_process_is_suspended(t_simdata->sender)) {
96 DEBUG1("Oooups, the sender (%s) has been suspended in the meantime. Let's wait for him",
97 t_simdata->sender->name);
98 m_task_t task_to_wait_for = t_simdata->sender->simdata->waiting_task;
99 if(__MSG_process_isBlocked(t_simdata->sender)) {
100 DEBUG0("He's blocked. Let's wait for him to go in the suspended state");
101 __MSG_process_unblock(t_simdata->sender);
102 task_to_wait_for->simdata->using++;
103 __MSG_task_wait_event(process, task_to_wait_for);
104 MSG_task_destroy(task_to_wait_for);
106 DEBUG0("He's suspended. Let's wait for him to go in the resumed state");
107 task_to_wait_for->simdata->using++;
108 __MSG_task_wait_event(process, task_to_wait_for);
109 MSG_task_destroy(task_to_wait_for);
110 DEBUG0("He's resumed. He should block again. So let's free him.");
111 __MSG_process_unblock(t_simdata->sender);
115 DEBUG0("Calling SURF for communication creation");
116 t_simdata->comm = surf_workstation_resource->extension_public->
117 communicate(MSG_process_get_host(t_simdata->sender)->simdata->host,
118 h->simdata->host, t_simdata->message_size,t_simdata->rate);
120 surf_workstation_resource->common_public->action_set_data(t_simdata->comm,t);
122 if(__MSG_process_isBlocked(t_simdata->sender)) {
123 DEBUG1("Unblocking %s",t_simdata->sender->name);
124 __MSG_process_unblock(t_simdata->sender);
127 PAJE_PROCESS_PUSH_STATE(process,"C",t);
130 DEBUG0("Waiting for action termination");
131 __MSG_task_wait_event(process, t);
132 state=surf_workstation_resource->common_public->action_get_state(t_simdata->comm);
133 } while (state==SURF_ACTION_RUNNING);
134 DEBUG0("Action terminated");
136 if(t->simdata->using>1) {
137 xbt_fifo_unshift(msg_global->process_to_run,process);
141 PAJE_PROCESS_POP_STATE(process);
142 PAJE_COMM_STOP(process,t,channel);
144 if(state == SURF_ACTION_DONE) {
145 if(surf_workstation_resource->common_public->action_free(t_simdata->comm))
146 t_simdata->comm = NULL;
148 } else if(surf_workstation_resource->extension_public->get_state(h_simdata->host)
150 if(surf_workstation_resource->common_public->action_free(t_simdata->comm))
151 t_simdata->comm = NULL;
152 MSG_RETURN(MSG_HOST_FAILURE);
154 if(surf_workstation_resource->common_public->action_free(t_simdata->comm))
155 t_simdata->comm = NULL;
156 MSG_RETURN(MSG_TRANSFER_FAILURE);
160 /** \ingroup msg_gos_functions
161 * \brief Listen on a channel and wait for receiving a task.
163 * It takes two parameters.
164 * \param task a memory location for storing a #m_task_t. It will
165 hold a task when this function will return. Thus \a task should not
166 be equal to \c NULL and \a *task should be equal to \c NULL. If one of
167 those two condition does not hold, there will be a warning message.
168 * \param channel the channel on which the agent should be
169 listening. This value has to be >=0 and < than the maximal
170 number of channels fixed with MSG_set_channel_number().
171 * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
172 * if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
174 MSG_error_t MSG_task_get(m_task_t * task,
177 return MSG_task_get_with_time_out(task, channel, -1);
180 /** \ingroup msg_gos_functions
181 * \brief Listen on a channel and wait for receiving a task with a timeout.
183 * It takes three parameters.
184 * \param task a memory location for storing a #m_task_t. It will
185 hold a task when this function will return. Thus \a task should not
186 be equal to \c NULL and \a *task should be equal to \c NULL. If one of
187 those two condition does not hold, there will be a warning message.
188 * \param channel the channel on which the agent should be
189 listening. This value has to be >=0 and < than the maximal
190 number of channels fixed with MSG_set_channel_number().
191 * \param max_duration the maximum time to wait for a task before giving
192 up. In such a case, \a task will not be modified and will still be
193 equal to \c NULL when returning.
194 * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
195 if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
197 MSG_error_t MSG_task_get_with_time_out(m_task_t * task,
201 return __MSG_task_get_with_time_out_from_host(task, channel, max_duration, NULL);
204 /** \ingroup msg_gos_functions
205 * \brief Listen on \a channel and waits for receiving a task from \a host.
207 * It takes three parameters.
208 * \param task a memory location for storing a #m_task_t. It will
209 hold a task when this function will return. Thus \a task should not
210 be equal to \c NULL and \a *task should be equal to \c NULL. If one of
211 those two condition does not hold, there will be a warning message.
212 * \param channel the channel on which the agent should be
213 listening. This value has to be >=0 and < than the maximal
214 number of channels fixed with MSG_set_channel_number().
215 * \param host the host that is to be watched.
216 * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
217 if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
219 MSG_error_t MSG_task_get_from_host(m_task_t * task, int channel,
222 return __MSG_task_get_with_time_out_from_host(task, channel, -1, host);
225 /** \ingroup msg_gos_functions
226 * \brief Test whether there is a pending communication on a channel.
228 * It takes one parameter.
229 * \param channel the channel on which the agent should be
230 listening. This value has to be >=0 and < than the maximal
231 number of channels fixed with MSG_set_channel_number().
232 * \return 1 if there is a pending communication and 0 otherwise
234 int MSG_task_Iprobe(m_channel_t channel)
237 simdata_host_t h_simdata = NULL;
239 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
240 DEBUG2("Probing on channel %d (%s)", channel,h->name);
243 h_simdata = h->simdata;
244 return(xbt_fifo_get_first_item(h_simdata->mbox[channel])!=NULL);
247 /** \ingroup msg_gos_functions
248 * \brief Test whether there is a pending communication on a channel, and who sent it.
250 * It takes one parameter.
251 * \param channel the channel on which the agent should be
252 listening. This value has to be >=0 and < than the maximal
253 number of channels fixed with MSG_set_channel_number().
254 * \return -1 if there is no pending communication and the PID of the process who sent it otherwise
256 int MSG_task_probe_from(m_channel_t channel)
259 simdata_host_t h_simdata = NULL;
260 xbt_fifo_item_t item;
263 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
266 h_simdata = h->simdata;
268 DEBUG2("Probing on channel %d (%s)", channel,h->name);
270 item = xbt_fifo_get_first_item(h->simdata->mbox[channel]);
271 if (!item || !(t = xbt_fifo_get_item_content(item)))
274 return MSG_process_get_PID(t->simdata->sender);
277 /** \ingroup msg_gos_functions
278 * \brief Wait for at most \a max_duration second for a task reception
279 on \a channel. *\a PID is updated with the PID of the first process
280 that triggered this event if any.
282 * It takes three parameters:
283 * \param channel the channel on which the agent should be
284 listening. This value has to be >=0 and < than the maximal.
285 number of channels fixed with MSG_set_channel_number().
286 * \param PID a memory location for storing an int.
287 * \param max_duration the maximum time to wait for a task before
288 giving up. In the case of a reception, *\a PID will be updated
289 with the PID of the first process to send a task.
290 * \return #MSG_HOST_FAILURE if the host is shut down in the meantime
291 and #MSG_OK otherwise.
293 MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration,
297 simdata_host_t h_simdata = NULL;
298 xbt_fifo_item_t item;
301 m_process_t process = MSG_process_self();
303 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
308 if(max_duration==0.0) {
309 *PID = MSG_task_probe_from(channel);
314 h_simdata = h->simdata;
316 DEBUG2("Probing on channel %d (%s)", channel,h->name);
317 while(!(item = xbt_fifo_get_first_item(h->simdata->mbox[channel]))) {
323 xbt_assert2(!(h_simdata->sleeping[channel]),
324 "A process (%s(%d)) is already blocked on this channel",
325 h_simdata->sleeping[channel]->name,
326 h_simdata->sleeping[channel]->simdata->PID);
327 h_simdata->sleeping[channel] = process; /* I'm waiting. Wake me up when you're ready */
329 __MSG_process_block(max_duration);
331 __MSG_process_block(-1);
333 if(surf_workstation_resource->extension_public->get_state(h_simdata->host)
335 MSG_RETURN(MSG_HOST_FAILURE);
337 h_simdata->sleeping[channel] = NULL;
340 if (!item || !(t = xbt_fifo_get_item_content(item))) {
344 *PID = MSG_process_get_PID(t->simdata->sender);
351 /** \ingroup msg_gos_functions
353 * \brief Return the number of tasks waiting to be received on a \a
354 channel and sent by \a host.
356 * It takes two parameters.
357 * \param channel the channel on which the agent should be
358 listening. This value has to be >=0 and < than the maximal
359 number of channels fixed with MSG_set_channel_number().
360 * \param host the host that is to be watched.
361 * \return the number of tasks waiting to be received on \a channel
364 int MSG_task_probe_from_host(int channel, m_host_t host)
366 simdata_host_t h_simdata = NULL;
367 xbt_fifo_item_t item;
372 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
375 h_simdata = h->simdata;
377 DEBUG2("Probing on channel %d (%s)", channel,h->name);
379 xbt_fifo_foreach(h->simdata->mbox[channel],item,t,m_task_t) {
380 if(t->simdata->source==host) count++;
386 /** \ingroup msg_gos_functions
387 * \brief Put a task on a channel of an host and waits for the end of the
390 * This function is used for describing the behavior of an agent. It
391 * takes three parameter.
392 * \param task a #m_task_t to send on another location. This task
393 will not be usable anymore when the function will return. There is
394 no automatic task duplication and you have to save your parameters
395 before calling this function. Tasks are unique and once it has been
396 sent to another location, you should not access it anymore. You do
397 not need to call MSG_task_destroy() but to avoid using, as an
398 effect of inattention, this task anymore, you definitely should
399 renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
400 can be transfered iff it has been correctly created with
402 * \param dest the destination of the message
403 * \param channel the channel on which the agent should put this
404 task. This value has to be >=0 and < than the maximal number of
405 channels fixed with MSG_set_channel_number().
406 * \return #MSG_FATAL if \a task is not properly initialized and
409 MSG_error_t MSG_task_put(m_task_t task,
410 m_host_t dest, m_channel_t channel)
412 m_process_t process = MSG_process_self();
413 simdata_task_t task_simdata = NULL;
414 e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
415 m_host_t local_host = NULL;
416 m_host_t remote_host = NULL;
420 xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
422 task_simdata = task->simdata;
423 task_simdata->sender = process;
424 task_simdata->source = MSG_process_get_host(process);
425 xbt_assert0(task_simdata->using==1,
426 "This taks is still being used somewhere else. You cannot send it now. Go fix your code!");
427 task_simdata->comm = NULL;
429 local_host = ((simdata_process_t) process->simdata)->host;
432 DEBUG4("Trying to send a task (%g Mb) from %s to %s on channel %d",
433 task->simdata->message_size,local_host->name, remote_host->name, channel);
435 xbt_fifo_push(((simdata_host_t) remote_host->simdata)->
436 mbox[channel], task);
438 PAJE_COMM_START(process,task,channel);
440 if(remote_host->simdata->sleeping[channel]) {
441 DEBUG0("Somebody is listening. Let's wake him up!");
442 __MSG_process_unblock(remote_host->simdata->sleeping[channel]);
445 process->simdata->put_host = dest;
446 process->simdata->put_channel = channel;
447 while(!(task_simdata->comm)) {
448 DEBUG0("Communication not initiated yet. Let's block!");
449 __MSG_process_block(-1);
450 if(surf_workstation_resource->extension_public->
451 get_state(remote_host->simdata->host) == SURF_CPU_OFF) {
452 xbt_fifo_remove(((simdata_host_t) remote_host->simdata)->mbox[channel],
454 MSG_task_destroy(task);
455 MSG_RETURN(MSG_HOST_FAILURE);
458 DEBUG0("Registering to this communication");
459 surf_workstation_resource->common_public->action_use(task_simdata->comm);
460 process->simdata->put_host = NULL;
461 process->simdata->put_channel = -1;
464 PAJE_PROCESS_PUSH_STATE(process,"C",task);
466 state=surf_workstation_resource->common_public->action_get_state(task_simdata->comm);
467 while (state==SURF_ACTION_RUNNING) {
468 DEBUG0("Waiting for action termination");
469 __MSG_task_wait_event(process, task);
470 state=surf_workstation_resource->common_public->action_get_state(task_simdata->comm);
472 DEBUG0("Action terminated");
473 task->simdata->rate=-1.0; /* Sets the rate back to default */
475 PAJE_PROCESS_POP_STATE(process);
477 if(state == SURF_ACTION_DONE) {
478 if(surf_workstation_resource->common_public->action_free(task_simdata->comm))
479 task_simdata->comm = NULL;
480 MSG_task_destroy(task);
482 } else if(surf_workstation_resource->extension_public->get_state(local_host->simdata->host)
484 if(surf_workstation_resource->common_public->action_free(task_simdata->comm))
485 task_simdata->comm = NULL;
486 MSG_task_destroy(task);
487 MSG_RETURN(MSG_HOST_FAILURE);
489 if(surf_workstation_resource->common_public->action_free(task_simdata->comm))
490 task_simdata->comm = NULL;
491 MSG_task_destroy(task);
492 MSG_RETURN(MSG_TRANSFER_FAILURE);
496 /** \ingroup msg_gos_functions
497 * \brief Does exactly the same as MSG_task_put but with a bounded transmition
502 MSG_error_t MSG_task_put_bounded(m_task_t task,
503 m_host_t dest, m_channel_t channel,
506 MSG_error_t res = MSG_OK;
507 task->simdata->rate=max_rate;
508 res = MSG_task_put(task, dest, channel);
512 /** \ingroup msg_gos_functions
513 * \brief Executes a task and waits for its termination.
515 * This function is used for describing the behavior of an agent. It
516 * takes only one parameter.
517 * \param task a #m_task_t to execute on the location on which the
519 * \return #MSG_FATAL if \a task is not properly initialized and
522 MSG_error_t MSG_task_execute(m_task_t task)
524 m_process_t process = MSG_process_self();
527 DEBUG1("Computing on %s", process->simdata->host->name);
529 __MSG_task_execute(process, task);
531 PAJE_PROCESS_PUSH_STATE(process,"E",task);
532 res = __MSG_wait_for_computation(process,task);
533 PAJE_PROCESS_POP_STATE(process);
537 void __MSG_task_execute(m_process_t process, m_task_t task)
539 simdata_task_t simdata = NULL;
543 simdata = task->simdata;
544 xbt_assert0((!simdata->compute)&&(task->simdata->using==1),
545 "This taks is executed somewhere else. Go fix your code!");
546 task->simdata->using++;
547 simdata->compute = surf_workstation_resource->extension_public->
548 execute(MSG_process_get_host(process)->simdata->host,
549 simdata->computation_amount);
550 surf_workstation_resource->common_public->
551 set_priority(simdata->compute, simdata->priority);
553 surf_workstation_resource->common_public->action_set_data(simdata->compute,task);
554 task->simdata->using--;
557 MSG_error_t __MSG_wait_for_computation(m_process_t process, m_task_t task)
559 e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
560 simdata_task_t simdata = task->simdata;
562 XBT_IN4("(%p(%s) %p(%s))",process,process->name,task,task->name);
565 __MSG_task_wait_event(process, task);
566 state=surf_workstation_resource->common_public->action_get_state(simdata->compute);
567 } while (state==SURF_ACTION_RUNNING);
571 if(state == SURF_ACTION_DONE) {
572 if(surf_workstation_resource->common_public->action_free(simdata->compute))
573 simdata->compute = NULL;
574 simdata->computation_amount = 0.0;
577 } else if(surf_workstation_resource->extension_public->
578 get_state(MSG_process_get_host(process)->simdata->host)
580 if(surf_workstation_resource->common_public->action_free(simdata->compute))
581 simdata->compute = NULL;
583 MSG_RETURN(MSG_HOST_FAILURE);
585 if(surf_workstation_resource->common_public->action_free(simdata->compute))
586 simdata->compute = NULL;
588 MSG_RETURN(MSG_TASK_CANCELLED);
591 /** \ingroup m_task_management
592 * \brief Creates a new #m_task_t (a parallel one....).
594 * A constructor for #m_task_t taking six arguments and returning the
595 corresponding object.
596 * \param name a name for the object. It is for user-level information
598 * \param host_nb the number of hosts implied in the parallel task.
599 * \param host_list an array of \p host_nb m_host_t.
600 * \param computation_amount an array of \p host_nb
601 doubles. computation_amount[i] is the total number of operations
602 that have to be performed on host_list[i].
603 * \param communication_amount an array of \p host_nb* \p host_nb doubles.
604 * \param data a pointer to any data may want to attach to the new
605 object. It is for user-level information and can be NULL. It can
606 be retrieved with the function \ref MSG_task_get_data.
608 * \return The new corresponding object.
610 m_task_t MSG_parallel_task_create(const char *name,
612 const m_host_t *host_list,
613 double *computation_amount,
614 double *communication_amount,
617 simdata_task_t simdata = xbt_new0(s_simdata_task_t,1);
618 m_task_t task = xbt_new0(s_m_task_t,1);
622 task->name = xbt_strdup(name);
623 task->simdata = simdata;
627 simdata->sleeping = xbt_dynar_new(sizeof(m_process_t),NULL);
628 simdata->rate = -1.0;
630 simdata->sender = NULL;
631 simdata->source = NULL;
632 simdata->host_nb = host_nb;
634 simdata->host_list = xbt_new0(void *, host_nb);
635 simdata->comp_amount = computation_amount;
636 simdata->comm_amount = communication_amount;
638 for(i=0;i<host_nb;i++)
639 simdata->host_list[i] = host_list[i]->simdata->host;
645 static void __MSG_parallel_task_execute(m_process_t process, m_task_t task)
647 simdata_task_t simdata = NULL;
651 simdata = task->simdata;
653 xbt_assert0(simdata->host_nb,"This is not a parallel task. Go to hell.");
655 simdata->compute = surf_workstation_resource->extension_public->
656 execute_parallel_task(task->simdata->host_nb,
657 task->simdata->host_list,
658 task->simdata->comp_amount,
659 task->simdata->comm_amount,
663 surf_workstation_resource->common_public->action_set_data(simdata->compute,task);
666 MSG_error_t MSG_parallel_task_execute(m_task_t task)
668 m_process_t process = MSG_process_self();
671 DEBUG0("Computing on a tons of guys");
673 __MSG_parallel_task_execute(process, task);
675 if(task->simdata->compute)
676 res = __MSG_wait_for_computation(process,task);
684 /** \ingroup msg_gos_functions
685 * \brief Sleep for the specified number of seconds
687 * Makes the current process sleep until \a time seconds have elapsed.
689 * \param nb_sec a number of second
691 MSG_error_t MSG_process_sleep(double nb_sec)
693 e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
694 m_process_t process = MSG_process_self();
695 m_task_t dummy = NULL;
696 simdata_task_t simdata = NULL;
699 dummy = MSG_task_create("MSG_sleep", nb_sec, 0.0, NULL);
700 simdata = dummy->simdata;
702 simdata->compute = surf_workstation_resource->extension_public->
703 sleep(MSG_process_get_host(process)->simdata->host,
704 simdata->computation_amount);
705 surf_workstation_resource->common_public->action_set_data(simdata->compute,dummy);
710 __MSG_task_wait_event(process, dummy);
711 state=surf_workstation_resource->common_public->action_get_state(simdata->compute);
712 } while (state==SURF_ACTION_RUNNING);
715 if(state == SURF_ACTION_DONE) {
716 if(surf_workstation_resource->extension_public->
717 get_state(MSG_process_get_host(process)->simdata->host)
719 if(surf_workstation_resource->common_public->action_free(simdata->compute))
720 simdata->compute = NULL;
721 MSG_RETURN(MSG_HOST_FAILURE);
723 if(__MSG_process_isBlocked(process)) {
724 __MSG_process_unblock(MSG_process_self());
726 if(surf_workstation_resource->extension_public->
727 get_state(MSG_process_get_host(process)->simdata->host)
729 if(surf_workstation_resource->common_public->action_free(simdata->compute))
730 simdata->compute = NULL;
731 MSG_RETURN(MSG_HOST_FAILURE);
733 if(surf_workstation_resource->common_public->action_free(simdata->compute))
734 simdata->compute = NULL;
735 MSG_task_destroy(dummy);
737 } else MSG_RETURN(MSG_HOST_FAILURE);
740 /** \ingroup msg_gos_functions
741 * \brief Return the number of MSG tasks currently running on
742 * the host of the current running process.
744 static int MSG_get_msgload(void)
750 xbt_assert0(0, "This function is still to be specified correctly (what do you mean by 'load', exactly?). In the meantime, please don't use it");
751 process = MSG_process_self();
752 return xbt_fifo_size(process->simdata->host->simdata->process_list);
755 /** \ingroup msg_gos_functions
757 * \brief Return the last value returned by a MSG function (except
760 MSG_error_t MSG_get_errno(void)
762 return PROCESS_GET_ERRNO();